.env file to set up the application configuration:
You can enter any environment variables referenced in
__init__.py to this file.
For example you may enter your SMTP credentials like this:
MAIL_USERNAMEemail@example.com MAIL_DEFAULT_SENDERfirstname.lastname@example.org MAIL_PASSWORD=**************
#LOG_LEVEL=DEBUG BASE_URL="https://capsul.org" # hub url is used by the SPOKE_MODE to contact the hub. Since this server is the hub, # this is fine. In fact it runs into problems (routing related?) when I set it to capsul.org. # similarly the baikal "spoke" (set up in the hosts table in the db) has "http://localhost:5000" as the https_url HUB_URL="http://localhost:5000" HUB_MODE_ENABLED="t" SPOKE_MODE_ENABLED="t" HUB_MODEL="capsul-flask" SPOKE_MODEL="shell-scripts" SPOKE_HOST_ID="baikal" SPOKE_HOST_TOKEN="<redacted>" HUB_TOKEN="<redacted>" # smtp.. see https://flask-mail.readthedocs.io/en/latest/#configuring-flask-mail MAIL_SERVER="smtp.nullhex.com" # MAIL_USE_SSL means SMTP with STARTTLS MAIL_USE_SSL=true # MAIL_USE_TLS means SMTP wrapped in TLS MAIL_USE_TLS=false MAIL_PORT="465" MAIL_USERNAME="email@example.com" MAIL_PASSWORD="<redacted>" MAIL_DEFAULT_SENDER="firstname.lastname@example.org" # stripe STRIPE_SECRET_KEY="sk_live_<redacted>" STRIPE_PUBLISHABLE_KEY="pk_live_tGDHY7kBwqC71b4F0N7LZdGl00GZOw0iNJ" # internal SECRET_KEY="<redacted>" POSTGRES_CONNECTION_PARAMETERS="sslmode=verify-full sslrootcert=letsencrypt-root-ca.crt host=postgres.cyberia.club port=5432 ...<redacted>" # btcpay server BTCPAY_URL="https://beeteeceepae2.cyberia.club" BTCPAY_PRIVATE_KEY='-----BEGIN EC PRIVATE KEY-----\n<redacted>\n-----END EC PRIVATE KEY-----'
By default, capsul operates in USD. You can change that with the currency configuration settings:
CURRENCY_NAME=dollar <the name of the currency, singular> CURRENCY_SYMBOL=$ <the symbol to refer to the currency> CURRENCY_STRIPE_NAME=usd <a string stripe uses to identify what currency a payment is being requested in. £ is gbp> CURRENCY_BTCPAY_NAME=USD <likewise for btcpay> CURRENCY_STRIPE_CONVERSION_FACTOR=100 <stripe wants to work in the smallest unit - cents, pennies etc>
Don't change the currency once capsul is up and running! Amounts of money are stored in the database as plain numbers and won't be converted, so if someone has $10 and you move to using gbp they'll now have £10 in their account.
SPOKE_HOST_IDin the config)
SPOKE_HOST_TOKENin the config)
To support Docker Secrets, you can also load secret values from files – for example, to load