diff --git a/conf/cache.conf b/conf/cache.conf index c64c9ba..07861f0 100644 --- a/conf/cache.conf +++ b/conf/cache.conf @@ -1,2 +1,2 @@ -proxy_cache_path /tmp/{APP}-media-cache levels=1:2 keys_zone={APP}_media_cache:10m max_size=__SIZE__ +proxy_cache_path /tmp/__APP__-media-cache levels=1:2 keys_zone=__APP___media_cache:10m max_size=__SIZE__ inactive=720m use_temp_path=off; diff --git a/scripts/install b/scripts/install index 359cc66..a4a8baa 100755 --- a/scripts/install +++ b/scripts/install @@ -126,12 +126,9 @@ ynh_add_nginx_config if [ $cache -eq 1 ] then - cp -rf "../conf/cache.conf" "/etc/nginx/conf.d/$app-cache.conf" - ynh_replace_string --match_string="{APP}" --replace_string="$app" --target_file="/etc/nginx/conf.d/$app-cache.conf" - ynh_replace_string --match_string="__SIZE__" --replace_string="$size" --target_file="/etc/nginx/conf.d/$app-cache.conf" - ynh_store_file_checksum --file="/etc/nginx/conf.d/$app-cache.conf" - - ynh_replace_string --match_string="{APP}" --replace_string="$app" --target_file="../conf/media.conf" + ynh_add_config --template="../conf/cache.conf" --destination="/etc/nginx/conf.d/$app-cache.conf" + + ynh_replace_string --match_string="__APP__" --replace_string="$app" --target_file="../conf/media.conf" ynh_replace_string --match_string="__PORT__" --replace_string="$port" --target_file="../conf/media.conf" cat ../conf/media.conf >> /etc/nginx/conf.d/$domain.d/$app.conf ynh_store_file_checksum --file="/etc/nginx/conf.d/$domain.d/$app.conf" @@ -222,7 +219,6 @@ cat "../conf/ldap.exs" >> "$config" ynh_replace_string --match_string="config :pleroma, configurable_from_database: false" --replace_string="config :pleroma, configurable_from_database: true" --target_file="$config" pushd $final_path/$app - su "$app" -s $SHELL -lc "$final_path/$app/bin/pleroma_ctl migrate" ynh_systemd_action --service_name=$app --action="start" --log_path=systemd --line_match="Started $app" diff --git a/scripts/upgrade b/scripts/upgrade index 3c85950..1aec2e1 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -194,11 +194,9 @@ ynh_add_nginx_config ynh_secure_remove --file="/etc/nginx/conf.d/$app-cache.conf" if [ $cache -eq 1 ] then - cp -rf "../conf/cache.conf" "/etc/nginx/conf.d/$app-cache.conf" - ynh_replace_string --match_string="{APP}" --replace_string="$app" --target_file="/etc/nginx/conf.d/$app-cache.conf" - ynh_replace_string --match_string="__SIZE__" --replace_string="$size" --target_file="/etc/nginx/conf.d/$app-cache.conf" - ynh_store_file_checksum --file="/etc/nginx/conf.d/$app-cache.conf" - ynh_replace_string --match_string="{APP}" --replace_string="$app" --target_file="../conf/media.conf" + ynh_add_config --template="../conf/cache.conf" --destination="/etc/nginx/conf.d/$app-cache.conf" + + ynh_replace_string --match_string="__APP__" --replace_string="$app" --target_file="../conf/media.conf" ynh_replace_string --match_string="__PORT__" --replace_string="$port" --target_file="../conf/media.conf" cat ../conf/media.conf >> /etc/nginx/conf.d/$domain.d/$app.conf ynh_store_file_checksum --file="/etc/nginx/conf.d/$domain.d/$app.conf"