diff --git a/scripts/install b/scripts/install index 40973d5..f3c9721 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 #================================================= @@ -133,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 #================================================= @@ -158,7 +166,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 #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index f27cb84..825bfa0 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 @@ -79,6 +80,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 @@ -121,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" #================================================= @@ -155,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 #=================================================