Scripts for installation management¶
Script execution¶
Scripts are executed in the installation backend service:
- для Docker Compose:
- для Helm:
All usage examples are provided for docker-compose but can also be run in k8s. To do so, replace docker
with kubectl
.
Arguments passed to the script are strictly positional and are specified with the --script-arg
key. Optional arguments are enclosed in square brackets.
Available commands¶
set_new_secret_key
¶
This command sets a new value for the SECRET_KEY
environment variable. To avoid issues with encoding, aliases, or other unexpected console behavior, it is recommended to copy the NEW_SECRET_KEY
value from the terminal output after the script has finished.
Syntax
Usage examples
-
Changing from explicitly specified
OLD_SECRET_KEY
to explicitly specifiedNEW_SECRET_KEY
. This is required when theSECRET_KEY
environment variable value during installation launch differs fromOLD_SECRET_KEY
../manage.py runscript set_new_secret_key --script-arg="NEW_SECRET_KEY" --script-arg="OLD_SECRET_KEY"
This command will re-encrypt all sensitive fields from the given
OLD_SECRET_KEY
toNEW_SECRET_KEY
.IMPORTANT! If the
SECRET_KEY
variable at the moment of script execution does not match theNEW_SECRET_KEY
, after successful script completion you must update theSECRET_KEY
variable toNEW_SECRET_KEY
and restart the installation. -
Changing to explicitly specified
NEW_SECRET_KEY
without specifyingOLD_SECRET_KEY
. This is required whenOLD_SECRET_KEY
matches the one defined insettings.SECRET_KEY
.This command will re-encrypt all sensitive fields from the key set in
settings.SECRET_KEY
toNEW_SECRET_KEY
.After successful script completion you must update the
SECRET_KEY
variable toNEW_SECRET_KEY
and restart the installation.