referral-service: support setting public domain
Signed-off-by: Jakub Sokołowski <jakub@status.im>
This commit is contained in:
parent
b7e2b3d8ca
commit
526a959d3e
|
@ -2,6 +2,8 @@
|
|||
|
||||
This repo configures infrastructure for the [referral-service](https://github.com/status-im/referral-service).
|
||||
|
||||
Configured by the [`ansible/roles/referral-service`](ansible/roles/referral-service) role.
|
||||
|
||||
# Endpoints
|
||||
|
||||
* https://prod-referral.status.im/admin - Production
|
||||
|
|
|
@ -1,11 +1,20 @@
|
|||
---
|
||||
# required service env variables
|
||||
referral_srv_public_domain: '{{ stage }}-referral.status.im'
|
||||
referral_srv_public_port: 443
|
||||
referral_srv_public_protocol: 'https'
|
||||
|
||||
# Google Sign-In
|
||||
referral_srv_google_sign_in_client_id: '{{lookup("passwordstore", "service/referral-service/test/google/sign-in-client-id")}}'
|
||||
referral_srv_google_sign_in_client_secret: '{{lookup("passwordstore", "service/referral-service/test/google/sign-in-client-secret")}}'
|
||||
|
||||
# Ethereum contract
|
||||
referral_srv_eth_http_endpoint: '{{lookup("passwordstore", "service/referral-service/test/eth/endpoint")}}'
|
||||
referral_srv_eth_contract_address: '{{lookup("passwordstore", "service/referral-service/test/eth/contract-addr")}}'
|
||||
referral_srv_eth_contract_name: '{{lookup("passwordstore", "service/referral-service/test/eth/contract-name")}}'
|
||||
referral_srv_eth_private_key: '{{lookup("passwordstore", "service/referral-service/test/eth/priv-key")}}'
|
||||
|
||||
# Rails secret key base
|
||||
referral_srv_secret_key_base: '{{lookup("passwordstore", "service/referral-service/test/secret-key-base")}}'
|
||||
|
||||
# Referral Service API port
|
||||
|
|
|
@ -6,13 +6,17 @@ This role configures the [referral-service](https://github.com/status-im/referra
|
|||
|
||||
Mostly the service requires certain secrets to be set:
|
||||
```yaml
|
||||
# OAuth settings
|
||||
referral_srv_domain: 'referral.example.org'
|
||||
referral_srv_public_port: 443
|
||||
referral_srv_public_protocol: 'https'
|
||||
|
||||
# for production cookies
|
||||
referral_srv_secret_key_base: '128charLongHexadecimal'
|
||||
|
||||
# For Play Store integration
|
||||
referral_srv_google_product_id: 'referral.0'
|
||||
referral_srv_google_package_name: 'im.status.ethereum'
|
||||
referral_srv_google_auth_json: '{"AUTH":"JSON"}'
|
||||
referral_srv_google_sign_in_client_id: '1234-abcd..apps.googleusercontent.com'
|
||||
referral_srv_google_sign_in_client_secret: 'super-secret-secret'
|
||||
|
||||
# For sending transactions via Infura
|
||||
referral_srv_eth_http_endpoint: 'https://mainnet.infura.io/v1/ABC'
|
||||
|
@ -26,11 +30,11 @@ referral_srv_eth_private_key: '0x4321'
|
|||
There are 4 containers in total:
|
||||
```
|
||||
$ docker ps
|
||||
CONTAINER ID NAMES IMAGE CREATED STATUS
|
||||
73944b7f9b8b referral-app statusteam/referral:deploy-test 2 hours ago Up 2 hours
|
||||
69c684944dd7 referral-queue statusteam/referral:deploy-test 2 hours ago Up 2 hours
|
||||
d08c1de07f06 referral-cache redis:5.0-alpine 2 hours ago Up 2 hours
|
||||
bef8a88c79db referral-db postgres:9.6-alpine 2 hours ago Up 2 hours
|
||||
CONTAINER ID NAMES IMAGE CREATED STATUS
|
||||
73944b7f9b8b referral-app statusteam/referral:deploy-test 2 hours ago Up 2 hours
|
||||
69c684944dd7 referral-queue statusteam/referral:deploy-test 2 hours ago Up 2 hours
|
||||
d08c1de07f06 referral-cache redis:5.0-alpine 2 hours ago Up 2 hours
|
||||
bef8a88c79db referral-db postgres:9.6-alpine 2 hours ago Up 2 hours
|
||||
```
|
||||
|
||||
And they are created using [Docker Compose](https://docs.docker.com/compose/), which is also the best way to manage them:
|
||||
|
|
|
@ -1,4 +1,9 @@
|
|||
---
|
||||
# OAuth settings
|
||||
referral_srv_public_domain: ~
|
||||
referral_srv_public_port: 443
|
||||
referral_srv_public_protocol: 'https'
|
||||
|
||||
# Key base for production cookies
|
||||
referral_srv_secret_key_base: ~
|
||||
|
||||
|
|
|
@ -1,10 +1,15 @@
|
|||
# Application
|
||||
RAILS_ENV=production
|
||||
RAILS_MAX_THREADS={{ ansible_processor_vcpus }}
|
||||
RAILS_MAX_THREADS={{ ansible_processor_vcpus | default(2) }}
|
||||
SECRET_KEY_BASE={{ referral_srv_secret_key_base | mandatory }}
|
||||
PORT={{ referral_srv_app_port }}
|
||||
PORT={{ referral_srv_app_port | mandatory }}
|
||||
PIDFILE=/tmp/app.pid
|
||||
|
||||
# OAuth settings
|
||||
REFERRAL_HOST={{ referral_srv_public_domain | mandatory }}
|
||||
REFERRAL_PORT={{ referral_srv_public_port | mandatory }}
|
||||
REFERRAL_PROTOCOL={{ referral_srv_public_protocol | mandatory }}
|
||||
|
||||
# Google Play Store
|
||||
GOOGLE_SIGN_IN_CLIENT_ID={{ referral_srv_google_sign_in_client_id | mandatory }}
|
||||
GOOGLE_SIGN_IN_CLIENT_SECRET={{ referral_srv_google_sign_in_client_secret | mandatory }}
|
||||
|
|
Loading…
Reference in New Issue