From 4c23496c3aea9efe704e542d89631b2ba5462116 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Fri, 20 Nov 2020 11:02:28 +0100 Subject: [PATCH] Fix --- conf/app.ini | 2 +- conf/ldap.conf | 2 +- conf/nginx.conf | 2 +- conf/systemd.service | 2 +- scripts/install | 8 +------- 5 files changed, 5 insertions(+), 11 deletions(-) diff --git a/conf/app.ini b/conf/app.ini index 5a08d74..f32f401 100644 --- a/conf/app.ini +++ b/conf/app.ini @@ -9,7 +9,7 @@ RUN_MODE = prod PROTOCOL = http DOMAIN = __DOMAIN__ ROOT_URL = https://__URL__/ -HTTP_ADDR = 0.0.0.0 +HTTP_ADDR = 127.0.0.1 HTTP_PORT = __PORT__ ; Permission for unix socket UNIX_SOCKET_PERMISSION = 666 diff --git a/conf/ldap.conf b/conf/ldap.conf index 52ea4a3..6d811d3 100644 --- a/conf/ldap.conf +++ b/conf/ldap.conf @@ -6,7 +6,7 @@ name = Yunohost LDAP is_activated = true [config] -host = localhost +host = 127.0.0.1 port = 389 # 0 - Unencrypted, 1 - LDAPS, 2 - StartTLS security_protocol = 0 diff --git a/conf/nginx.conf b/conf/nginx.conf index 2521185..89c46de 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -6,7 +6,7 @@ location __PATH__/ { rewrite ^ https://$server_name$request_uri? permanent; } - proxy_pass http://localhost:__PORT__/; + proxy_pass http://127.0.0.1:__PORT__/; proxy_set_header Host $host; proxy_buffering off; fastcgi_param REMOTE_USER $remote_user; diff --git a/conf/systemd.service b/conf/systemd.service index e237439..df646e1 100644 --- a/conf/systemd.service +++ b/conf/systemd.service @@ -16,7 +16,7 @@ Type=simple User=__APP__ Group=__APP__ WorkingDirectory=/home/__APP__ -ExecStart=/opt/__APP__/gogs web +ExecStart=__FINAL_PATH__/gogs web Restart=always Environment=USER=__APP__ HOME=/home/__APP__ diff --git a/scripts/install b/scripts/install index 22a574a..97ff93d 100644 --- a/scripts/install +++ b/scripts/install @@ -43,10 +43,6 @@ test ! -e "$final_path" || ynh_die --message="This path already contains a folde # Register (book) web path ynh_webpath_register --app=$app --domain=$domain --path_url=$path_url -# Generate random password and key - -key=$(ynh_string_random) - #================================================= # STORE SETTINGS FROM MANIFEST #================================================= @@ -135,7 +131,7 @@ ynh_replace_string --match_string="__REPOS_PATH__" --replace_string="$REPO_PATH ynh_replace_string --match_string="__DB_PASSWORD__" --replace_string="$db_pwd" --target_file="$final_path/custom/conf/app.ini" ynh_replace_string --match_string="__DB_USER__" --replace_string="$db_user" --target_file="$final_path/custom/conf/app.ini" ynh_replace_string --match_string="__DOMAIN__" --replace_string="$domain" --target_file="$final_path/custom/conf/app.ini" -ynh_replace_string --match_string="__KEY__" --replace_string="$key" --target_file="$final_path/custom/conf/app.ini" +ynh_replace_string --match_string="__KEY__" --replace_string="$(ynh_string_random)" --target_file="$final_path/custom/conf/app.ini" ynh_replace_string --match_string="__DATA_PATH__" --replace_string="$DATA_PATH" --target_file="$final_path/custom/conf/app.ini" ynh_replace_string --match_string="__PORT__" --replace_string="$port" --target_file="$final_path/custom/conf/app.ini" ynh_replace_string --match_string="__APP__" --replace_string="$app" --target_file="$final_path/custom/conf/app.ini" @@ -153,8 +149,6 @@ ynh_store_file_checksum --file="$final_path/custom/conf/app.ini" ynh_store_file_checksum --file="$final_path/custom/conf/auth.d/ldap.conf" - - # Configure init script ynh_add_systemd_config