From 4be5464020eb214978832a20e0616a0b5709909d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Wed, 15 Nov 2023 10:57:16 +0100 Subject: [PATCH 01/10] Update manifest.toml --- manifest.toml | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/manifest.toml b/manifest.toml index f9b86f3..b19bd66 100644 --- a/manifest.toml +++ b/manifest.toml @@ -16,11 +16,14 @@ admindoc = "https://shaarli.readthedocs.io/en/master/" code = "https://github.com/shaarli/Shaarli" [integration] -yunohost = ">= 11.1.15" +yunohost = ">= 11.2" architectures = "all" multi_instance = true + ldap = false + sso = false + disk = "50M" ram.build = "50M" ram.runtime = "50M" @@ -33,10 +36,10 @@ ram.runtime = "50M" default = "/shaarli" [install.init_main_permission] - help.en = "If set as public, Shaarli will be visible to anyone, including non-Yunohost users. However only Shaarli users can add bookmarks. Your links will be public by default, but you can change that in Shaarli's configuration page." - help.fr = "Si configuré en public, Shaarli sera visible par tout le monde, y compris des personnes sans compte sur votre Yunohost. Cependant seules les personnes avec un compte Shaarli pourrons ajouter des marques-pages. Vos nouveaux liens seront publics par défaut, mais vous pourrez changer ça dans la page de configuration de Shaarli." + help.en = "If set as 'visitors', Shaarli will be visible to anyone, including non-YunoHost users. However only Shaarli users can add bookmarks. Your links will be public by default, but you can change that in Shaarli's configuration page." + help.fr = "Si configuré en 'visiteurs', Shaarli sera visible par tout le monde, y compris des personnes sans compte sur votre YunoHost. Cependant seules les personnes avec un compte Shaarli pourrons ajouter des marques-pages. Vos nouveaux liens seront publics par défaut, mais vous pourrez changer ça dans la page de configuration de Shaarli." type = "group" - default = false + default = "visitors" [install.admin] type = "user" @@ -55,6 +58,7 @@ ram.runtime = "50M" [resources.sources.main] url = "https://github.com/shaarli/Shaarli/releases/download/v0.12.2/shaarli-v0.12.2-full.tar.gz" sha256 = "7c2077b1de493012a77d8e9bd926715f1576f5520eff86a239bc96d2df80fd1d" + autoupdate.strategy = "latest_github_tag" [resources.system_user] @@ -64,4 +68,4 @@ ram.runtime = "50M" main.url = "/" [resources.apt] - packages = "php8.0-cli php8.0-gettext php8.0-curl php8.0-intl php8.0-gd php8.0-mbstring" + packages = "php8.2-cli, php8.2-gettext, php8.2-curl, php8.2-intl, php8.2-gd, php8.2-mbstring, php8.2-xml, php8.2-ldap" From 84b497718023ebec1161f42008be0b376934c57b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Wed, 15 Nov 2023 11:17:59 +0100 Subject: [PATCH 02/10] cleaning --- scripts/install | 2 +- scripts/upgrade | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/install b/scripts/install index 682aff8..bb35bdd 100644 --- a/scripts/install +++ b/scripts/install @@ -27,7 +27,7 @@ chown -R $app:www-data "$install_dir" ynh_script_progression --message="Configuring PHP-FPM..." # Create a dedicated PHP-FPM config -ynh_add_fpm_config --usage=low --footprint=low +ynh_add_fpm_config #================================================= # NGINX CONFIGURATION diff --git a/scripts/upgrade b/scripts/upgrade index 3af9bea..4e7d128 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -51,7 +51,7 @@ chmod 700 "$install_dir/data/config.json.php" ynh_script_progression --message="Upgrading PHP-FPM configuration..." # Create a dedicated PHP-FPM config -ynh_add_fpm_config --usage=low --footprint=low +ynh_add_fpm_config #================================================= # NGINX CONFIGURATION From 975ce4d10db61e54c22877b686229b4c818695f4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Wed, 15 Nov 2023 11:20:45 +0100 Subject: [PATCH 03/10] Update manifest.toml --- manifest.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/manifest.toml b/manifest.toml index b19bd66..82772ef 100644 --- a/manifest.toml +++ b/manifest.toml @@ -2,8 +2,8 @@ packaging_format = 2 id = "shaarli" name = "Shaarli" -description.en = "The personal, minimalist, super-fast, no-database delicious clone" -description.fr = "Clone de delicious, rapide, simple et sans base de données" +description.en = "Save, sort, synchronize and share web addresses" +description.fr = "Sauvegarder, trier, synchroniser et partager des adresses web" version = "0.12.2~ynh1" From 8333adc6a67ff3edcde081234e97b16e3ab18703 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Wed, 15 Nov 2023 11:22:56 +0100 Subject: [PATCH 04/10] Update remove --- scripts/remove | 21 ++------------------- 1 file changed, 2 insertions(+), 19 deletions(-) diff --git a/scripts/remove b/scripts/remove index 66d1caa..d7eff2a 100644 --- a/scripts/remove +++ b/scripts/remove @@ -10,36 +10,19 @@ source _common.sh source /usr/share/yunohost/helpers #================================================= -# STANDARD REMOVE +# REMOVE SYSTEM CONFIGURATIONS #================================================= -# REMOVE LOGROTATE CONFIGURATION -#================================================= -ynh_script_progression --message="Removing logrotate configuration..." +ynh_script_progression --message="Removing system configurations related to $app..." --weight=1 # Remove the app-specific logrotate config ynh_remove_logrotate -#================================================= -# REMOVE NGINX CONFIGURATION -#================================================= -ynh_script_progression --message="Removing NGINX web server configuration..." - # Remove the dedicated NGINX config ynh_remove_nginx_config -#================================================= -# REMOVE PHP-FPM CONFIGURATION -#================================================= -ynh_script_progression --message="Removing PHP-FPM configuration..." - # Remove the dedicated PHP-FPM config ynh_remove_fpm_config -#================================================= -# REMOVE FAIL2BAN CONFIGURATION -#================================================= -ynh_script_progression --message="Removing Fail2Ban configuration..." - # Remove the dedicated Fail2Ban config ynh_remove_fail2ban_config From 515bf7a610b7f87ed5dacde6a3b33bd6e4175d29 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Wed, 15 Nov 2023 11:26:05 +0100 Subject: [PATCH 05/10] cleaning --- scripts/change_url | 2 +- scripts/install | 41 ++++++++++++----------------------------- scripts/restore | 37 ++++++++++++------------------------- scripts/upgrade | 23 +++-------------------- 4 files changed, 28 insertions(+), 75 deletions(-) diff --git a/scripts/change_url b/scripts/change_url index 690b1ba..b61cc1e 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -14,7 +14,7 @@ source /usr/share/yunohost/helpers #================================================= # MODIFY URL IN NGINX CONF #================================================= -ynh_script_progression --message="Updating NGINX web server configuration..." +ynh_script_progression --message="Updating NGINX web server configuration..." --weight=1 ynh_change_url_nginx_config diff --git a/scripts/install b/scripts/install index bb35bdd..ded9798 100644 --- a/scripts/install +++ b/scripts/install @@ -12,7 +12,7 @@ source /usr/share/yunohost/helpers #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE #================================================= -ynh_script_progression --message="Setting up source files..." +ynh_script_progression --message="Setting up source files..." --weight=1 # Download, check integrity, uncompress and patch the source from app.src ynh_setup_source --dest_dir="$install_dir" @@ -22,27 +22,30 @@ chmod -R u+rwX $install_dir/{cache/,data/,pagecache/,tmp/} chown -R $app:www-data "$install_dir" #================================================= -# PHP-FPM CONFIGURATION +# SYSTEM CONFIGURATION #================================================= -ynh_script_progression --message="Configuring PHP-FPM..." +ynh_script_progression --message="Adding system configurations related to $app..." --weight=1 # Create a dedicated PHP-FPM config ynh_add_fpm_config -#================================================= -# NGINX CONFIGURATION -#================================================= -ynh_script_progression --message="Configuring NGINX web server..." - # Create a dedicated NGINX config ynh_add_nginx_config +# Use logrotate to manage application logfile(s) +touch "$install_dir/data/log.txt" +ynh_use_logrotate "$install_dir/data/log.txt" --specific_user=$app +chown $app:www-data "$install_dir/data/log.txt" + +# Create a dedicated Fail2Ban config +ynh_add_fail2ban_config --logpath="$install_dir/data/log.txt" --failregex="\s-\s\s-\sLogin failed for user.*$" + #================================================= # SPECIFIC SETUP #================================================= # ADD A CONFIGURATION #================================================= -ynh_script_progression --message="Adding a configuration file..." +ynh_script_progression --message="Adding a configuration file..." --weight=1 # Get the timezone timezone=$(cat /etc/timezone) @@ -68,26 +71,6 @@ fi ynh_add_config --template="../conf/config.json.php" --destination="$install_dir/data/config.json.php" chmod 700 "$install_dir/data/config.json.php" -#================================================= -# GENERIC FINALIZATION -#================================================= -# SETUP LOGROTATE -#================================================= -ynh_script_progression --message="Configuring log rotation..." - -# Use logrotate to manage application logfile(s) -touch "$install_dir/data/log.txt" -ynh_use_logrotate "$install_dir/data/log.txt" --specific_user=$app -chown $app:www-data "$install_dir/data/log.txt" - -#================================================= -# SETUP FAIL2BAN -#================================================= -ynh_script_progression --message="Configuring Fail2Ban..." - -# Create a dedicated Fail2Ban config -ynh_add_fail2ban_config --logpath="$install_dir/data/log.txt" --failregex="\s-\s\s-\sLogin failed for user.*$" - #================================================= # END OF SCRIPT #================================================= diff --git a/scripts/restore b/scripts/restore index 2a465b1..cbf88da 100644 --- a/scripts/restore +++ b/scripts/restore @@ -13,7 +13,7 @@ source /usr/share/yunohost/helpers #================================================= # RESTORE THE APP MAIN DIR #================================================= -ynh_script_progression --message="Restoring the app main directory..." +ynh_script_progression --message="Restoring the app main directory..." --weight=1 ynh_restore_file --origin_path="$install_dir" @@ -23,41 +23,28 @@ chown -R $app:www-data "$install_dir" chmod 700 "$install_dir/data/config.json.php" #================================================= -# RESTORE FAIL2BAN CONFIGURATION +# RESTORE SYSTEM CONFIGURATIONS #================================================= -ynh_script_progression --message="Restoring the Fail2Ban configuration..." +# RESTORE THE PHP-FPM CONFIGURATION +#================================================= +ynh_script_progression --message="Restoring system configurations related to $app..." --weight=1 + +ynh_restore_file --origin_path="/etc/php/$phpversion/fpm/pool.d/$app.conf" + +ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf" + +ynh_restore_file --origin_path="/etc/logrotate.d/$app" ynh_restore_file --origin_path="/etc/fail2ban/jail.d/$app.conf" ynh_restore_file --origin_path="/etc/fail2ban/filter.d/$app.conf" ynh_systemd_action --action=restart --service_name=fail2ban -#================================================= -# RESTORE THE PHP-FPM CONFIGURATION -#================================================= -ynh_script_progression --message="Restoring the PHP-FPM configuration..." - -ynh_restore_file --origin_path="/etc/php/$phpversion/fpm/pool.d/$app.conf" - -#================================================= -# RESTORE THE NGINX CONFIGURATION -#================================================= -ynh_script_progression --message="Restoring the NGINX web server configuration..." - -ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf" - -#================================================= -# RESTORE THE LOGROTATE CONFIGURATION -#================================================= -ynh_script_progression --message="Restoring the logrotate configuration..." - -ynh_restore_file --origin_path="/etc/logrotate.d/$app" - #================================================= # GENERIC FINALIZATION #================================================= # RELOAD NGINX AND PHP-FPM #================================================= -ynh_script_progression --message="Reloading NGINX web server and PHP-FPM..." +ynh_script_progression --message="Reloading NGINX web server and PHP-FPM..." --weight=1 ynh_systemd_action --service_name=php$phpversion-fpm --action=reload ynh_systemd_action --service_name=nginx --action=reload diff --git a/scripts/upgrade b/scripts/upgrade index 4e7d128..f574c9c 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -21,7 +21,7 @@ upgrade_type=$(ynh_check_app_version_changed) if [ "$upgrade_type" == "UPGRADE_APP" ] || [ "$upgrade_type" == "UPGRADE_FORCED" ] # we should do that during a force upgrade too (as it could lead to a version upgrade for instance) then - ynh_script_progression --message="Upgrading source files..." + ynh_script_progression --message="Upgrading source files..." --weight=1 # Create a temporary directory tmpdir="$(mktemp -d)" @@ -46,28 +46,16 @@ chown -R $app:www-data "$install_dir" chmod 700 "$install_dir/data/config.json.php" #================================================= -# PHP-FPM CONFIGURATION +# REAPPLY SYSTEM CONFIGURATIONS #================================================= -ynh_script_progression --message="Upgrading PHP-FPM configuration..." +ynh_script_progression --message="Upgrading system configurations related to $app..." --weight=1 # Create a dedicated PHP-FPM config ynh_add_fpm_config -#================================================= -# NGINX CONFIGURATION -#================================================= -ynh_script_progression --message="Upgrading NGINX web server configuration..." - # Create a dedicated NGINX config ynh_add_nginx_config -#================================================= -# GENERIC FINALIZATION -#================================================= -# SETUP LOGROTATE -#================================================= -ynh_script_progression --message="Upgrading logrotate configuration..." - # Use logrotate to manage app-specific logfile(s) # Temporary fix for .txt log file and ynh_use_logrotate if [ -d "$install_dir/data/log.txt" ] @@ -79,11 +67,6 @@ chown $app:www-data "$install_dir/data/log.txt" ynh_use_logrotate --non-append --specific_user=$app -#================================================= -# UPGRADE FAIL2BAN -#================================================= -ynh_script_progression --message="Reconfiguring Fail2Ban..." - # Create a dedicated Fail2Ban config ynh_add_fail2ban_config --logpath="$install_dir/data/log.txt" --failregex="\s-\s\s-\sLogin failed for user.*$" From 80f2ac1552b8de48fcc6d49a4e4ef6734cf5c43c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Wed, 15 Nov 2023 11:40:04 +0100 Subject: [PATCH 06/10] cleaning --- doc/DESCRIPTION_fr.md | 13 +++++++++++++ doc/POST_INSTALL.md | 1 - 2 files changed, 13 insertions(+), 1 deletion(-) create mode 100644 doc/DESCRIPTION_fr.md delete mode 100644 doc/POST_INSTALL.md diff --git a/doc/DESCRIPTION_fr.md b/doc/DESCRIPTION_fr.md new file mode 100644 index 0000000..bb3c537 --- /dev/null +++ b/doc/DESCRIPTION_fr.md @@ -0,0 +1,13 @@ +Shaarli is a minimalist bookmark manager and link sharing service that you can install on your own server. It is designed to be personal (single-user), fast and handy. + +### Features + +- share, comment and save interesting links +- bookmark useful/frequent links and share them between computers +- a minimal blog/microblog/writing platform +- a read-it-later/todo list +- a notepad to draft and save articles/posts/ideas +- a knowledge base to keep notes, documentation and code snippets +- a shared clipboard/notepad/pastebin between computers +- playlist manager for online media +- feed other blogs, aggregators, social networks... diff --git a/doc/POST_INSTALL.md b/doc/POST_INSTALL.md deleted file mode 100644 index 7f3d61b..0000000 --- a/doc/POST_INSTALL.md +++ /dev/null @@ -1 +0,0 @@ -The installation of Shaarli completed. You should now go to https://__DOMAIN____PATH__ and create your account. After the creation of the account, the registration will be locked. From 4e788a94a771e72897d08011e3e9cdcdb1f24d30 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Wed, 15 Nov 2023 13:31:18 +0100 Subject: [PATCH 07/10] Update DESCRIPTION_fr.md --- doc/DESCRIPTION_fr.md | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/doc/DESCRIPTION_fr.md b/doc/DESCRIPTION_fr.md index bb3c537..be655a6 100644 --- a/doc/DESCRIPTION_fr.md +++ b/doc/DESCRIPTION_fr.md @@ -1,13 +1,13 @@ -Shaarli is a minimalist bookmark manager and link sharing service that you can install on your own server. It is designed to be personal (single-user), fast and handy. +Shaarli est un gestionnaire de favoris minimaliste et un service de partage de liens que vous pouvez installer sur votre propre serveur. Il est conçu pour être personnel (mono-utilisateur), rapide et pratique. -### Features +### Caractéristiques -- share, comment and save interesting links -- bookmark useful/frequent links and share them between computers -- a minimal blog/microblog/writing platform -- a read-it-later/todo list -- a notepad to draft and save articles/posts/ideas -- a knowledge base to keep notes, documentation and code snippets -- a shared clipboard/notepad/pastebin between computers -- playlist manager for online media -- feed other blogs, aggregators, social networks... +- partager, commenter et enregistrer des liens intéressants +- ajoutez des liens utiles/fréquents à vos favoris et partagez-les entre ordinateurs +- une plateforme minimale de blog/microblog/écriture +- une liste à lire plus tard/à faire +- un bloc-notes pour rédiger et sauvegarder des articles/posts/idées +- une base de connaissances pour conserver des notes, de la documentation et des extraits de code +- un presse-papiers/bloc-notes/pastebin partagé entre ordinateurs +- gestionnaire de playlist pour les médias en ligne +- alimenter d'autres blogs, agrégateurs, réseaux sociaux... From 49467157ca632f9f0ba8d9d5a212c93f1a5f8df0 Mon Sep 17 00:00:00 2001 From: yunohost-bot Date: Wed, 15 Nov 2023 12:31:22 +0000 Subject: [PATCH 08/10] Auto-update README --- README_fr.md | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/README_fr.md b/README_fr.md index 52f9aac..4b5ff3c 100644 --- a/README_fr.md +++ b/README_fr.md @@ -16,19 +16,19 @@ Si vous n’avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) po ## Vue d’ensemble -Shaarli is a minimalist bookmark manager and link sharing service that you can install on your own server. It is designed to be personal (single-user), fast and handy. +Shaarli est un gestionnaire de favoris minimaliste et un service de partage de liens que vous pouvez installer sur votre propre serveur. Il est conçu pour être personnel (mono-utilisateur), rapide et pratique. -### Features +### Caractéristiques -- share, comment and save interesting links -- bookmark useful/frequent links and share them between computers -- a minimal blog/microblog/writing platform -- a read-it-later/todo list -- a notepad to draft and save articles/posts/ideas -- a knowledge base to keep notes, documentation and code snippets -- a shared clipboard/notepad/pastebin between computers -- playlist manager for online media -- feed other blogs, aggregators, social networks... +- partager, commenter et enregistrer des liens intéressants +- ajoutez des liens utiles/fréquents à vos favoris et partagez-les entre ordinateurs +- une plateforme minimale de blog/microblog/écriture +- une liste à lire plus tard/à faire +- un bloc-notes pour rédiger et sauvegarder des articles/posts/idées +- une base de connaissances pour conserver des notes, de la documentation et des extraits de code +- un presse-papiers/bloc-notes/pastebin partagé entre ordinateurs +- gestionnaire de playlist pour les médias en ligne +- alimenter d'autres blogs, agrégateurs, réseaux sociaux... **Version incluse :** 0.12.2~ynh1 From 37d96ed38182ea5d98fa4e3f033918facf15476c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Wed, 15 Nov 2023 13:32:29 +0100 Subject: [PATCH 09/10] Update upgrade --- scripts/upgrade | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/scripts/upgrade b/scripts/upgrade index f574c9c..29c7413 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -24,26 +24,26 @@ then ynh_script_progression --message="Upgrading source files..." --weight=1 # Create a temporary directory - tmpdir="$(mktemp -d)" + #tmpdir="$(mktemp -d)" # Backup the config file in the temp dir - cp -a "$install_dir/data" "$tmpdir/data" - cp -a "$install_dir/tpl" "$tmpdir/tpl" + #cp -a "$install_dir/data" "$tmpdir/data" + #cp -a "$install_dir/tpl" "$tmpdir/tpl" # Download, check integrity, uncompress and patch the source from app.src - ynh_setup_source --dest_dir="$install_dir" + ynh_setup_source --dest_dir="$install_dir" --keep="data tpl" - cp -a "$tmpdir/data" "$install_dir/" - cp -a -n "$tmpdir/tpl" "$install_dir/" # copy without erasing existing templates (from official source) + #cp -a "$tmpdir/data" "$install_dir/" + #cp -a -n "$tmpdir/tpl" "$install_dir/" # copy without erasing existing templates (from official source) # Remove the tmp directory securely - ynh_secure_remove --file="$tmpdir" + #ynh_secure_remove --file="$tmpdir" fi chmod -R o-rwx "$install_dir" chmod -R u+rwX $install_dir/{cache/,data/,pagecache/,tmp/} chown -R $app:www-data "$install_dir" -chmod 700 "$install_dir/data/config.json.php" +#chmod 700 "$install_dir/data/config.json.php" #================================================= # REAPPLY SYSTEM CONFIGURATIONS From e6876618c7df95b46666929465fd877d51df92f5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Wed, 15 Nov 2023 13:35:43 +0100 Subject: [PATCH 10/10] Update manifest.toml --- manifest.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifest.toml b/manifest.toml index 82772ef..915ce7d 100644 --- a/manifest.toml +++ b/manifest.toml @@ -68,4 +68,4 @@ ram.runtime = "50M" main.url = "/" [resources.apt] - packages = "php8.2-cli, php8.2-gettext, php8.2-curl, php8.2-intl, php8.2-gd, php8.2-mbstring, php8.2-xml, php8.2-ldap" + packages = "php8.2-cli, php8.2-gettext, php8.2-curl, php8.2-intl, php8.2-gd, php8.2-mbstring, php8.2-simplexml, php8.2-ldap"