From 98701ebdabd9a4ce38bbb748363c5c0e12a970ca Mon Sep 17 00:00:00 2001 From: Alexandre Aubin Date: Sat, 3 Feb 2024 18:36:55 +0100 Subject: [PATCH] regenconf: the 'plain' subfolder thing for nginx conf is annoying, flatten things up --- conf/nginx/{plain => }/acme-challenge.conf.inc | 0 conf/nginx/{plain => }/global.conf | 0 conf/nginx/{plain => }/ssowat.conf | 0 .../{plain => }/yunohost_http_errors.conf.inc | 0 conf/nginx/{plain => }/yunohost_panel.conf.inc | 0 conf/nginx/{plain => }/yunohost_sso.conf.inc | 0 hooks/conf_regen/15-nginx | 18 ++++++++++++++++-- 7 files changed, 16 insertions(+), 2 deletions(-) rename conf/nginx/{plain => }/acme-challenge.conf.inc (100%) rename conf/nginx/{plain => }/global.conf (100%) rename conf/nginx/{plain => }/ssowat.conf (100%) rename conf/nginx/{plain => }/yunohost_http_errors.conf.inc (100%) rename conf/nginx/{plain => }/yunohost_panel.conf.inc (100%) rename conf/nginx/{plain => }/yunohost_sso.conf.inc (100%) diff --git a/conf/nginx/plain/acme-challenge.conf.inc b/conf/nginx/acme-challenge.conf.inc similarity index 100% rename from conf/nginx/plain/acme-challenge.conf.inc rename to conf/nginx/acme-challenge.conf.inc diff --git a/conf/nginx/plain/global.conf b/conf/nginx/global.conf similarity index 100% rename from conf/nginx/plain/global.conf rename to conf/nginx/global.conf diff --git a/conf/nginx/plain/ssowat.conf b/conf/nginx/ssowat.conf similarity index 100% rename from conf/nginx/plain/ssowat.conf rename to conf/nginx/ssowat.conf diff --git a/conf/nginx/plain/yunohost_http_errors.conf.inc b/conf/nginx/yunohost_http_errors.conf.inc similarity index 100% rename from conf/nginx/plain/yunohost_http_errors.conf.inc rename to conf/nginx/yunohost_http_errors.conf.inc diff --git a/conf/nginx/plain/yunohost_panel.conf.inc b/conf/nginx/yunohost_panel.conf.inc similarity index 100% rename from conf/nginx/plain/yunohost_panel.conf.inc rename to conf/nginx/yunohost_panel.conf.inc diff --git a/conf/nginx/plain/yunohost_sso.conf.inc b/conf/nginx/yunohost_sso.conf.inc similarity index 100% rename from conf/nginx/plain/yunohost_sso.conf.inc rename to conf/nginx/yunohost_sso.conf.inc diff --git a/hooks/conf_regen/15-nginx b/hooks/conf_regen/15-nginx index 8f845984c..53f5b6d6a 100755 --- a/hooks/conf_regen/15-nginx +++ b/hooks/conf_regen/15-nginx @@ -4,6 +4,8 @@ set -e . /usr/share/yunohost/helpers + + do_init_regen() { if [[ $EUID -ne 0 ]]; then echo "You must be root to run this script" 1>&2 @@ -17,7 +19,13 @@ do_init_regen() { mkdir -p "$nginx_conf_dir" # install plain conf files - cp plain/* "$nginx_conf_dir" + cp acme-challenge.conf.in "$nginx_conf_dir" + cp global.conf "$nginx_conf_dir" + cp ssowat.conf "$nginx_conf_dir" + cp yunohost_http_errors.conf.inc "$nginx_conf_dir" + cp yunohost_panel.conf.inc "$nginx_conf_dir" + cp yunohost_sso.conf.inc "$nginx_conf_dir" + # probably run with init: just disable default site, restart NGINX and exit rm -f "${nginx_dir}/sites-enabled/default" @@ -54,7 +62,13 @@ do_pre_regen() { mkdir -p "$nginx_conf_dir" # install / update plain conf files - cp plain/* "$nginx_conf_dir" + cp acme-challenge.conf.in "$nginx_conf_dir" + cp global.conf "$nginx_conf_dir" + cp ssowat.conf "$nginx_conf_dir" + cp yunohost_http_errors.conf.inc "$nginx_conf_dir" + cp yunohost_panel.conf.inc "$nginx_conf_dir" + cp yunohost_sso.conf.inc "$nginx_conf_dir" + # remove the panel overlay if this is specified in settings panel_overlay="$(jq -r '.ssowat_panel_overlay_enabled' <<< "$YNH_SETTINGS" | int_to_bool)" if [ "$panel_overlay" == "False" ]; then