1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/commento_ynh.git synced 2024-09-03 18:16:16 +02:00

Add change URL

This commit is contained in:
ericgaspar 2021-11-25 18:17:54 +01:00
parent 8c26943fbf
commit 37ccc906dd
No known key found for this signature in database
GPG key ID: 574F281483054D44
3 changed files with 18 additions and 3 deletions

View file

@ -16,7 +16,7 @@
#upgrade=1 from_commit=CommitHash
backup_restore=1
multi_instance=1
change_url=0
change_url=1
;;; Options
Email=
Notification=none

View file

@ -1,5 +1,5 @@
[Unit]
Description=Commento daemon service
Description=Commento: commenting platform
After=network.target postgresql.service
[Service]

View file

@ -17,7 +17,7 @@ old_domain=$YNH_APP_OLD_DOMAIN
old_path=$YNH_APP_OLD_PATH
new_domain=$YNH_APP_NEW_DOMAIN
new_path=$YNH_APP_NEW_PATH
new_path="/"
app=$YNH_APP_INSTANCE_NAME
@ -28,6 +28,10 @@ ynh_script_progression --message="Loading installation settings..." --weight=1
# Needed for helper "ynh_add_nginx_config"
final_path=$(ynh_app_setting_get --app=$app --key=final_path)
db_name=$(ynh_app_setting_get --app=$app --key=db_name)
db_user=$db_name
db_pwd=$(ynh_app_setting_get --app=$app --key=psqlpwd)
port=$(ynh_app_setting_get --app=$app --key=port)
#=================================================
# BACKUP BEFORE CHANGE URL THEN ACTIVE TRAP
@ -100,6 +104,17 @@ then
ynh_store_file_checksum --file="/etc/nginx/conf.d/$new_domain.d/$app.conf"
fi
#=================================================
# ADD A CONFIGURATION
#=================================================
ynh_script_progression --message="Adding a configuration file..." --weight=1
domain="$new_domain"
ynh_add_config --template="../conf/.env" --destination="$final_path/commento.env"
chmod 400 "$final_path/commento.env"
chown $app:$app "$final_path/commento.env"
#=================================================
# GENERIC FINALISATION
#=================================================