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

more "account_domain" stuff

This commit is contained in:
OniriCorpe 2023-02-18 22:26:39 +01:00
parent e6b7e3cbcc
commit 8f41f602b0
5 changed files with 45 additions and 3 deletions

View file

@ -29,6 +29,7 @@ ynh_print_info --message="Loading installation settings..."
app="$YNH_APP_INSTANCE_NAME"
domain=$(ynh_app_setting_get --app="$app" --key=domain)
account_domain=$(ynh_app_setting_get --app="$app" --key=account_domain)
db_name=$(ynh_app_setting_get --app="$app" --key=db_name)
@ -63,6 +64,7 @@ ynh_backup --src_path="$datadir" --is_big
#=================================================
ynh_backup --src_path="/etc/nginx/conf.d/$domain.d/$app.conf"
ynh_backup --src_path="/etc/nginx/conf.d/$account_domain.d/$app.conf"
#=================================================
# SPECIFIC BACKUP

View file

@ -210,9 +210,22 @@ chown -R "$app:www-data" "$final_path"
#=================================================
ynh_script_progression --message="Configuring NGINX web server..." --weight=1
# Create a dedicated NGINX config
# Create a dedicated NGINX config for the main domain
ynh_add_nginx_config
# Create a dedicated NGINX config for the account domain, if applicable
if [ "$domain" != "$account_domain" ] && [ -n "$account_domain" ]; then
# switching domain name for tricking ynh_add_nginx_config (who supports only the 'domain' variable)
domain="$account_domain"
ynh_add_nginx_config
# undo the trick
account_domain="$domain"
fi
#=================================================
# CREATE DATA DIRECTORY
#=================================================

View file

@ -17,6 +17,7 @@ ynh_script_progression --message="Loading installation settings..." --weight=1
app="$YNH_APP_INSTANCE_NAME"
domain=$(ynh_app_setting_get --app="$app" --key=domain)
account_domain=$(ynh_app_setting_get --app="$app" --key=account_domain)
port=$(ynh_app_setting_get --app="$app" --key=port)
db_name=$(ynh_app_setting_get --app="$app" --key=db_name)
db_user=$(ynh_app_setting_get --app="$app" --key=db_user)
@ -81,9 +82,21 @@ ynh_secure_remove --file="$datadir"
#=================================================
ynh_script_progression --message="Removing NGINX web server configuration..." --weight=1
# Remove the dedicated NGINX config
# Remove the dedicated NGINX config of the main domain
ynh_remove_nginx_config
# Remove the dedicated NGINX config for the account domain, if applicable
if [ "$domain" != "$account_domain" ] && [ -n "$account_domain" ]; then
# switching domain name for tricking ynh_add_nginx_config (who supports only the 'domain' variable)
domain="$account_domain"
ynh_remove_nginx_config
# undo the trick
account_domain="$domain"
fi
#=================================================
# REMOVE LOGROTATE CONFIGURATION
#=================================================

View file

@ -96,6 +96,7 @@ test ! -d "$final_path" \
ynh_script_progression --message="Restoring the NGINX configuration..." --weight=1
ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf"
ynh_restore_file --origin_path="/etc/nginx/conf.d/$account_domain.d/$app.conf"
#=================================================
# RECREATE THE DEDICATED USER

View file

@ -21,6 +21,7 @@ final_path=$(ynh_app_setting_get --app="$app" --key=final_path)
landing_page_user=$(ynh_app_setting_get --app="$app" --key=landing_page_user)
domain=$(ynh_app_setting_get --app="$app" --key=domain)
account_domain=$(ynh_app_setting_get --app="$app" --key=account_domain)
port=$(ynh_app_setting_get --app="$app" --key=port)
path_url=$(ynh_app_setting_get --app="$app" --key=path_url)
@ -277,9 +278,21 @@ chown -R "$app:www-data" "$final_path"
#=================================================
ynh_script_progression --message="Upgrading NGINX web server configuration..."
# Create a dedicated NGINX config
# Create a dedicated NGINX config for the main domain
ynh_add_nginx_config
# Create a dedicated NGINX config for the account domain, if applicable
if [ "$domain" != "$account_domain" ] && [ -n "$account_domain" ]; then
# switching domain name for tricking ynh_add_nginx_config (who supports only the 'domain' variable)
domain="$account_domain"
ynh_add_nginx_config
# undo the trick
account_domain="$domain"
fi
#=================================================
# UPGRADE DEPENDENCIES
#=================================================