mirror of
https://github.com/YunoHost-Apps/pytition_ynh.git
synced 2024-09-03 20:16:08 +02:00
Handle change_url
This commit is contained in:
parent
8a10013f5a
commit
fd5207095e
4 changed files with 21 additions and 13 deletions
|
@ -21,7 +21,7 @@
|
||||||
;upgrade=1 from_commit=CommitHash
|
;upgrade=1 from_commit=CommitHash
|
||||||
;backup_restore=1
|
;backup_restore=1
|
||||||
multi_instance=1
|
multi_instance=1
|
||||||
;change_url=1
|
change_url=1
|
||||||
;;; Options
|
;;; Options
|
||||||
Email=
|
Email=
|
||||||
Notification=none
|
Notification=none
|
||||||
|
|
|
@ -23,3 +23,13 @@ pkg_dependencies=(
|
||||||
#=================================================
|
#=================================================
|
||||||
# FUTURE OFFICIAL HELPERS
|
# FUTURE OFFICIAL HELPERS
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
||||||
|
|
||||||
|
generate_secret_key() {
|
||||||
|
(
|
||||||
|
set +o nounset
|
||||||
|
source "${final_path}/venv/bin/activate"
|
||||||
|
set -o nounset
|
||||||
|
python3 -c "from django.core.management.utils import get_random_secret_key; print(get_random_secret_key())"
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
|
@ -26,13 +26,13 @@ app=$YNH_APP_INSTANCE_NAME
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Loading installation settings..." --time --weight=1
|
ynh_script_progression --message="Loading installation settings..." --time --weight=1
|
||||||
|
|
||||||
# Needed for helper "ynh_add_nginx_config"
|
|
||||||
final_path=$(ynh_app_setting_get --app=$app --key=final_path)
|
final_path=$(ynh_app_setting_get --app=$app --key=final_path)
|
||||||
|
|
||||||
# Add settings here as needed by your application
|
# Add settings here as needed by your application
|
||||||
#db_name=$(ynh_app_setting_get --app=$app --key=db_name)
|
db_name=$(ynh_app_setting_get --app=$app --key=db_name)
|
||||||
#db_user=$db_name
|
db_user=$db_name
|
||||||
#db_pwd=$(ynh_app_setting_get --app=$app --key=db_pwd)
|
db_pwd=$(ynh_app_setting_get --app=$app --key=db_pwd)
|
||||||
|
secret_key=$(generate_secret_key)
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# BACKUP BEFORE CHANGE URL THEN ACTIVE TRAP
|
# BACKUP BEFORE CHANGE URL THEN ACTIVE TRAP
|
||||||
|
@ -108,8 +108,12 @@ fi
|
||||||
#=================================================
|
#=================================================
|
||||||
# SPECIFIC MODIFICATIONS
|
# SPECIFIC MODIFICATIONS
|
||||||
#=================================================
|
#=================================================
|
||||||
# ...
|
# Reedit configuration files
|
||||||
#=================================================
|
#=================================================
|
||||||
|
ynh_script_progression --message="Updating app's configuration..." --time --weight=1
|
||||||
|
|
||||||
|
ynh_add_config --template="../conf/config.py" --destination="$final_path/pytition/pytition/pytition/settings/config.py"
|
||||||
|
ynh_add_config --template="../conf/uwsgi.yaml" --destination="/etc/uwsgi/apps-available/$app.yaml"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# GENERIC FINALISATION
|
# GENERIC FINALISATION
|
||||||
|
|
|
@ -153,13 +153,7 @@ chown -R $app:www-data "/var/log/$app"
|
||||||
# ADD A CONFIGURATION
|
# ADD A CONFIGURATION
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Adding configuration files..." --time --weight=1
|
ynh_script_progression --message="Adding configuration files..." --time --weight=1
|
||||||
|
secret_key=$(generate_secret_key)
|
||||||
secret_key=$(
|
|
||||||
set +o nounset
|
|
||||||
source "${final_path}/venv/bin/activate"
|
|
||||||
set -o nounset
|
|
||||||
python3 -c "from django.core.management.utils import get_random_secret_key as g; print(g())"
|
|
||||||
)
|
|
||||||
|
|
||||||
config_path="$final_path/pytition/pytition/pytition/settings/config.py"
|
config_path="$final_path/pytition/pytition/pytition/settings/config.py"
|
||||||
ynh_add_config --template="../conf/config.py" --destination="$config_path"
|
ynh_add_config --template="../conf/config.py" --destination="$config_path"
|
||||||
|
|
Loading…
Reference in a new issue