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

chore: added external config for defining rest-allowed-origin flag. #78

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
1 change: 1 addition & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,4 @@ NODEKEY=
DOMAIN=
EXTRA_ARGS=
STORAGE_SIZE=
ALLOW_ORIGIN=
1 change: 1 addition & 0 deletions ADVANCED.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ There are multiple environment variables you can configure to modify behaviour o
* `EXTRA_ARGS` - this variable allows you to specify additional or overriding CLI option for the Waku node which will be appended to the `wakunode2` command. (e.g. `EXTRA_ARGS="--store=false --max-connections=3000`)
* `CERTS_DIR` - allows you to define a path where SSL certificates are/will be stored. It needs to follow the directory structure produced by Certbot in `/etc/letsencrypt`
* `STORATE_SIZE` - overrides the default allowed DB size of waku message storage service. Current default is 1GB. (e.g. `STORAGE_SIZE=2GB` or `STORAGE_SIZE=3500MB`)
* `ALLOW_ORIGIN` - Can set the allowed origin site that is enabled to use waku node's REST-API from browser. Great if you are connecting to the node with REST-API from a browser based app. (e.g. `ALLOW_ORIGIN=example.com` or `ALLOW_ORIGIN=localhost:*`)
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
* `ALLOW_ORIGIN` - Can set the allowed origin site that is enabled to use waku node's REST-API from browser. Great if you are connecting to the node with REST-API from a browser based app. (e.g. `ALLOW_ORIGIN=example.com` or `ALLOW_ORIGIN=localhost:*`)
* `ALLOW_ORIGIN` - Can set the allowed origin site that is enabled to use waku node's [REST-API](https://waku-org.github.io/waku-rest-api/) from browser. Great if you are connecting to the node with REST-API from a browser based app. (e.g. `ALLOW_ORIGIN=example.com` or `ALLOW_ORIGIN=localhost:*`)


## Log monitoring and troubleshooting

Expand Down
1 change: 1 addition & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ services:
ETH_CLIENT_ADDRESS: *eth_client_address
EXTRA_ARGS: ${EXTRA_ARGS}
STORAGE_SIZE: ${STORAGE_SIZE}
ALLOW_ORIGIN: ${ALLOW_ORIGIN}
<<:
- *pg_env
- *rln_env
Expand Down
8 changes: 6 additions & 2 deletions run_node.sh
Original file line number Diff line number Diff line change
Expand Up @@ -48,17 +48,20 @@ fi

RLN_RELAY_CRED_PATH=--rln-relay-cred-path=${RLN_RELAY_CRED_PATH:-/keystore/keystore.json}


if [ -n "${RLN_RELAY_CRED_PASSWORD}" ]; then
RLN_RELAY_CRED_PASSWORD=--rln-relay-cred-password="${RLN_RELAY_CRED_PASSWORD}"
fi

STORE_RETENTION_POLICY=--store-message-retention-policy=size:1GB}

if [ -n "${STORAGE_SIZE}" ]; then
STORE_RETENTION_POLICY=--store-message-retention-policy=size:"${STORAGE_SIZE}"
fi

USER_REST_ALLOW_ORIGIN=
if [ -n "${ALLOW_ORIGIN}" ]; then
USER_REST_ALLOW_ORIGIN=--rest-allow-origin=\"${ALLOW_ORIGIN}\"
fi

exec /usr/bin/wakunode\
--relay=true\
--filter=true\
Expand Down Expand Up @@ -89,5 +92,6 @@ exec /usr/bin/wakunode\
${DNS_WSS_CMD}\
${NODEKEY}\
${STORE_RETENTION_POLICY}\
${USER_REST_ALLOW_ORIGIN}\
${EXTRA_ARGS}