Skip to content

Commit c1dc08e

Browse files
committed
README - add infromation about enabling TLS
Docker-sentry - add env. variables for TLS
1 parent 96ff39d commit c1dc08e

File tree

2 files changed

+17
-5
lines changed

2 files changed

+17
-5
lines changed

Dockerfile-sentry

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,11 @@ ENV KEYSTORE_PWD=
6565
# Only applicable if you use the `--adapter dummy`
6666
ENV DUMMY_IDENTITY=
6767

68+
# To setup TLS supply both `PRIVATE_KEYS` & `CERTIFICATES`
69+
# Otherwise you will get an error
70+
ENV PRIVATE_KEYS=
71+
ENV CERTIFICATES=
72+
6873
# If set it will override the configuration file used
6974
ENV CONFIG=
7075

@@ -85,4 +90,6 @@ ENTRYPOINT ["./scripts/entrypoint.sh"]
8590
CMD sentry -a ${ADAPTER:-ethereum} \
8691
${KEYSTORE_FILE:+-k $KEYSTORE_FILE} \
8792
${DUMMY_IDENTITY:+-i $DUMMY_IDENTITY} \
93+
${PRIVATE_KEYS:+--privateKeys $PRIVATE_KEYS} \
94+
${CERTIFICATES:+--certificates $CERTIFICATES} \
8895
${CONFIG}

README.md

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,13 @@ cargo run -p sentry -- --help
5757

5858
Starting the Sentry API in will always run migrations, this will make sure the database is always up to date with the latest migrations, before starting and exposing the web server.
5959

60-
By default, we use the `development` environment ( [`ENV` environment variable](#environment-variables) ) as it will also seed the database.
60+
By default, we use the `development` environment ( [`ENV` environment variable](#environment-variables) ) ~~as it will also seed the database~~ (seeding is disabled, see #514).
61+
62+
To enable TLS for the sentry server you need to pass both `--privateKeys` and
63+
`--certificates` cli options (paths to `.pem` files) otherwise the cli will
64+
exit with an error.
65+
66+
For full list of available addresses see [primitives/src/test_util.rs#L39-L118](./primitives/src/test_util.rs#L39-L118)
6167

6268
#### Using the `Ethereum` adapter
6369

@@ -100,7 +106,7 @@ POSTGRES_DB="sentry_follower" PORT=8006 KEYSTORE_PWD=ganache1 cargo run -p sentr
100106
IP_ADDR=127.0.0.1 REDIS_URL="redis://127.0.0.1:6379/1" \
101107
POSTGRES_DB="sentry_leader" PORT=8005 cargo run -p sentry -- \
102108
--adapter dummy \
103-
--dummyIdentity 80690751969B234697e9059e04ed72195c3507fa \
109+
--dummyIdentity 0x80690751969B234697e9059e04ed72195c3507fa \
104110
./docs/config/prod.toml
105111
```
106112
##### Follower (`0xf3f583AEC5f7C030722Fe992A5688557e1B86ef7`)
@@ -109,19 +115,18 @@ POSTGRES_DB="sentry_leader" PORT=8005 cargo run -p sentry -- \
109115
IP_ADDR=127.0.0.1 REDIS_URL="redis://127.0.0.1:6379/2" \
110116
POSTGRES_DB="sentry_follower" PORT=8006 cargo run -p sentry -- \
111117
--adapter dummy \
112-
--dummyIdentity f3f583AEC5f7C030722Fe992A5688557e1B86ef7 \
118+
--dummyIdentity 0xf3f583AEC5f7C030722Fe992A5688557e1B86ef7 \
113119
./docs/config/prod.toml
114120
```
115121

116-
For full list, check out [primitives/src/util/tests/prep_db.rs#L29-L43](./primitives/src/util/tests/prep_db.rs#L29-L43)
117-
118122
#### Environment variables
119123

120124
- `ENV` - `production` or `development`; *default*: `development` - passing this env. variable will use the default configuration paths - [`docs/config/dev.toml`](./docs/config/dev.toml) (for `development`) or [`docs/config/prod.toml`](./docs/config/prod.toml) (for `production`). Otherwise you can pass your own configuration file path to the binary (check `cargo run -p sentry --help` for more information). In `development` it will make sure Sentry to seed the database.
121125
- `PORT` - *default*: `8005` - The local port that Sentry API will be accessible at
122126
- `IP_ADDR` - *default*: `0.0.0.0` - the IP address that the API should be listening to
123127

124128
##### Adapter
129+
125130
- `KEYSTORE_PWD` - Password for the `Keystore file`, only available when using `Ethereum` adapter (`--adapter ethereum`)
126131

127132
##### Redis

0 commit comments

Comments
 (0)