.. _overview-configuration: Configuration ============= All the system is prepared to be deployed in any environment compatible with the WSGI standard. Moreover, it comes by default with the configuration needed to be executed under a **Docker** container using ``docker compose``. To be able to configure the system, independently from the environment, we use **environment variables**. Backend ------- These environment variables are needed to configure the backend, and they have to be defined in the environment where the backend will be running. POSTGRES_HOST (required) Name of the host where the PostgreSQL database is. POSTGRES_PORT (required) Port of the PostgreSQL database. POSTGRES_DB (required) Name of the PostgreSQL database. POSTGRES_USER (required) User for the PostgreSQL database. POSTGRES_PASSWORD (required) Password for the PostgreSQL database user. DATABASE_URL Value of the URL used for accessing the database. It has to have the following format: .. code-block:: postgres://{user}:{password}@{host}:{port}/{database} It is generated automatically using the values defined in the variables related with PostgreSQL. DJANGO_SECRET_KEY (required) String used as seed for security algorithms. It has to be defined and keep in secret. REDIS_URL (required) String with the Redis server URL, used as cache. It has to have a format like: ``redis://redis:6379/0``. DJANGO_ALLOWED_HOSTS (required) List of hosts allowed to access the backend, comma separated. DJANGO_ADMIN_URL (required) String with the path to access the admin panel. CELERY_BROKER_URL (required) Value of the URL for the service used as broker for Celery. The same Redis server used as cache can be used. DJANGO_EMAIL_HOST (required) Value of the email server host. DJANGO_EMAIL_PORT Value of the port for the email server. By default ``587``. DJANGO_EMAIL_HOST_USER (required) Value of the user for the email server. DJANGO_EMAIL_HOST_PASSWORD (required) Value of the password for the email server. DJANGO_EMAIL_USE_TLS It defines if the email server uses TSL (``True``) or not (``False``). By default ``True``. AWS_ACCESS_KEY_ID Access key for the storage system compatible with Amazon S3. Mandatory in production. AWS_SECRET_ACCESS_KEY Secret access key for the storage system compatible with Amazon S3. Mandatory in production. DJANGO_AWS_STORAGE_BUCKET_NAME Name of the bucket for the storage system compatible with Amazon S3. Mandatory in production. DJANGO_AWS_S3_REGION_NAME Name of the region for the storage system compatible with Amazon S3. DJANGO_AWS_S3_ENDPOINT_URL Name of the endpoint for the storage system compatible with Amazon S3. DJANGO_STATIC_URL The base URL for accessing the static files. By default is ``https://{AWS_STORAGE_BUCKET_NAME}.s3.amazonaws.com/static/``. DJANGO_MEDIA_URL The base URL to access the static files uploaded by the users. By default ``https://{AWS_STORAGE_BUCKET_NAME}.s3.amazonaws.com/media/``. DJANGO_DEBUG It takes ``True`` or ``False`` (by **default**) and activates or deactivates the debug mode. It has only to be activated in the local machine during the development. DJANGO_SETTINGS_MODULE String with the route of the Python module that has the configuration of the project. It is used to have different configurations depending on the environment (local, test, staging or production). * Local environment: ``config.settings.local`` (by **default**) * Test environment: ``config.settings.test`` * Production environment: ``config.settings.production`` .. note:: Now, the *staging* environment is specialized to be used in the Dekalabs environment, so, in order to have a **real** staging environment, the **production** config with different values for these environment variables can be used. DJANGO_READ_DOT_ENV_FILE It takes boolean values, ``True`` (by **default**) or ``False`` and activates or deactivates support for loading environment variables from ``.env`` file. DJANGO_DEFAULT_FROM_EMAIL String that will be used by default as ``from`` field in the emails sent from the platform. DJANGO_SERVER_EMAIL String that will be used by default as ``from`` field in the emails sent from the platform to the admins. By default it uses the same value as ``DJANGO_DEFAULT_FROM_EMAIL``. DJANGO_EMAIL_SUBJECT_PREFIX Prefix that will be concatenated by default to the subject of the emails sent from the backend. SENTRY_ENABLED Activates (``True``) or deactivates (``False``) the Sentry support. SENTRY_DSN Value of the Sentry service URL. DJANGO_SENTRY_LOG_LEVEL Log level sent to Sentry, ``INFO`` by default. CONN_MAX_AGE Time limit for the database connection, 60 seconds by default. CORS_ORIGIN_ALLOW_ALL Activates (``True``) or deactivates (``False``) CORS restriction, ``True`` by default. CORS_ORIGIN_WHITELIST List, comma separated, of CORS allowed origins, ``http://example.com,https://example.com`` by default. CORS_ALLOW_CREDENTIALS It allows credentials in the CORS restriction, ``True`` by default. SNITCH_ENABLED_SEND_NOTIFICATIONS Activates (``True``) or deactivates (``False``) the notifications sending. SNITCH_ENABLED_SEND_EMAILS Activates (``True``) or deactivates (``False``) the email sending. DAHL_API_URL Value of the Dahl API base URL, ``https://www.dahl.se/store/AjaxProxy`` by default. DAHL_API_HOST_HEADER Value of the Dahl API host header, ``qa-api.dahl.se`` by default. DAHL_SEARCH_API_URL Value of the Dahl product search API base URL, ``https://sgds-dahl-qa.54proxy.com/search`` by default. DAHL_ADMIN_USERNAME Username for the Dahl admin user, empty by default. DAHL_ADMIN_PASSWORD Password for the Dahl admin user, empty by default. WEB_CONCURRENCY Number of `gunicorn `_ workers used to attend requests. DJANGO_DEFAULT_SUPERUSER_USERNAME You can use this environment variable to create a super user the first time the platform is performed, indicating here the username. DJANGO_DEFAULT_SUPERUSER_PASSWORD You can use this environment variable to create a super user the first time the platform is performed, indicating here the password. ADDIMOTION_API_URL Value of the Addimotion API base URL, ``http://api.viewmybox.com/yourboxes/2.0/`` by default. ADDIMOTION_CONSUMER_ID Default value for the ``consumer_id`` field in Addimotion API, empty by default. SYMBRIO_SERVICE_URL Value of the Symbrio service URL, ``https://webservices.symbrio.com/Symbrio.WebServices/ProjectValidatorService.svc?wsdl`` by default. SYMBRIO_SOAP_ACTION Value of the Symbrio soap action, ``http://services.symbrio.com/ProjectValidatorService/IProjectValidatorService/ValidateProject`` by default SYMBRIO_USERNAME Username for the Symbrio service, empty by default. SYMBRIO_PASSWORD Password for the Symbrio service, empty by default. MESSAGING_BASE_URL Value of the Messaging API base URL, ``https://go2.vhdmedia.se`` by default. MESSAGING_SENDER_ID Default value for the ``sender_id`` field in Messaging API, empty by default. It is the name of the sender that is shown in the SMS, for example the name of the company. MESSAGING_USERNAME Username for the Messaging API user, empty by default. MESSAGING_PASSWORD Password for the Messaging API user, empty by default. AUTH_LDAP_SERVER_URI Value of the LDAP server URI, ``ldap://F00DCDKNIT01.zf.if.atcsg.net`` by default. AUTH_LDAP_BIND_DN Value of the LDAP distinguished name, empty by default. AUTH_LDAP_BIND_PASSWORD Value of the LDAP password, empty by default. AUTH_LDAP_USER_SEARCH Value of the LDAP users search, ``OU=BU-Dahl,OU=CSE,OU=F00-SGTS-USS,dc=zf,dc=if,dc=atcsg,dc=net`` by default. AUTH_LDAP_GROUP_SEARCH Value of the LDAP groups search, ``OU=groups,ou=BU-Dahl,ou=CSE,dc=zf,dc=if,dc=atcsg,dc=net`` by default. AUTH_LDAP_SUPERUSER_FLAGS Value of the LDAP superuser flags, ``CN=CSEGRP-BU-Dahl-Controltower-admin,OU=Groups,OU=_Common,OU=BU-Dahl,OU=CSE,OU=F00-SGTS-USS,DC=zf,DC=if,DC=atcsg,DC=net`` by default. AUTH_LDAP_STAFF_FLAGS Value of the LDAP staff flags, ``CN=CSEGRP-BU-Dahl-Controltower,OU=Groups,OU=_Common,OU=BU-Dahl,OU=CSE,OU=F00-SGTS-USS,DC=zf,DC=if,DC=atcsg,DC=net`` by default. Frontend -------- NODE_ENV Node environment used to build the frontend, it should be ``production`` when deployed in production. NUXT_HOST Host where the frontend server will be launched, like ``0.0.0.0``. VUE_APP_API_URL (required) URL in where the backend is deployed, like ``https://controltower-backend.dekaside.com``. VUE_APP_AUTH_TOKEN_NAME Name of the variable where the user token will be stored, something like ``controltower-token``. VUE_APP_DOMAIN The domain where the frontend will be accessible.