From d445b714e89335efc9bb493f77fe5fe91db7f6b8 Mon Sep 17 00:00:00 2001 From: Limezy Date: Thu, 24 Mar 2022 21:46:45 +0700 Subject: [PATCH 01/17] Update config.yaml --- conf/config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conf/config.yaml b/conf/config.yaml index b3457e5..1a1a5bf 100644 --- a/conf/config.yaml +++ b/conf/config.yaml @@ -49,6 +49,6 @@ connectors: staticClients: - id: __OIDC_NAME__ redirectURIs: - - __OIDC_CALLBACK__ + - https://__OIDC_CALLBACK__ name: __OIDC_NAME__ secret: __OIDC_SECRET__ From b6e043b5e1d99332804af7eb140503fea6a80164 Mon Sep 17 00:00:00 2001 From: Limezy Date: Fri, 25 Mar 2022 08:31:25 +0700 Subject: [PATCH 02/17] Redirect to stdout --- scripts/install | 2 +- scripts/upgrade | 17 ++++++----------- 2 files changed, 7 insertions(+), 12 deletions(-) diff --git a/scripts/install b/scripts/install index ea54c61..0bcc85d 100755 --- a/scripts/install +++ b/scripts/install @@ -119,7 +119,7 @@ pushd "$final_path" ynh_use_go "$ynh_go" env # Build server from source - make build + make build 2>&1 # Setup a nice Yunohost logo cp /usr/share/yunohost/admin/img/logo.08bab97e.png web/themes/light/logo.png popd diff --git a/scripts/upgrade b/scripts/upgrade index 6cee910..48afeba 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -85,14 +85,6 @@ ynh_script_progression --message="Upgrading NGINX web server configuration..." - # Create a dedicated NGINX config ynh_add_nginx_config -#================================================= -# PHP-FPM CONFIGURATION -#================================================= -ynh_script_progression --message="Upgrading PHP-FPM configuration..." --time --weight=1 - -# Create a dedicated PHP-FPM config -ynh_add_fpm_config - #================================================= # SPECIFIC UPGRADE #================================================= @@ -104,10 +96,13 @@ ynh_script_progression --message="Building the sources (it will take some time). ynh_exec_warn_less ynh_install_go --go_version=$GO_VERSION pushd "$final_path" - # Build the sources + # Setup go exe and environnement ynh_use_go - unset GOPATH - make build + "$ynh_go" env + # Build server from source + make build 2>&1 + # Setup a nice Yunohost logo + cp /usr/share/yunohost/admin/img/logo.08bab97e.png web/themes/light/logo.png popd ynh_remove_go From 24c1ce4f90552395f9656b85d7476c74684612fb Mon Sep 17 00:00:00 2001 From: Limezy Date: Fri, 25 Mar 2022 13:42:37 +0700 Subject: [PATCH 03/17] Update ynh_install_go --- scripts/ynh_install_go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/scripts/ynh_install_go b/scripts/ynh_install_go index fbc412c..e8d248f 100644 --- a/scripts/ynh_install_go +++ b/scripts/ynh_install_go @@ -75,6 +75,8 @@ ynh_use_go () { pushd $final_path $goenv_install_dir/bin/goenv local $go_version popd + + "$ynh_go" env } # Install a specific version of Go From c03ed1c1761c32b61aa077415886982b6a84cbfb Mon Sep 17 00:00:00 2001 From: Limezy Date: Fri, 25 Mar 2022 13:48:47 +0700 Subject: [PATCH 04/17] Test --- scripts/install | 2 +- scripts/ynh_install_go | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/scripts/install b/scripts/install index 0bcc85d..c4c933c 100755 --- a/scripts/install +++ b/scripts/install @@ -117,7 +117,7 @@ ynh_exec_warn_less ynh_install_go --go_version=$GO_VERSION pushd "$final_path" # Setup go exe and environnement ynh_use_go - "$ynh_go" env + /opt/goenv/versions/1.17.8/bin/go env # Build server from source make build 2>&1 # Setup a nice Yunohost logo diff --git a/scripts/ynh_install_go b/scripts/ynh_install_go index e8d248f..fbc412c 100644 --- a/scripts/ynh_install_go +++ b/scripts/ynh_install_go @@ -75,8 +75,6 @@ ynh_use_go () { pushd $final_path $goenv_install_dir/bin/goenv local $go_version popd - - "$ynh_go" env } # Install a specific version of Go From b1d41f2b265987590b24fc97b6d8be06ecfc6501 Mon Sep 17 00:00:00 2001 From: Limezy Date: Fri, 25 Mar 2022 13:50:46 +0700 Subject: [PATCH 05/17] Update install --- scripts/install | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/install b/scripts/install index c4c933c..9de8e3f 100755 --- a/scripts/install +++ b/scripts/install @@ -117,7 +117,7 @@ ynh_exec_warn_less ynh_install_go --go_version=$GO_VERSION pushd "$final_path" # Setup go exe and environnement ynh_use_go - /opt/goenv/versions/1.17.8/bin/go env + go env # Build server from source make build 2>&1 # Setup a nice Yunohost logo From f7e81b6579058c83714019937e249eb44b9f5a09 Mon Sep 17 00:00:00 2001 From: Limezy Date: Fri, 25 Mar 2022 21:01:26 +0700 Subject: [PATCH 06/17] Linter --- scripts/upgrade | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/upgrade b/scripts/upgrade index 48afeba..0aafd75 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -140,7 +140,7 @@ ynh_use_logrotate --non-append #================================================= ynh_script_progression --message="Integrating service in YunoHost..." --time --weight=1 -yunohost service add $app --description="A short description of the app" --log="/var/log/$app/$app.log" +yunohost service add $app --description="OpenID Connect Provider" --log="/var/log/$app/$app.log" #================================================= # START SYSTEMD SERVICE From d4c08b2deeb1ab8408f4f6c2f17e31bef33b28c6 Mon Sep 17 00:00:00 2001 From: Limezy Date: Fri, 25 Mar 2022 21:16:51 +0700 Subject: [PATCH 07/17] Update --- scripts/install | 1 - scripts/upgrade | 1 - 2 files changed, 2 deletions(-) diff --git a/scripts/install b/scripts/install index 9de8e3f..8a51bfc 100755 --- a/scripts/install +++ b/scripts/install @@ -117,7 +117,6 @@ ynh_exec_warn_less ynh_install_go --go_version=$GO_VERSION pushd "$final_path" # Setup go exe and environnement ynh_use_go - go env # Build server from source make build 2>&1 # Setup a nice Yunohost logo diff --git a/scripts/upgrade b/scripts/upgrade index 0aafd75..190e6ec 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -98,7 +98,6 @@ ynh_exec_warn_less ynh_install_go --go_version=$GO_VERSION pushd "$final_path" # Setup go exe and environnement ynh_use_go - "$ynh_go" env # Build server from source make build 2>&1 # Setup a nice Yunohost logo From 49473b775c505eb811505366b9ae882528880a35 Mon Sep 17 00:00:00 2001 From: Limezy Date: Sat, 26 Mar 2022 17:47:15 +0700 Subject: [PATCH 08/17] =?UTF-8?q?Trick=20Nginx=20for=20the=20CI=20?= =?UTF-8?q?=F0=9F=98=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- conf/nginx.conf | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/conf/nginx.conf b/conf/nginx.conf index 529ec2a..9aa049f 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -1,7 +1,13 @@ -#sub_path_only rewrite ^__PATH__$ __PATH__/ permanent; -location __PATH__/ { +rewrite ^__PATH__$ __PATH__/ permanent; + +location = __PATH__/ { + + default_type text/plain; + return 200 "This is where Dex is installed."; +} + +location ~ __PATH__/.+ { - # Force usage of https if ($scheme = http) { rewrite ^ https://$server_name$request_uri? permanent; } @@ -17,4 +23,4 @@ location __PATH__/ { proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade"; -} +} \ No newline at end of file From d5d42b28ee714ca3e9feac54b42dca78acd25c39 Mon Sep 17 00:00:00 2001 From: Limezy Date: Sat, 26 Mar 2022 17:54:01 +0700 Subject: [PATCH 09/17] Update DISCLAIMER.md --- doc/DISCLAIMER.md | 1 + 1 file changed, 1 insertion(+) diff --git a/doc/DISCLAIMER.md b/doc/DISCLAIMER.md index 1c25214..efbecab 100644 --- a/doc/DISCLAIMER.md +++ b/doc/DISCLAIMER.md @@ -6,3 +6,4 @@ * To be used carefully : * Changing URL will work but will require some settings change in the app using Dex as an OIDC provider + * Going to the URL will only let you see a "This is where Dex is installed." message From 4aa156579c93db1dfa197ccc0017d15779be6e3b Mon Sep 17 00:00:00 2001 From: Limezy Date: Sat, 26 Mar 2022 18:06:00 +0700 Subject: [PATCH 10/17] Update nginx.conf --- conf/nginx.conf | 2 -- 1 file changed, 2 deletions(-) diff --git a/conf/nginx.conf b/conf/nginx.conf index 9aa049f..66ee4dc 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -1,5 +1,3 @@ -rewrite ^__PATH__$ __PATH__/ permanent; - location = __PATH__/ { default_type text/plain; From 1a4320df03daaaacc4f06a44f79e2dd3f7a626a3 Mon Sep 17 00:00:00 2001 From: Limezy Date: Sun, 27 Mar 2022 10:07:11 +0700 Subject: [PATCH 11/17] Update nginx.conf --- conf/nginx.conf | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/conf/nginx.conf b/conf/nginx.conf index 66ee4dc..8571337 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -1,4 +1,5 @@ -location = __PATH__/ { +rewrite ^__PATH__$ __PATH__/; +location ~ __PATH__/ { default_type text/plain; return 200 "This is where Dex is installed."; From 4b78b2a89b91f05695756aa552bd7e00efa757b0 Mon Sep 17 00:00:00 2001 From: Limezy Date: Sun, 27 Mar 2022 21:35:36 +0700 Subject: [PATCH 12/17] Update nginx.conf --- conf/nginx.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conf/nginx.conf b/conf/nginx.conf index 8571337..baa1a62 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -1,5 +1,5 @@ rewrite ^__PATH__$ __PATH__/; -location ~ __PATH__/ { +location ~ __PATH__/$ { default_type text/plain; return 200 "This is where Dex is installed."; From de037c10fc7748f381b64d91a0d5c863ea731972 Mon Sep 17 00:00:00 2001 From: Limezy Date: Tue, 29 Mar 2022 23:03:40 +0700 Subject: [PATCH 13/17] Stupid mistake --- scripts/upgrade | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/upgrade b/scripts/upgrade index 190e6ec..0ba631b 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -7,6 +7,7 @@ #================================================= source _common.sh +source ynh_install_go source /usr/share/yunohost/helpers #================================================= From 1af02b645ea3d484dc2376aa3e69b96d558fc182 Mon Sep 17 00:00:00 2001 From: Limezy Date: Wed, 30 Mar 2022 10:29:00 +0700 Subject: [PATCH 14/17] Stupid mistake episode 2 --- scripts/upgrade | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/upgrade b/scripts/upgrade index 0ba631b..95951e7 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -115,7 +115,7 @@ ynh_script_progression --message="Updating a configuration file..." --time --wei ynh_add_config --template="config.yaml" --destination="$final_path/config.yaml" chmod 400 "$final_path/config.yaml" -chown $app:$app "$final_path/some_config_file" +chown $app:$app "$final_path/config.yaml" #================================================= # SETUP SYSTEMD From 61a4128dbf642448992091c1613f275869228a56 Mon Sep 17 00:00:00 2001 From: Limezy Date: Wed, 30 Mar 2022 10:32:42 +0700 Subject: [PATCH 15/17] Correct package licence --- manifest.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifest.json b/manifest.json index 9fb6cb0..f44adb7 100644 --- a/manifest.json +++ b/manifest.json @@ -15,7 +15,7 @@ "userdoc": "", "code": "https://github.com/dexidp/dex" }, - "license": "free", + "license": "AGPL-3.0-only", "maintainer": { "name": "Limezy" }, From e3815fa9d616c203c2f9145d039ab6730bb79a87 Mon Sep 17 00:00:00 2001 From: Limezy Date: Wed, 30 Mar 2022 10:36:46 +0700 Subject: [PATCH 16/17] Linter --- scripts/change_url | 14 +++++++------- scripts/install | 32 ++++++++++++++++---------------- scripts/remove | 26 +++++++++++++------------- scripts/restore | 26 +++++++++++++------------- scripts/upgrade | 28 ++++++++++++++-------------- 5 files changed, 63 insertions(+), 63 deletions(-) diff --git a/scripts/change_url b/scripts/change_url index 7f4701f..be7d1e1 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -24,7 +24,7 @@ app=$YNH_APP_INSTANCE_NAME #================================================= # LOAD SETTINGS #================================================= -ynh_script_progression --message="Loading installation settings..." --time --weight=1 +ynh_script_progression --message="Loading installation settings..." --weight=1 # Needed for helper "ynh_add_nginx_config" final_path=$(ynh_app_setting_get --app=$app --key=final_path) @@ -36,7 +36,7 @@ oidc_callback=$(ynh_app_setting_get --app=$app --key=oidc_callback) #================================================= # BACKUP BEFORE CHANGE URL THEN ACTIVE TRAP #================================================= -ynh_script_progression --message="Backing up the app before changing its URL (may take a while)..." --time --weight=1 +ynh_script_progression --message="Backing up the app before changing its URL (may take a while)..." --weight=1 # Backup the current version of the app ynh_backup_before_upgrade @@ -71,14 +71,14 @@ fi #================================================= # STOP SYSTEMD SERVICE #================================================= -ynh_script_progression --message="Stopping a systemd service..." --time --weight=1 +ynh_script_progression --message="Stopping a systemd service..." --weight=1 ynh_systemd_action --service_name=$app --action="stop" --log_path="/var/log/$app/$app.log" #================================================= # MODIFY URL IN NGINX CONF #================================================= -ynh_script_progression --message="Updating NGINX web server configuration..." --time --weight=1 +ynh_script_progression --message="Updating NGINX web server configuration..." --weight=1 nginx_conf_path=/etc/nginx/conf.d/$old_domain.d/$app.conf @@ -123,14 +123,14 @@ ynh_add_config --template="config.yaml" --destination="$final_path/config.yaml" #================================================= # START SYSTEMD SERVICE #================================================= -ynh_script_progression --message="Starting a systemd service..." --time --weight=1 +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" #================================================= # RELOAD NGINX #================================================= -ynh_script_progression --message="Reloading NGINX web server..." --time --weight=1 +ynh_script_progression --message="Reloading NGINX web server..." --weight=1 ynh_systemd_action --service_name=nginx --action=reload @@ -138,4 +138,4 @@ ynh_systemd_action --service_name=nginx --action=reload # END OF SCRIPT #================================================= -ynh_script_progression --message="Change of URL completed for $app" --time --last +ynh_script_progression --message="Change of URL completed for $app" --last diff --git a/scripts/install b/scripts/install index 8a51bfc..cda43e7 100755 --- a/scripts/install +++ b/scripts/install @@ -38,7 +38,7 @@ app=$YNH_APP_INSTANCE_NAME #================================================= # CHECK IF THE APP CAN BE INSTALLED WITH THESE ARGS #================================================= -ynh_script_progression --message="Validating installation parameters..." --time --weight=1 +ynh_script_progression --message="Validating installation parameters..." --weight=1 final_path=/opt/yunohost/$app test ! -e "$final_path" || ynh_die --message="This path already contains a folder" @@ -49,7 +49,7 @@ ynh_webpath_register --app=$app --domain=$domain --path_url=$path_url #================================================= # STORE SETTINGS FROM MANIFEST #================================================= -ynh_script_progression --message="Storing installation settings..." --time --weight=1 +ynh_script_progression --message="Storing installation settings..." --weight=1 ynh_app_setting_set --app=$app --key=domain --value=$domain ynh_app_setting_set --app=$app --key=path --value=$path_url @@ -62,7 +62,7 @@ ynh_app_setting_set --app=$app --key=oidc_callback --value=$oidc_callback #================================================= # FIND AND OPEN A PORT #================================================= -ynh_script_progression --message="Finding an available port..." --time --weight=1 +ynh_script_progression --message="Finding an available port..." --weight=1 # Find an available port port=$(ynh_find_port --port=5556) @@ -71,14 +71,14 @@ ynh_app_setting_set --app=$app --key=port --value=$port #================================================= # INSTALL DEPENDENCIES #================================================= -# ynh_script_progression --message="Installing dependencies..." --time --weight=1 +# ynh_script_progression --message="Installing dependencies..." --weight=1 # ynh_install_app_dependencies $pkg_dependencies #================================================= # CREATE DEDICATED USER #================================================= -ynh_script_progression --message="Configuring system user..." --time --weight=1 +ynh_script_progression --message="Configuring system user..." --weight=1 # Create a system user ynh_system_user_create --username=$app --home_dir="$final_path" @@ -86,7 +86,7 @@ ynh_system_user_create --username=$app --home_dir="$final_path" #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE #================================================= -ynh_script_progression --message="Setting up source files..." --time --weight=1 +ynh_script_progression --message="Setting up source files..." --weight=1 ynh_app_setting_set --app=$app --key=final_path --value=$final_path # Download, check integrity, uncompress and patch the source from app.src @@ -99,7 +99,7 @@ chown -R $app:www-data "$final_path" #================================================= # NGINX CONFIGURATION #================================================= -ynh_script_progression --message="Configuring NGINX web server..." --time --weight=1 +ynh_script_progression --message="Configuring NGINX web server..." --weight=1 # Create a dedicated NGINX config ynh_add_nginx_config @@ -128,7 +128,7 @@ ynh_remove_go #================================================= # ADD A CONFIGURATION #================================================= -ynh_script_progression --message="Adding a configuration file..." --time --weight=1 +ynh_script_progression --message="Adding a configuration file..." --weight=1 ynh_add_config --template="config.yaml" --destination="$final_path/config.yaml" @@ -138,7 +138,7 @@ chown $app:$app "$final_path/config.yaml" #================================================= # SETUP SYSTEMD #================================================= -ynh_script_progression --message="Configuring a systemd service..." --time --weight=1 +ynh_script_progression --message="Configuring a systemd service..." --weight=1 ynh_add_systemd_config @@ -148,7 +148,7 @@ ynh_add_systemd_config #================================================= # SETUP LOGROTATE #================================================= -ynh_script_progression --message="Configuring log rotation..." --time --weight=1 +ynh_script_progression --message="Configuring log rotation..." --weight=1 # Use logrotate to manage application logfile(s) ynh_use_logrotate @@ -156,14 +156,14 @@ ynh_use_logrotate #================================================= # INTEGRATE SERVICE IN YUNOHOST #================================================= -ynh_script_progression --message="Integrating service in YunoHost..." --time --weight=1 +ynh_script_progression --message="Integrating service in YunoHost..." --weight=1 yunohost service add $app --description="OpenID Connect Provider" --log="/var/log/$app/$app.log" #================================================= # START SYSTEMD SERVICE #================================================= -ynh_script_progression --message="Starting a systemd service..." --time --weight=1 +ynh_script_progression --message="Starting a systemd service..." --weight=1 # Start a systemd service ynh_systemd_action --service_name=$app --action="start" --log_path="/var/log/$app/$app.log" @@ -171,7 +171,7 @@ ynh_systemd_action --service_name=$app --action="start" --log_path="/var/log/$ap #================================================= # SETUP FAIL2BAN #================================================= -#ynh_script_progression --message="Configuring Fail2Ban..." --time --weight=1 +#ynh_script_progression --message="Configuring Fail2Ban..." --weight=1 # Create a dedicated Fail2Ban config #ynh_add_fail2ban_config --logpath="/var/log/dex/dex.log" --failregex="ldap: invalid password for user" @@ -179,7 +179,7 @@ ynh_systemd_action --service_name=$app --action="start" --log_path="/var/log/$ap #================================================= # SETUP SSOWAT #================================================= -ynh_script_progression --message="Configuring permissions..." --time --weight=1 +ynh_script_progression --message="Configuring permissions..." --weight=1 # Make app public if necessary if [ $is_public -eq 1 ] @@ -192,7 +192,7 @@ fi #================================================= # RELOAD NGINX #================================================= -ynh_script_progression --message="Reloading NGINX web server..." --time --weight=1 +ynh_script_progression --message="Reloading NGINX web server..." --weight=1 ynh_systemd_action --service_name=nginx --action=reload @@ -200,4 +200,4 @@ ynh_systemd_action --service_name=nginx --action=reload # END OF SCRIPT #================================================= -ynh_script_progression --message="Installation of $app completed" --time --last +ynh_script_progression --message="Installation of $app completed" --last diff --git a/scripts/remove b/scripts/remove index b905a70..ce01d98 100755 --- a/scripts/remove +++ b/scripts/remove @@ -12,7 +12,7 @@ source /usr/share/yunohost/helpers #================================================= # LOAD SETTINGS #================================================= -ynh_script_progression --message="Loading installation settings..." --time --weight=1 +ynh_script_progression --message="Loading installation settings..." --weight=1 app=$YNH_APP_INSTANCE_NAME @@ -33,14 +33,14 @@ oidc_callback=$(ynh_app_setting_get --app=$app --key=oidc_callback) # Remove the service from the list of services known by YunoHost (added from `yunohost service add`) if ynh_exec_warn_less yunohost service status $app >/dev/null then - ynh_script_progression --message="Removing $app service integration..." --time --weight=1 + ynh_script_progression --message="Removing $app service integration..." --weight=1 yunohost service remove $app fi #================================================= # STOP AND REMOVE SERVICE #================================================= -ynh_script_progression --message="Stopping and removing the systemd service..." --time --weight=1 +ynh_script_progression --message="Stopping and removing the systemd service..." --weight=1 # Remove the dedicated systemd config ynh_remove_systemd_config @@ -48,7 +48,7 @@ ynh_remove_systemd_config #================================================= # REMOVE LOGROTATE CONFIGURATION #================================================= -ynh_script_progression --message="Removing logrotate configuration..." --time --weight=1 +ynh_script_progression --message="Removing logrotate configuration..." --weight=1 # Remove the app-specific logrotate config ynh_remove_logrotate @@ -56,7 +56,7 @@ ynh_remove_logrotate #================================================= # REMOVE APP MAIN DIR #================================================= -ynh_script_progression --message="Removing app main directory..." --time --weight=1 +ynh_script_progression --message="Removing app main directory..." --weight=1 # Remove the app directory securely ynh_secure_remove --file="$final_path" @@ -68,14 +68,14 @@ ynh_secure_remove --file="$final_path" # Remove the data directory if --purge option is used if [ "${YNH_APP_PURGE:-0}" -eq 1 ] then - ynh_script_progression --message="Removing app data directory..." --time --weight=1 + ynh_script_progression --message="Removing app data directory..." --weight=1 ynh_secure_remove --file="$datadir" fi #================================================= # REMOVE NGINX CONFIGURATION #================================================= -ynh_script_progression --message="Removing NGINX web server configuration..." --time --weight=1 +ynh_script_progression --message="Removing NGINX web server configuration..." --weight=1 # Remove the dedicated NGINX config ynh_remove_nginx_config @@ -83,7 +83,7 @@ ynh_remove_nginx_config #================================================= # REMOVE DEPENDENCIES #================================================= -# ynh_script_progression --message="Removing dependencies..." --time --weight=1 +# ynh_script_progression --message="Removing dependencies..." --weight=1 # Remove metapackage and its dependencies # ynh_remove_app_dependencies @@ -94,14 +94,14 @@ ynh_remove_nginx_config if yunohost firewall list | grep -q "\- $port$" then - ynh_script_progression --message="Closing port $port..." --time --weight=1 + ynh_script_progression --message="Closing port $port..." --weight=1 ynh_exec_warn_less yunohost firewall disallow TCP $port fi #================================================= # REMOVE FAIL2BAN CONFIGURATION #================================================= -#ynh_script_progression --message="Removing Fail2Ban configuration..." --time --weight=1 +#ynh_script_progression --message="Removing Fail2Ban configuration..." --weight=1 # Remove the dedicated Fail2Ban config #ynh_remove_fail2ban_config @@ -111,7 +111,7 @@ fi #================================================= # REMOVE VARIOUS FILES #================================================= -ynh_script_progression --message="Removing various files..." --time --weight=1 +ynh_script_progression --message="Removing various files..." --weight=1 # Remove a directory securely ynh_secure_remove --file="/etc/$app" @@ -124,7 +124,7 @@ ynh_secure_remove --file="/var/log/$app" #================================================= # REMOVE DEDICATED USER #================================================= -ynh_script_progression --message="Removing the dedicated system user..." --time --weight=1 +ynh_script_progression --message="Removing the dedicated system user..." --weight=1 # Delete a system user ynh_system_user_delete --username=$app @@ -133,4 +133,4 @@ ynh_system_user_delete --username=$app # END OF SCRIPT #================================================= -ynh_script_progression --message="Removal of $app completed" --time --last +ynh_script_progression --message="Removal of $app completed" --last diff --git a/scripts/restore b/scripts/restore index 8832841..cbe9cec 100755 --- a/scripts/restore +++ b/scripts/restore @@ -24,7 +24,7 @@ ynh_abort_if_errors #================================================= # LOAD SETTINGS #================================================= -ynh_script_progression --message="Loading installation settings..." --time --weight=1 +ynh_script_progression --message="Loading installation settings..." --weight=1 app=$YNH_APP_INSTANCE_NAME @@ -39,7 +39,7 @@ oidc_callback=$(ynh_app_setting_get --app=$app --key=oidc_callback) #================================================= # CHECK IF THE APP CAN BE RESTORED #================================================= -ynh_script_progression --message="Validating restoration parameters..." --time --weight=1 +ynh_script_progression --message="Validating restoration parameters..." --weight=1 test ! -d $final_path \ || ynh_die --message="There is already a directory: $final_path " @@ -49,14 +49,14 @@ test ! -d $final_path \ #================================================= # RESTORE THE NGINX CONFIGURATION #================================================= -ynh_script_progression --message="Restoring the NGINX web server configuration..." --time --weight=1 +ynh_script_progression --message="Restoring the NGINX web server configuration..." --weight=1 ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf" #================================================= # RECREATE THE DEDICATED USER #================================================= -ynh_script_progression --message="Recreating the dedicated system user..." --time --weight=1 +ynh_script_progression --message="Recreating the dedicated system user..." --weight=1 # Create the dedicated user (if not existing) ynh_system_user_create --username=$app --home_dir="$final_path" @@ -64,7 +64,7 @@ ynh_system_user_create --username=$app --home_dir="$final_path" #================================================= # RESTORE THE APP MAIN DIR #================================================= -ynh_script_progression --message="Restoring the app main directory..." --time --weight=1 +ynh_script_progression --message="Restoring the app main directory..." --weight=1 ynh_restore_file --origin_path="$final_path" @@ -75,7 +75,7 @@ chown -R $app:www-data "$final_path" #================================================= # RESTORE FAIL2BAN CONFIGURATION #================================================= -#ynh_script_progression --message="Restoring the Fail2Ban configuration..." --time --weight=1 +#ynh_script_progression --message="Restoring the Fail2Ban configuration..." --weight=1 #ynh_restore_file --origin_path="/etc/fail2ban/jail.d/$app.conf" #ynh_restore_file --origin_path="/etc/fail2ban/filter.d/$app.conf" @@ -86,7 +86,7 @@ chown -R $app:www-data "$final_path" #================================================= # REINSTALL DEPENDENCIES #================================================= -# ynh_script_progression --message="Reinstalling dependencies..." --time --weight=1 +# ynh_script_progression --message="Reinstalling dependencies..." --weight=1 # Define and install dependencies # ynh_install_app_dependencies $pkg_dependencies @@ -94,7 +94,7 @@ chown -R $app:www-data "$final_path" #================================================= # RESTORE SYSTEMD #================================================= -ynh_script_progression --message="Restoring the systemd configuration..." --time --weight=1 +ynh_script_progression --message="Restoring the systemd configuration..." --weight=1 ynh_restore_file --origin_path="/etc/systemd/system/$app.service" systemctl enable $app.service --quiet @@ -102,7 +102,7 @@ systemctl enable $app.service --quiet #================================================= # RESTORE THE LOGROTATE CONFIGURATION #================================================= -ynh_script_progression --message="Restoring the logrotate configuration..." --time --weight=1 +ynh_script_progression --message="Restoring the logrotate configuration..." --weight=1 mkdir -p /var/log/$app chown -R $app:root /var/log/$app @@ -112,14 +112,14 @@ ynh_restore_file --origin_path="/etc/logrotate.d/$app" #================================================= # INTEGRATE SERVICE IN YUNOHOST #================================================= -ynh_script_progression --message="Integrating service in YunoHost..." --time --weight=1 +ynh_script_progression --message="Integrating service in YunoHost..." --weight=1 yunohost service add $app --description="OpenID Connect Provider" --log="/var/log/$app/$app.log" #================================================= # START SYSTEMD SERVICE #================================================= -ynh_script_progression --message="Starting a systemd service..." --time --weight=1 +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" @@ -128,7 +128,7 @@ ynh_systemd_action --service_name=$app --action="start" --log_path="/var/log/$ap #================================================= # RELOAD NGINX AND PHP-FPM #================================================= -ynh_script_progression --message="Reloading NGINX web server..." --time --weight=1 +ynh_script_progression --message="Reloading NGINX web server..." --weight=1 ynh_systemd_action --service_name=nginx --action=reload @@ -136,4 +136,4 @@ ynh_systemd_action --service_name=nginx --action=reload # END OF SCRIPT #================================================= -ynh_script_progression --message="Restoration completed for $app" --time --last +ynh_script_progression --message="Restoration completed for $app" --last diff --git a/scripts/upgrade b/scripts/upgrade index 95951e7..d66bc20 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -13,7 +13,7 @@ source /usr/share/yunohost/helpers #================================================= # LOAD SETTINGS #================================================= -ynh_script_progression --message="Loading installation settings..." --time --weight=1 +ynh_script_progression --message="Loading installation settings..." --weight=1 app=$YNH_APP_INSTANCE_NAME @@ -34,7 +34,7 @@ upgrade_type=$(ynh_check_app_version_changed) #================================================= # BACKUP BEFORE UPGRADE THEN ACTIVE TRAP #================================================= -ynh_script_progression --message="Backing up the app before upgrading (may take a while)..." --time --weight=1 +ynh_script_progression --message="Backing up the app before upgrading (may take a while)..." --weight=1 # Backup the current version of the app ynh_backup_before_upgrade @@ -50,14 +50,14 @@ ynh_abort_if_errors #================================================= # STOP SYSTEMD SERVICE #================================================= -ynh_script_progression --message="Stopping a systemd service..." --time --weight=1 +ynh_script_progression --message="Stopping a systemd service..." --weight=1 ynh_systemd_action --service_name=$app --action="stop" --log_path="/var/log/$app/$app.log" #================================================= # CREATE DEDICATED USER #================================================= -ynh_script_progression --message="Making sure dedicated system user exists..." --time --weight=1 +ynh_script_progression --message="Making sure dedicated system user exists..." --weight=1 # Create a dedicated user (if not existing) ynh_system_user_create --username=$app --home_dir="$final_path" @@ -68,7 +68,7 @@ ynh_system_user_create --username=$app --home_dir="$final_path" if [ "$upgrade_type" == "UPGRADE_APP" ] then - ynh_script_progression --message="Upgrading source files..." --time --weight=1 + ynh_script_progression --message="Upgrading source files..." --weight=1 # Download, check integrity, uncompress and patch the source from app.src ynh_setup_source --dest_dir="$final_path" @@ -81,7 +81,7 @@ chown -R $app:www-data "$final_path" #================================================= # NGINX CONFIGURATION #================================================= -ynh_script_progression --message="Upgrading NGINX web server configuration..." --time --weight=1 +ynh_script_progression --message="Upgrading NGINX web server configuration..." --weight=1 # Create a dedicated NGINX config ynh_add_nginx_config @@ -110,7 +110,7 @@ ynh_remove_go #================================================= # UPDATE A CONFIG FILE #================================================= -ynh_script_progression --message="Updating a configuration file..." --time --weight=1 +ynh_script_progression --message="Updating a configuration file..." --weight=1 ynh_add_config --template="config.yaml" --destination="$final_path/config.yaml" @@ -120,7 +120,7 @@ chown $app:$app "$final_path/config.yaml" #================================================= # SETUP SYSTEMD #================================================= -ynh_script_progression --message="Upgrading systemd configuration..." --time --weight=1 +ynh_script_progression --message="Upgrading systemd configuration..." --weight=1 # Create a dedicated systemd config ynh_add_systemd_config @@ -130,7 +130,7 @@ ynh_add_systemd_config #================================================= # SETUP LOGROTATE #================================================= -ynh_script_progression --message="Upgrading logrotate configuration..." --time --weight=1 +ynh_script_progression --message="Upgrading logrotate configuration..." --weight=1 # Use logrotate to manage app-specific logfile(s) ynh_use_logrotate --non-append @@ -138,21 +138,21 @@ ynh_use_logrotate --non-append #================================================= # INTEGRATE SERVICE IN YUNOHOST #================================================= -ynh_script_progression --message="Integrating service in YunoHost..." --time --weight=1 +ynh_script_progression --message="Integrating service in YunoHost..." --weight=1 yunohost service add $app --description="OpenID Connect Provider" --log="/var/log/$app/$app.log" #================================================= # START SYSTEMD SERVICE #================================================= -ynh_script_progression --message="Starting a systemd service..." --time --weight=1 +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..." --time --weight=1 +#ynh_script_progression --message="Reconfiguring Fail2Ban..." --weight=1 # Create a dedicated Fail2Ban config #ynh_add_fail2ban_config --logpath="/var/log/dex/dex.log" --failregex="ldap: invalid password for user" @@ -160,7 +160,7 @@ ynh_systemd_action --service_name=$app --action="start" --log_path="/var/log/$ap #================================================= # RELOAD NGINX #================================================= -ynh_script_progression --message="Reloading NGINX web server..." --time --weight=1 +ynh_script_progression --message="Reloading NGINX web server..." --weight=1 ynh_systemd_action --service_name=nginx --action=reload @@ -168,4 +168,4 @@ ynh_systemd_action --service_name=nginx --action=reload # END OF SCRIPT #================================================= -ynh_script_progression --message="Upgrade of $app completed" --time --last +ynh_script_progression --message="Upgrade of $app completed" --last From 70abb58fa15c55441455937ef6592513f7813a7e Mon Sep 17 00:00:00 2001 From: yunohost-bot Date: Wed, 30 Mar 2022 07:19:51 +0000 Subject: [PATCH 17/17] Auto-update README --- README.md | 1 + README_fr.md | 1 + 2 files changed, 2 insertions(+) diff --git a/README.md b/README.md index afbdb73..a619e4c 100644 --- a/README.md +++ b/README.md @@ -43,6 +43,7 @@ This Yunohost package will install Dex and setup a canonical OpenID Connect prov * To be used carefully : * Changing URL will work but will require some settings change in the app using Dex as an OIDC provider + * Going to the URL will only let you see a "This is where Dex is installed." message ## Documentation and resources diff --git a/README_fr.md b/README_fr.md index 1895495..8f7c805 100644 --- a/README_fr.md +++ b/README_fr.md @@ -39,6 +39,7 @@ This Yunohost package will install Dex and setup a canonical OpenID Connect prov * To be used carefully : * Changing URL will work but will require some settings change in the app using Dex as an OIDC provider + * Going to the URL will only let you see a "This is where Dex is installed." message ## Documentations et ressources