Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Convert SECURE_CHANNELS value from boolean to string #108

Merged
merged 1 commit into from
Jan 25, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ ENV MIX_ENV=prod \
MIX_ENV=prod \
PORT=4000 \
HOSTNAME=localhost \
JWT_SECRET=SOMETHING_SUPER_SECRET
JWT_SECRET=SOMETHING_SUPER_SECRET \
SECURE_CHANNELS=true
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@soedirgo since this is a Dockerfile, doesn't matter if it's true or 'true'.


RUN apt-get update

Expand Down
27 changes: 25 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -163,9 +163,32 @@ DB_RETRY_INITIAL_DELAY # {number} Database connection retry initial delay
DB_RETRY_MAXIMUM_DELAY # {number} Database connection retry maximum delay in milliseconds. Default is 300000 (5 minutes).
DB_RETRY_JITTER # {number} Database connection retry jitter in milliseconds. Default is 10 (10%).

SECURE_CHANNELS # {boolean} (true/false) Enable/Disable channels authorization via JWT verification.
SECURE_CHANNELS # {string} (options: 'true' or 'false') Enable/Disable channels authorization via JWT verification.
JWT_SECRET # {string} HS algorithm octet key (e.g. "95x0oR8jq9unl9pOIx"). Only required if SECURE_CHANNELS is set to true.
JWT_CLAIM_VALIDATORS # {JSON object} Claim key and expected claim value pairs compared (equality checks) to JWT claims in order to validate JWT. e.g. {'iss': 'Issuer', 'nbf': 1610078130}. This is optional but encouraged.
JWT_CLAIM_VALIDATORS # {string} Expected claim key/value pairs compared to JWT claims via equality checks in order to validate JWT. e.g. '{"iss": "Issuer", "nbf": 1610078130}'. This is optional but encouraged.
```

**EXAMPLE: RUNNING SERVER WITH ALL OPTIONS**

```sh
# Update the environment variables to point to your own database
docker run \
-e DB_HOST='docker.for.mac.host.internal' \
-e DB_NAME='postgres' \
-e DB_USER='postgres' \
-e DB_PASSWORD='postgres' \
-e DB_PORT=5432 \
-e PORT=4000 \
-e HOSTNAME='localhost' \
-e JWT_SECRET='SOMETHING_SUPER_SECRET' \
-p 4000:4000 \
-e DB_RETRY_INITIAL_DELAY=500 \
-e DB_RETRY_MAXIMUM_DELAY=300000 \
-e DB_RETRY_JITTER=10 \
-e SECURE_CHANNELS='true' \
-e JWT_SECRET='jwt-secret' \
-e JWT_CLAIM_VALIDATORS='{"iss": "Issuer", "nbf": 1610078130}' \
supabase/realtime
```

### Channels Authorization
Expand Down
1 change: 1 addition & 0 deletions docker-compose.dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ services:
PORT: 4000
HOSTNAME: localhost
JWT_SECRET: SOMETHING_SUPER_SECRET
SECURE_CHANNELS: 'true'
depends_on:
- db
db:
Expand Down
1 change: 1 addition & 0 deletions examples/next-js/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ services:
PORT: 4000
HOSTNAME: localhost
JWT_SECRET: SOMETHING_SUPER_SECRET
SECURE_CHANNELS: 'true'
db:
image: supabase/postgres
ports:
Expand Down
1 change: 1 addition & 0 deletions examples/node-js/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ services:
PORT: 4000
HOSTNAME: localhost
JWT_SECRET: SOMETHING_SUPER_SECRET
SECURE_CHANNELS: 'true'
db:
image: supabase/postgres
ports:
Expand Down