Configuring the SDP
Stellar Disbursement Platform services can be configured using a set of configuration options that are passed to the command line or set as environment variables. Depending on how you're using and deploying the SDP, these configurations can be set in a ConfigMap in Kubernetes, as environment variables in a Docker container, passed in as command line arguments, etc.
In this section we will discuss the different configuration options available for the SDP.
Notes:
- Configurations that are tagged with π are sensitive and should be stored securely.
- These configurations are valid for version 2.x of the SDP.
- All configurations can be passed in as either environment variables or CLI flags. For instance, the env var
BASE_URL
could be passed in through the--base-url
flag. CLI flags take priority over env vars, even though env vars are more convenient.
SDP Core Serviceβ
For the most up-to-date configuration, you can run the following command in the stellar-disbursement-platform-backend git repository:
- bash
./stellar-disbursement-platform serve --help
Operational Configurationβ
Operational Configuration allows controlling metrics, logging, and other operational aspects of the SDP Core Service.
PORT
- The port on which the SDP Core Service will listen for incoming HTTP requests. Default: 8000.LOG_LEVEL
- Determines the verbosity level of logs. Options: "TRACE", "DEBUG", "INFO", "WARN", "ERROR", "FATAL", or "PANIC". Default: "TRACE".METRICS_PORT
- The port on which the SDP Core Service will expose its metrics. Default: 8002.METRICS_TYPE
- The type of metrics to expose. Options: "PROMETHEUS". Default: "PROMETHEUS".CRASH_TRACKER_TYPE
- The crash tracker type to use. Options: "SENTRY", "DRY_RUN". Default: "DRY_RUN".SENTRY_DSN
- π The DSN (client key) of the Sentry project. If not provided, Sentry will not be used.ENVIRONMENT
- The environment where the application is running. Example: "development", "staging", "production". Default: "development".DATABASE_URL
- π The connection string for the PostgreSQL database. Format ispostgres://username:password@host:port/database?sslmode=disable
. Default: "postgres://localhost:5432/sdp?sslmode=disable".BASE_URL
- The SDP backend server's base URL. Default: "http://localhost:8000". Tenant-specific URLs will be configured during the tenant provisioning process.SDP_UI_BASE_URL
- The SDP UI/dashboard Base URL used to send the invitation link when a new user is created. Tenant-specific URLs will be configured during the tenant provisioning process.
Messaging Configurationβ
Messaging Configuration allows configuring the messaging service used to send messages to recipients and sdp dashboard users. The default configuration is set to "DRY_RUN" which means no messages will be sent and the messages will be logged to the console. This is recommended for testing purposes only.
EMAIL_SENDER_TYPE
: The messenger type used to send invitations to new dashboard users. Options: "DRY_RUN", "TWILIO_EMAIL", "AWS_EMAIL". Default: "DRY_RUN".SMS_SENDER_TYPE
: The messenger type used to send SMS messages to recipients. Options: "DRY_RUN", "TWILIO_SMS", "AWS_SMS". Default: "DRY_RUN".
AWS Configurationβ
The following configurations are required when using AWS SES or SNS to send emails or SMS messages.
AWS_ACCESS_KEY_ID
- π The AWS access key ID.AWS_REGION
- The AWS region where the SES service is available.AWS_SECRET_ACCESS_KEY
- π The AWS secret access key.AWS_SES_SENDER_ID
- The email that AWS SES will use as the sender when sending emails. Required whenEMAIL_SENDER_TYPE
is set to "AWS_EMAIL".AWS_SNS_SENDER_ID
- The sender ID to use when sending SMS messages using AWS SNS. Required whenSMS_SENDER_TYPE
is set to "AWS_SMS".
Twilio Configurationβ
The following configurations are required when SMS_SENDER_TYPE=TWILIO_SMS
.
TWILIO_ACCOUNT_SID
- π The Twilio account SID.TWILIO_AUTH_TOKEN
- π The Twilio auth token.TWILIO_SERVICE_SID
- The Twilio service SID.
The following configurations are required when EMAIL_SENDER_TYPE=TWILIO_EMAIL
.
TWILIO_SENDGRID_API_KEY
- π The API key for the Twilio SendGrid (email) service.TWILIO_SENDGRID_SENDER_ADDRESS
- The email address used to send emails via Twilio SendGrid.
General Messaging Configurationβ
MAX_INVITATION_RESEND_ATTEMPTS
- The maximum number of attempts to (auto) resend the invitation to the Receiver Wallets. Default: 3.
Stellar Configurationβ
Stellar Configuration allows configuring accounts, transactions, and other Stellar-related settings.
NETWORK_PASSPHRASE
- The Stellar network passphrase. Default "Test SDF Network ; September 2015".HORIZON_URL
- The URL of the Horizon server to use for submitting transactions. Default "https://horizon-testnet.stellar.org/".SEP10_SIGNING_PUBLIC_KEY
- The public key of the Stellar account that signs the SEP-10 transactions. It's also used to sign URLs.SEP10_SIGNING_PRIVATE_KEY
- π The private key of the Stellar account that signs the SEP-10 transactions. It's also used to sign URLs.MAX_BASE_FEE
- The max base fee for submitting a Stellar transaction. Default: 10000.
The remaining configurations related to distribution accounts are detailed in the Stellar accounts configuration
section of 1.x to 2.x Migration Guide.
Security Configurationβ
Security Configuration allows configuring the security aspects of the SDP Core Service.
CORS_ALLOWED_ORIGINS
- Specifies the domains allowed to make cross-origin requests. "" means all domains are allowed. Domains can contain wildcards, e.g., "https://.example.com".SEP24_JWT_SECRET
- π The secret used to sign the JWT token for SEP-24 transactions. This secret is used during the receiver wallet registration flow.
Dashboard Authentication Configurationβ
The following configurations are related to dashboard user authentication and authorization.
RESET_TOKEN_EXPIRATION_HOURS
- The expiration time in hours of the Reset Password Token. Default: 24 (hours).EC256_PUBLIC_KEY
- The EC256 Public Key used to validate the token signature. This EC key needs to be at least as strong as prime256v1 (P-256).EC256_PRIVATE_KEY
- π The EC256 Private Key used to sign the authentication token. This EC key needs to be at least as strong as prime256v1 (P-256).DISABLE_MFA
- Disables Multi-Factor Authentication (MFA) for the SDP dashboard users.DISABLE_RECAPTCHA
- Disables Google reCAPTCHA v2 for the SDP dashboard users. This flag doesn't affect the reCAPTCHA used during the SEP-24 flow.
Recaptcha Configurationβ
The following configurations are required when using Google reCAPTCHA v2 to protect the SDP Core Service from bots. ReCaptcha is used both for dashboard users and receivers of funds during the SEP-24 flow.
RECAPTCHA_SITE_KEY
- The Google reCAPTCHA v2 - I'm not a robot site key.RECAPTCHA_SITE_SECRET_KEY
- π The reCAPTCHA site secret key used to validate reCAPTCHA responses.
Anchor Platform Configurationβ
Anchor Platform Configuration allows configuring the anchor platform used by the SDP Core Service.
ANCHOR_PLATFORM_BASE_PLATFORM_URL
- The base URL of the anchor platform.ANCHOR_PLATFORM_BASE_SEP_URL
- The base URL of the anchor platform's SEP-24 implementation.ANCHOR_PLATFORM_OUTGOING_JWT_SECRET
- π The JWT secret used to create a JWT token used to send requests to the anchor platform.