Configure Environment of Admin Console
Before Admin Console can be used from the browser, we must configure the internal environment of the application. The environment is stored in a secret file /opt/cloud-swg-console/.env
and can be edited by running mc
in the terminal console, navigating to /opt/cloud-swg-console/.env
and pressing F4
.
Django settings
First, we need to adjust the Django settings of the application. Currently, only two settings are configurable. You can read more about them at official Django help site.
SECRET_KEY
Set SECRET_KEY
to some secret value when going into production, this value is explained in this article further. You can use the following one liner to generate this value python3 -c 'import secrets; print(secrets.token_urlsafe(38))'
.
DEBUG
Only set to DEBUG
to True
if you are developing, leave it as False
when running in production.
Address Configuration
Next, find out the IP address or fully qualified domain name (FQDN) of the appliance which you have configured on the previous step and change the ALLOWED_HOSTS
, CSRF_TRUSTED_ORIGINS
and SWG_ADDR
values.
For example, if you intend to access Admin Console by the IP address and that IP address is 192.168.1.10
, configure these settings as follows.
If you intend to access Admin Console by the FQDN and that FQDN is console.example.com
, configure these settings as follows.
ALLOWED_HOSTS=console.example.com
CSRF_TRUSTED_ORIGINS=https://console.example.com
SWG_ADDR=console.example.com
Reboot the appliance once all settings are properly configured.