referral-service: support setting public domain

Signed-off-by: Jakub Sokołowski <jakub@status.im>
This commit is contained in:
Jakub Sokołowski 2020-07-07 17:36:08 +02:00
parent b7e2b3d8ca
commit 526a959d3e
No known key found for this signature in database
GPG Key ID: 4EF064D0E6D63020
5 changed files with 35 additions and 10 deletions

View File

@ -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

View File

@ -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

View File

@ -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'

View File

@ -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: ~

View File

@ -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 }}