From 1ca999e658c508a34e3ffd98e1521b9bf335ef93 Mon Sep 17 00:00:00 2001 From: anmol26s Date: Sun, 7 Mar 2021 20:58:25 +0530 Subject: [PATCH 1/8] path export --- scripts/install | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/install b/scripts/install index 40973d5..4f76b5a 100755 --- a/scripts/install +++ b/scripts/install @@ -80,6 +80,7 @@ pushd "$tmpdir" popd ynh_secure_remove "$tmpdir" export PATH=$PATH:/usr/local/go/bin +export GOPATH=/usr/local/go/bin #================================================= From 57d7f2cde6e7aea473fcea99e1313131b057fd97 Mon Sep 17 00:00:00 2001 From: anmol26s Date: Sun, 7 Mar 2021 22:07:23 +0530 Subject: [PATCH 2/8] Correct admin permission --- scripts/install | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/install b/scripts/install index 4f76b5a..74c429a 100755 --- a/scripts/install +++ b/scripts/install @@ -159,7 +159,7 @@ ynh_script_progression --message="Configuring permissions..." --weight=1 # Only the admin can access the admin panel of the app (if the app has an admin panel) -ynh_permission_create --permission="admin" --url="/" --allowed=$admin +ynh_permission_update --permission "main" --remove all_users --add $admin #================================================= From b14282e322c4959fddcd8c7aa6c53d2eef722681 Mon Sep 17 00:00:00 2001 From: anmol26s Date: Mon, 8 Mar 2021 04:10:28 +0530 Subject: [PATCH 3/8] Add logrotate in install and added path in upgrade --- scripts/install | 7 +++++++ scripts/upgrade | 2 ++ 2 files changed, 9 insertions(+) diff --git a/scripts/install b/scripts/install index 74c429a..f3c9721 100755 --- a/scripts/install +++ b/scripts/install @@ -134,6 +134,13 @@ ynh_add_systemd_config --service="$app" --template="systemd.service" --others_va chown -R $app: $final_path +#================================================= +# SETUP LOGROTATE +#================================================= +ynh_script_progression --message="Configuring log rotation..." --weight=1 + +ynh_use_logrotate + #================================================= # INTEGRATE SERVICE IN YUNOHOST #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index f27cb84..103355d 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -79,6 +79,8 @@ then ynh_script_progression --message="Upgrading source files..." --weight=1 # Download, check integrity, uncompress and patch the source from app.src + export PATH=$PATH:/usr/local/go/bin + export GOPATH=/usr/local/go/bin pushd "$final_path" git pull make From aa03936318d56116f369fb3c6eb9272b999efa1b Mon Sep 17 00:00:00 2001 From: anmol26s Date: Mon, 8 Mar 2021 13:46:10 +0530 Subject: [PATCH 4/8] added port in nginx upgrade --- scripts/upgrade | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/upgrade b/scripts/upgrade index 103355d..4b2f784 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -93,7 +93,7 @@ fi ynh_script_progression --message="Upgrading NGINX web server configuration..." --weight=1 # Create a dedicated NGINX config -ynh_add_nginx_config +ynh_add_nginx_config "port" #================================================= # UPGRADE DEPENDENCIES From e6875145536ac4ee53abac9204b7ac2241c70139 Mon Sep 17 00:00:00 2001 From: anmol26s Date: Mon, 8 Mar 2021 14:04:14 +0530 Subject: [PATCH 5/8] reverting to b14282e --- scripts/upgrade | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/upgrade b/scripts/upgrade index 4b2f784..103355d 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -93,7 +93,7 @@ fi ynh_script_progression --message="Upgrading NGINX web server configuration..." --weight=1 # Create a dedicated NGINX config -ynh_add_nginx_config "port" +ynh_add_nginx_config #================================================= # UPGRADE DEPENDENCIES From 5beae917113fda6127b0f633f706df1c04921f6c Mon Sep 17 00:00:00 2001 From: anmol26s Date: Mon, 8 Mar 2021 14:09:26 +0530 Subject: [PATCH 6/8] added port in nginx upgrade --- scripts/upgrade | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/upgrade b/scripts/upgrade index 103355d..95c7371 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -20,6 +20,7 @@ domain=$(ynh_app_setting_get --app=$app --key=domain) path_url=$(ynh_app_setting_get --app=$app --key=path) admin=$(ynh_app_setting_get --app=$app --key=admin) final_path=$(ynh_app_setting_get --app=$app --key=final_path) +port=$(ynh_app_setting_get --app=$app --key=port) #================================================= # CHECK VERSION From af7f4ddccae8d545f114d609748f78fe572f4319 Mon Sep 17 00:00:00 2001 From: anmol26s Date: Mon, 8 Mar 2021 14:16:48 +0530 Subject: [PATCH 7/8] Removed path from upgrade --- scripts/upgrade | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/upgrade b/scripts/upgrade index 95c7371..62a546b 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -124,7 +124,7 @@ ynh_system_user_create --username=$app ynh_script_progression --message="Upgrading systemd configuration..." --weight=1 # Create a dedicated systemd config -ynh_add_systemd_config --service="$app" --template="systemd.service" --others_var="port domain path" +ynh_add_systemd_config --service="$app" --template="systemd.service" --others_var="port domain" #================================================= From 1923b9eeab0d1c778e750c5cda6bfa68f83f6b98 Mon Sep 17 00:00:00 2001 From: anmol26s Date: Mon, 8 Mar 2021 14:20:39 +0530 Subject: [PATCH 8/8] Removed fail2ban from upgrade --- scripts/upgrade | 8 -------- 1 file changed, 8 deletions(-) diff --git a/scripts/upgrade b/scripts/upgrade index 62a546b..825bfa0 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -158,14 +158,6 @@ ynh_script_progression --message="Starting a systemd service..." --weight=1 ynh_systemd_action --service_name=$app --action="start" --log_path="/var/log/$app/$app.log" -#================================================= -# UPGRADE FAIL2BAN -#================================================= -ynh_script_progression --message="Reconfiguring Fail2Ban..." --weight=1 - -# Create a dedicated Fail2Ban config -ynh_add_fail2ban_config --logpath="/var/log/nginx/${domain}-error.log" --failregex="Regex to match into the log for a failed login" - #================================================= # RELOAD NGINX #=================================================