From 28d5a9691b30eed304e308d390467d5bbacfb9bb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Fri, 3 Feb 2023 18:33:29 +0100 Subject: [PATCH 01/27] v2 --- conf/systemd.service | 6 ++-- manifest.toml | 53 ++++++++++++++++++++++++++++++ scripts/_common.sh | 2 +- scripts/backup | 14 ++++---- scripts/install | 76 ++++++++++++++++++++++---------------------- scripts/remove | 20 ++++++------ scripts/restore | 48 ++++++++++++++-------------- scripts/upgrade | 42 ++++++++++++------------ 8 files changed, 157 insertions(+), 104 deletions(-) create mode 100644 manifest.toml diff --git a/conf/systemd.service b/conf/systemd.service index f12ad4a..1f0af37 100644 --- a/conf/systemd.service +++ b/conf/systemd.service @@ -7,10 +7,10 @@ After=network-online.target Type=simple User=__APP__ Group=__APP__ -WorkingDirectory=__FINALPATH__/ -ExecStart=__FINALPATH__/shiori serve --port __PORT__ --webroot __PATH__ +WorkingDirectory=__INSTALL_DIR__/ +ExecStart=__INSTALL_DIR__/shiori serve --port __PORT__ --webroot __PATH__ Restart=always -Environment="SHIORI_DIR=__DATADIR__" +Environment="SHIORI_DIR=__DATA_DIR__" # Sandboxing options to harden security # Depending on specificities of your service/app, you may need to tweak these diff --git a/manifest.toml b/manifest.toml new file mode 100644 index 0000000..340a721 --- /dev/null +++ b/manifest.toml @@ -0,0 +1,53 @@ +packaging_format = 2 + +id = "shiori" +name = "Shiori" +description.en = "Simple bookmark manager" +description.fr = "Gestionnaire de liens simple" + +version = "1.5.3~ynh6" + +maintainers = ["eric_G"] + +[upstream] +license = "MIT" +admindoc = "https://github.com/go-shiori/shiori/wiki" +userdoc = "https://github.com/go-shiori/shiori/wiki/Usage" +code = "https://github.com/go-shiori/shiori" +website = "https://github.com/go-shiori/shiori" +cpe = "???" # FIXME: optional but recommended if relevant, this is meant to contain the Common Platform Enumeration, which is sort of a standard id for applications defined by the NIST. In particular, Yunohost may use this is in the future to easily track CVE (=security reports) related to apps. The CPE may be obtained by searching here: https://nvd.nist.gov/products/cpe/search. For example, for Nextcloud, the CPE is 'cpe:2.3:a:nextcloud:nextcloud' (no need to include the version number) +fund = "???" # FIXME: optional but recommended (or remove if irrelevant / not applicable). This is meant to be an URL where people can financially support this app, especially when its development is based on volunteers and/or financed by its community. YunoHost may later advertise it in the webadmin. + +[integration] +yunohost = ">= 11.0.9" +architectures = "all" # FIXME: can be replaced by a list of supported archs using the dpkg --print-architecture nomenclature (amd64/i386/armhf/arm64), for example: ["amd64", "i386"] +multi_instance = true +ldap = "?" # FIXME: replace with true, false, or "not_relevant". Not to confuse with the "sso" key : the "ldap" key corresponds to wether or not a user *can* login on the app using its YunoHost credentials. +sso = "?" # FIXME: replace with true, false, or "not_relevant". Not to confuse with the "ldap" key : the "sso" key corresponds to wether or not a user is *automatically logged-in* on the app when logged-in on the YunoHost portal. +disk = "50M" # FIXME: replace with an **estimate** minimum disk requirement. e.g. 20M, 400M, 1G, ... +ram.build = "50M" # FIXME: replace with an **estimate** minimum ram requirement. e.g. 50M, 400M, 1G, ... +ram.runtime = "50M" # FIXME: replace with an **estimate** minimum ram requirement. e.g. 50M, 400M, 1G, ... + +[install] + [install.domain] + # this is a generic question - ask strings are automatically handled by Yunohost's core + type = "domain" + + [install.path] + # this is a generic question - ask strings are automatically handled by Yunohost's core + type = "path" + default = "/shiori" + + [install.init_main_permission] + type = "group" + default = "visitors" + +[resources] + [resources.system_user] + + [resources.install_dir] + + [resources.data_dir] + + [resources.permissions] + main.url = "/" diff --git a/scripts/_common.sh b/scripts/_common.sh index 6a48f17..f0a867d 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -5,7 +5,7 @@ #================================================= # dependencies used by the app -pkg_dependencies="sqlite3" +#REMOVEME? pkg_dependencies="sqlite3" #================================================= # PERSONAL HELPERS diff --git a/scripts/backup b/scripts/backup index bf59418..644b6ec 100755 --- a/scripts/backup +++ b/scripts/backup @@ -15,18 +15,18 @@ source /usr/share/yunohost/helpers #================================================= # Exit if an error occurs during the execution of the script -ynh_abort_if_errors +#REMOVEME? ynh_abort_if_errors #================================================= # LOAD SETTINGS #================================================= -ynh_print_info --message="Loading installation settings..." +#REMOVEME? ynh_print_info --message="Loading installation settings..." -app=$YNH_APP_INSTANCE_NAME +#REMOVEME? app=$YNH_APP_INSTANCE_NAME -final_path=$(ynh_app_setting_get --app=$app --key=final_path) -domain=$(ynh_app_setting_get --app=$app --key=domain) -datadir=$(ynh_app_setting_get --app=$app --key=datadir) +#REMOVEME? #REMOVEME? install_dir=$(ynh_app_setting_get --app=$app --key=install_dir) +#REMOVEME? domain=$(ynh_app_setting_get --app=$app --key=domain) +#REMOVEME? data_dir=$(ynh_app_setting_get --app=$app --key=data_dir) #================================================= # DECLARE DATA AND CONF FILES TO BACKUP @@ -37,7 +37,7 @@ ynh_print_info --message="Declaring files to be backed up..." # BACKUP THE APP MAIN DIR #================================================= -ynh_backup --src_path="$final_path" +ynh_backup --src_path="$install_dir" #================================================= # BACKUP THE NGINX CONFIGURATION diff --git a/scripts/install b/scripts/install index 1b24a66..5ea75ab 100755 --- a/scripts/install +++ b/scripts/install @@ -14,69 +14,69 @@ source /usr/share/yunohost/helpers #================================================= # Exit if an error occurs during the execution of the script -ynh_abort_if_errors +#REMOVEME? ynh_abort_if_errors #================================================= # RETRIEVE ARGUMENTS FROM THE MANIFEST #================================================= -domain=$YNH_APP_ARG_DOMAIN -path_url=$YNH_APP_ARG_PATH -is_public=$YNH_APP_ARG_IS_PUBLIC +#REMOVEME? domain=$YNH_APP_ARG_DOMAIN +#REMOVEME? path=$YNH_APP_ARG_PATH +#REMOVEME? is_public=$YNH_APP_ARG_IS_PUBLIC -app=$YNH_APP_INSTANCE_NAME +#REMOVEME? app=$YNH_APP_INSTANCE_NAME #================================================= # CHECK IF THE APP CAN BE INSTALLED WITH THESE ARGS #================================================= -ynh_script_progression --message="Validating installation parameters..." --weight=1 +#REMOVEME? ynh_script_progression --message="Validating installation parameters..." --weight=1 -final_path=/var/www/$app -test ! -e "$final_path" || ynh_die --message="This path already contains a folder" +#REMOVEME? install_dir=/var/www/$app +#REMOVEME? test ! -e "$install_dir" || ynh_die --message="This path already contains a folder" # Register (book) web path -ynh_webpath_register --app=$app --domain=$domain --path_url=$path_url +#REMOVEME? ynh_webpath_register --app=$app --domain=$domain --path=$path #================================================= # STORE SETTINGS FROM MANIFEST #================================================= -ynh_script_progression --message="Storing installation settings..." --weight=1 +#REMOVEME? 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 +#REMOVEME? ynh_app_setting_set --app=$app --key=domain --value=$domain +#REMOVEME? ynh_app_setting_set --app=$app --key=path --value=$path #================================================= # STANDARD MODIFICATIONS #================================================= # FIND AND OPEN A PORT #================================================= -ynh_script_progression --message="Finding an available port..." --weight=1 +#REMOVEME? ynh_script_progression --message="Finding an available port..." --weight=1 # Find an available port -port=$(ynh_find_port --port=8095) -ynh_app_setting_set --app=$app --key=port --value=$port +#REMOVEME? port=$(ynh_find_port --port=8095) +#REMOVEME? ynh_app_setting_set --app=$app --key=port --value=$port #================================================= # CREATE DEDICATED USER #================================================= -ynh_script_progression --message="Configuring system user..." --weight=1 +#REMOVEME? ynh_script_progression --message="Configuring system user..." --weight=1 # Create a system user -ynh_system_user_create --username=$app --home_dir="$final_path" +#REMOVEME? ynh_system_user_create --username=$app --home_dir="$install_dir" #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE #================================================= ynh_script_progression --message="Setting up source files..." --weight=1 -ynh_app_setting_set --app=$app --key=final_path --value=$final_path +#REMOVEME? ynh_app_setting_set --app=$app --key=install_dir --value=$install_dir # Download, check integrity, uncompress and patch the source from app.src -ynh_setup_source --dest_dir="$final_path" --source_id=$YNH_ARCH +ynh_setup_source --dest_dir="$install_dir" --source_id=$YNH_ARCH -chmod 750 "$final_path" -chmod -R o-rwx "$final_path" -chown -R $app:www-data "$final_path" -chmod +x "$final_path/shiori" +chmod 750 "$install_dir" +chmod -R o-rwx "$install_dir" +chown -R $app:www-data "$install_dir" +chmod +x "$install_dir/shiori" #================================================= # NGINX CONFIGURATION @@ -91,20 +91,20 @@ ynh_add_nginx_config #================================================= ynh_script_progression --message="Creating a data directory..." --weight=1 -datadir=/home/yunohost.app/$app -ynh_app_setting_set --app=$app --key=datadir --value=$datadir +#REMOVEME? data_dir=/home/yunohost.app/$app +#REMOVEME? ynh_app_setting_set --app=$app --key=data_dir --value=$data_dir -mkdir -p $datadir +mkdir -p $data_dir -chmod 750 "$datadir" -chmod -R o-rwx "$datadir" -chown -R $app:www-data "$datadir" +chmod 750 "$data_dir" +chmod -R o-rwx "$data_dir" +chown -R $app:www-data "$data_dir" # Run migrate for new install go-shiori/shiori#447 -#pushd $final_path/ -# ynh_exec_as $app $final_path/shiori --portable migrate -# ynh_exec_as $app mv shiori-data/shiori.db $datadir -# ynh_secure_remove --file=$final_path/shiori-data +#pushd $install_dir/ +# ynh_exec_as $app $install_dir/shiori --portable migrate +# ynh_exec_as $app mv shiori-data/shiori.db $data_dir +#REMOVEME? # ynh_secure_remove --file=$install_dir/shiori-data #popd #================================================= @@ -148,20 +148,20 @@ ynh_systemd_action --service_name=$app --action="start" --log_path="systemd" #================================================= # SETUP SSOWAT #================================================= -ynh_script_progression --message="Configuring permissions..." --weight=1 +#REMOVEME? ynh_script_progression --message="Configuring permissions..." --weight=1 # Make app public if necessary -if [ $is_public -eq 1 ] +#REMOVEME? if [ $is_public -eq 1 ] then - ynh_permission_update --permission="main" --add="visitors" +#REMOVEME? ynh_permission_update --permission="main" --add="visitors" fi #================================================= # RELOAD NGINX #================================================= -ynh_script_progression --message="Reloading NGINX web server..." --weight=1 +#REMOVEME? ynh_script_progression --message="Reloading NGINX web server..." --weight=1 -ynh_systemd_action --service_name=nginx --action=reload +#REMOVEME? ynh_systemd_action --service_name=nginx --action=reload #================================================= # END OF SCRIPT diff --git a/scripts/remove b/scripts/remove index 6a8e2fd..6fe741d 100755 --- a/scripts/remove +++ b/scripts/remove @@ -12,13 +12,13 @@ source /usr/share/yunohost/helpers #================================================= # LOAD SETTINGS #================================================= -ynh_script_progression --message="Loading installation settings..." --weight=1 +#REMOVEME? ynh_script_progression --message="Loading installation settings..." --weight=1 -app=$YNH_APP_INSTANCE_NAME +#REMOVEME? app=$YNH_APP_INSTANCE_NAME -domain=$(ynh_app_setting_get --app=$app --key=domain) -final_path=$(ynh_app_setting_get --app=$app --key=final_path) -datadir=$(ynh_app_setting_get --app=$app --key=datadir) +#REMOVEME? domain=$(ynh_app_setting_get --app=$app --key=domain) +#REMOVEME? #REMOVEME? install_dir=$(ynh_app_setting_get --app=$app --key=install_dir) +#REMOVEME? data_dir=$(ynh_app_setting_get --app=$app --key=data_dir) #================================================= # STANDARD REMOVE @@ -54,10 +54,10 @@ ynh_remove_logrotate #================================================= # REMOVE APP MAIN DIR #================================================= -ynh_script_progression --message="Removing app main directory..." --weight=1 +#REMOVEME? ynh_script_progression --message="Removing app main directory..." --weight=1 # Remove the app directory securely -ynh_secure_remove --file="$final_path" +#REMOVEME? ynh_secure_remove --file="$install_dir" #================================================= # REMOVE DATA DIR @@ -67,7 +67,7 @@ ynh_secure_remove --file="$final_path" if [ "${YNH_APP_PURGE:-0}" -eq 1 ] then ynh_script_progression --message="Removing app data directory..." --weight=1 - ynh_secure_remove --file="$datadir" +#REMOVEME? ynh_secure_remove --file="$data_dir" fi #================================================= @@ -83,10 +83,10 @@ ynh_remove_nginx_config #================================================= # REMOVE DEDICATED USER #================================================= -ynh_script_progression --message="Removing the dedicated system user..." --weight=1 +#REMOVEME? ynh_script_progression --message="Removing the dedicated system user..." --weight=1 # Delete a system user -ynh_system_user_delete --username=$app +#REMOVEME? ynh_system_user_delete --username=$app #================================================= # END OF SCRIPT diff --git a/scripts/restore b/scripts/restore index eafc2d7..d5600a5 100755 --- a/scripts/restore +++ b/scripts/restore @@ -15,27 +15,27 @@ source /usr/share/yunohost/helpers #================================================= # Exit if an error occurs during the execution of the script -ynh_abort_if_errors +#REMOVEME? ynh_abort_if_errors #================================================= # LOAD SETTINGS #================================================= -ynh_script_progression --message="Loading installation settings..." --weight=1 +#REMOVEME? ynh_script_progression --message="Loading installation settings..." --weight=1 -app=$YNH_APP_INSTANCE_NAME +#REMOVEME? app=$YNH_APP_INSTANCE_NAME -domain=$(ynh_app_setting_get --app=$app --key=domain) -path_url=$(ynh_app_setting_get --app=$app --key=path) -final_path=$(ynh_app_setting_get --app=$app --key=final_path) -datadir=$(ynh_app_setting_get --app=$app --key=datadir) +#REMOVEME? domain=$(ynh_app_setting_get --app=$app --key=domain) +#REMOVEME? path=$(ynh_app_setting_get --app=$app --key=path) +#REMOVEME? #REMOVEME? install_dir=$(ynh_app_setting_get --app=$app --key=install_dir) +#REMOVEME? data_dir=$(ynh_app_setting_get --app=$app --key=data_dir) #================================================= # CHECK IF THE APP CAN BE RESTORED #================================================= -ynh_script_progression --message="Validating restoration parameters..." --weight=1 +#REMOVEME? ynh_script_progression --message="Validating restoration parameters..." --weight=1 -test ! -d $final_path \ - || ynh_die --message="There is already a directory: $final_path" +#REMOVEME? test ! -d $install_dir \ + || ynh_die --message="There is already a directory: $install_dir" #================================================= # STANDARD RESTORATION STEPS @@ -49,45 +49,45 @@ 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..." --weight=1 +#REMOVEME? 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" +#REMOVEME? ynh_system_user_create --username=$app --home_dir="$install_dir" #================================================= # RESTORE THE APP MAIN DIR #================================================= ynh_script_progression --message="Restoring the app main directory..." --weight=1 -ynh_restore_file --origin_path="$final_path" +ynh_restore_file --origin_path="$install_dir" -chmod 750 "$final_path" -chmod -R o-rwx "$final_path" -chown -R $app:www-data "$final_path" -chmod +x "$final_path/shiori" +chmod 750 "$install_dir" +chmod -R o-rwx "$install_dir" +chown -R $app:www-data "$install_dir" +chmod +x "$install_dir/shiori" #================================================= # RESTORE THE DATA DIRECTORY #================================================= ynh_script_progression --message="Restoring the data directory..." --weight=1 -ynh_restore_file --origin_path="$datadir" --not_mandatory +ynh_restore_file --origin_path="$data_dir" --not_mandatory -mkdir -p $datadir +mkdir -p $data_dir -chmod 750 "$datadir" -chmod -R o-rwx "$datadir" -chown -R $app:www-data "$datadir" +chmod 750 "$data_dir" +chmod -R o-rwx "$data_dir" +chown -R $app:www-data "$data_dir" #================================================= # SPECIFIC RESTORATION #================================================= # REINSTALL DEPENDENCIES #================================================= -ynh_script_progression --message="Reinstalling dependencies..." --weight=1 +#REMOVEME? ynh_script_progression --message="Reinstalling dependencies..." --weight=1 # Define and install dependencies -ynh_install_app_dependencies $pkg_dependencies +#REMOVEME? ynh_install_app_dependencies $pkg_dependencies #================================================= # RESTORE SYSTEMD diff --git a/scripts/upgrade b/scripts/upgrade index d1a336b..267abcf 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -12,15 +12,15 @@ source /usr/share/yunohost/helpers #================================================= # LOAD SETTINGS #================================================= -ynh_script_progression --message="Loading installation settings..." --weight=1 +#REMOVEME? ynh_script_progression --message="Loading installation settings..." --weight=1 -app=$YNH_APP_INSTANCE_NAME +#REMOVEME? app=$YNH_APP_INSTANCE_NAME -domain=$(ynh_app_setting_get --app=$app --key=domain) -path_url=$(ynh_app_setting_get --app=$app --key=path) -port=$(ynh_app_setting_get --app=$app --key=port) -final_path=$(ynh_app_setting_get --app=$app --key=final_path) -datadir=$(ynh_app_setting_get --app=$app --key=datadir) +#REMOVEME? domain=$(ynh_app_setting_get --app=$app --key=domain) +#REMOVEME? path=$(ynh_app_setting_get --app=$app --key=path) +#REMOVEME? port=$(ynh_app_setting_get --app=$app --key=port) +#REMOVEME? #REMOVEME? install_dir=$(ynh_app_setting_get --app=$app --key=install_dir) +#REMOVEME? data_dir=$(ynh_app_setting_get --app=$app --key=data_dir) #================================================= # CHECK VERSION @@ -31,16 +31,16 @@ 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)..." --weight=1 +#REMOVEME? 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 -ynh_clean_setup () { +#REMOVEME? ynh_backup_before_upgrade +#REMOVEME? ynh_clean_setup () { # Restore it if the upgrade fails - ynh_restore_upgradebackup +#REMOVEME? ynh_restore_upgradebackup } # Exit if an error occurs during the execution of the script -ynh_abort_if_errors +#REMOVEME? ynh_abort_if_errors #================================================= # STANDARD UPGRADE STEPS @@ -54,10 +54,10 @@ ynh_systemd_action --service_name=$app --action="stop" --log_path="systemd" #================================================= # CREATE DEDICATED USER #================================================= -ynh_script_progression --message="Making sure dedicated system user exists..." --weight=1 +#REMOVEME? 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" +#REMOVEME? ynh_system_user_create --username=$app --home_dir="$install_dir" #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE @@ -68,13 +68,13 @@ then 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" --source_id=$YNH_ARCH + ynh_setup_source --dest_dir="$install_dir" --source_id=$YNH_ARCH fi -chmod 750 "$final_path" -chmod -R o-rwx "$final_path" -chown -R $app:www-data "$final_path" -chmod +x "$final_path/shiori" +chmod 750 "$install_dir" +chmod -R o-rwx "$install_dir" +chown -R $app:www-data "$install_dir" +chmod +x "$install_dir/shiori" #================================================= # NGINX CONFIGURATION @@ -119,9 +119,9 @@ ynh_systemd_action --service_name=$app --action="start" --log_path="systemd" #================================================= # RELOAD NGINX #================================================= -ynh_script_progression --message="Reloading NGINX web server..." --weight=1 +#REMOVEME? ynh_script_progression --message="Reloading NGINX web server..." --weight=1 -ynh_systemd_action --service_name=nginx --action=reload +#REMOVEME? ynh_systemd_action --service_name=nginx --action=reload #================================================= # END OF SCRIPT From ad7ae9dfd73829288ae32d46aba09b1efdd940c3 Mon Sep 17 00:00:00 2001 From: yunohost-bot Date: Fri, 3 Feb 2023 17:33:34 +0000 Subject: [PATCH 02/27] Auto-update README --- README.md | 2 +- README_fr.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 857b421..f192597 100644 --- a/README.md +++ b/README.md @@ -27,7 +27,7 @@ Shiori is a simple bookmarks manager written in Go language. Intended as a simpl - Where possible, by default shiori will download a static copy of the webpage in simple text and HTML format, which later can be used as an offline archive for that page. -**Shipped version:** 1.5.3~ynh5 +**Shipped version:** 1.5.3~ynh6 ## Screenshots diff --git a/README_fr.md b/README_fr.md index bed83e8..cd8556a 100644 --- a/README_fr.md +++ b/README_fr.md @@ -27,7 +27,7 @@ Shiori is a simple bookmarks manager written in Go language. Intended as a simpl - Where possible, by default shiori will download a static copy of the webpage in simple text and HTML format, which later can be used as an offline archive for that page. -**Version incluse :** 1.5.3~ynh5 +**Version incluse :** 1.5.3~ynh6 ## Captures d’écran From 4258ac1ce67ba4e9ee26fadfd96da11f6e0bfba9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Fri, 3 Feb 2023 18:40:56 +0100 Subject: [PATCH 03/27] Fix --- doc/DISCLAIMER.md | 10 ---------- doc/notifications/POST_INSTALL.md | 4 ++++ doc/notifications/PRE_INSTALL.md | 0 tests.toml | 0 4 files changed, 4 insertions(+), 10 deletions(-) delete mode 100644 doc/DISCLAIMER.md create mode 100644 doc/notifications/POST_INSTALL.md create mode 100644 doc/notifications/PRE_INSTALL.md create mode 100644 tests.toml diff --git a/doc/DISCLAIMER.md b/doc/DISCLAIMER.md deleted file mode 100644 index 7731833..0000000 --- a/doc/DISCLAIMER.md +++ /dev/null @@ -1,10 +0,0 @@ -### First log in - -The default account is `shiori` with password `gopher`. It is removed once another 'owner' account is created. - -- username: `shiori` -- password: `gopher` - -### Shiori Web Extension - -[Shiori Web Extension](https://github.com/go-shiori/shiori-web-ext) is a simple extension for managing bookmarks using Shiori. This extension is intended to integrate Shiori with your favorite web browser. This way, you can save and remove bookmarks in Shiori without switching from your current page. diff --git a/doc/notifications/POST_INSTALL.md b/doc/notifications/POST_INSTALL.md new file mode 100644 index 0000000..fe5a180 --- /dev/null +++ b/doc/notifications/POST_INSTALL.md @@ -0,0 +1,4 @@ +The default account is `shiori` with password `gopher`. It is removed once another 'owner' account is created. + +- username: `shiori` +- password: `gopher` \ No newline at end of file diff --git a/doc/notifications/PRE_INSTALL.md b/doc/notifications/PRE_INSTALL.md new file mode 100644 index 0000000..e69de29 diff --git a/tests.toml b/tests.toml new file mode 100644 index 0000000..e69de29 From 0dcc8c7e90ad75a366f01c11e577e766c2c70385 Mon Sep 17 00:00:00 2001 From: yunohost-bot Date: Fri, 3 Feb 2023 17:41:05 +0000 Subject: [PATCH 04/27] Auto-update README --- README.md | 13 ------------- README_fr.md | 13 ------------- 2 files changed, 26 deletions(-) diff --git a/README.md b/README.md index f192597..5ea1f86 100644 --- a/README.md +++ b/README.md @@ -33,19 +33,6 @@ Shiori is a simple bookmarks manager written in Go language. Intended as a simpl ![Screenshot of Shiori](./doc/screenshots/screenshot.png) -## Disclaimers / important information - -### First log in - -The default account is `shiori` with password `gopher`. It is removed once another 'owner' account is created. - -- username: `shiori` -- password: `gopher` - -### Shiori Web Extension - -[Shiori Web Extension](https://github.com/go-shiori/shiori-web-ext) is a simple extension for managing bookmarks using Shiori. This extension is intended to integrate Shiori with your favorite web browser. This way, you can save and remove bookmarks in Shiori without switching from your current page. - ## Documentation and resources * Official user documentation: diff --git a/README_fr.md b/README_fr.md index cd8556a..c2d89c9 100644 --- a/README_fr.md +++ b/README_fr.md @@ -33,19 +33,6 @@ Shiori is a simple bookmarks manager written in Go language. Intended as a simpl ![Capture d’écran de Shiori](./doc/screenshots/screenshot.png) -## Avertissements / informations importantes - -### First log in - -The default account is `shiori` with password `gopher`. It is removed once another 'owner' account is created. - -- username: `shiori` -- password: `gopher` - -### Shiori Web Extension - -[Shiori Web Extension](https://github.com/go-shiori/shiori-web-ext) is a simple extension for managing bookmarks using Shiori. This extension is intended to integrate Shiori with your favorite web browser. This way, you can save and remove bookmarks in Shiori without switching from your current page. - ## Documentations et ressources * Documentation officielle utilisateur : From 9d66b1e78d28ec8f0af8214521837c6156a4e587 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Fri, 3 Feb 2023 18:42:14 +0100 Subject: [PATCH 05/27] Update tests.toml --- tests.toml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tests.toml b/tests.toml index e69de29..a5fab88 100644 --- a/tests.toml +++ b/tests.toml @@ -0,0 +1,9 @@ +test_format = 1.0 + +[default] + + # ------------------------------- + # Commits to test upgrade from + # ------------------------------- + + test_upgrade_from.d653976.name = "Upgrade from 23.01" From 1f934380a59a2386cb1ce1f93cb2e89110df4fdd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Fri, 3 Feb 2023 18:44:07 +0100 Subject: [PATCH 06/27] Update manifest.toml --- manifest.toml | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/manifest.toml b/manifest.toml index 340a721..111c1b8 100644 --- a/manifest.toml +++ b/manifest.toml @@ -15,26 +15,22 @@ admindoc = "https://github.com/go-shiori/shiori/wiki" userdoc = "https://github.com/go-shiori/shiori/wiki/Usage" code = "https://github.com/go-shiori/shiori" website = "https://github.com/go-shiori/shiori" -cpe = "???" # FIXME: optional but recommended if relevant, this is meant to contain the Common Platform Enumeration, which is sort of a standard id for applications defined by the NIST. In particular, Yunohost may use this is in the future to easily track CVE (=security reports) related to apps. The CPE may be obtained by searching here: https://nvd.nist.gov/products/cpe/search. For example, for Nextcloud, the CPE is 'cpe:2.3:a:nextcloud:nextcloud' (no need to include the version number) -fund = "???" # FIXME: optional but recommended (or remove if irrelevant / not applicable). This is meant to be an URL where people can financially support this app, especially when its development is based on volunteers and/or financed by its community. YunoHost may later advertise it in the webadmin. [integration] yunohost = ">= 11.0.9" -architectures = "all" # FIXME: can be replaced by a list of supported archs using the dpkg --print-architecture nomenclature (amd64/i386/armhf/arm64), for example: ["amd64", "i386"] +architectures = "all" multi_instance = true -ldap = "?" # FIXME: replace with true, false, or "not_relevant". Not to confuse with the "sso" key : the "ldap" key corresponds to wether or not a user *can* login on the app using its YunoHost credentials. -sso = "?" # FIXME: replace with true, false, or "not_relevant". Not to confuse with the "ldap" key : the "sso" key corresponds to wether or not a user is *automatically logged-in* on the app when logged-in on the YunoHost portal. -disk = "50M" # FIXME: replace with an **estimate** minimum disk requirement. e.g. 20M, 400M, 1G, ... -ram.build = "50M" # FIXME: replace with an **estimate** minimum ram requirement. e.g. 50M, 400M, 1G, ... -ram.runtime = "50M" # FIXME: replace with an **estimate** minimum ram requirement. e.g. 50M, 400M, 1G, ... +ldap = "not_relevant" +sso = "not_relevant" +disk = "50M" +ram.build = "50M" +ram.runtime = "50M" [install] [install.domain] - # this is a generic question - ask strings are automatically handled by Yunohost's core type = "domain" [install.path] - # this is a generic question - ask strings are automatically handled by Yunohost's core type = "path" default = "/shiori" From 1ba8cc9141fe1225a5fe3cf97cceb72d92fb53c3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Fri, 3 Feb 2023 18:44:38 +0100 Subject: [PATCH 07/27] Fix --- check_process | 25 ------------------------- manifest.json | 48 ------------------------------------------------ 2 files changed, 73 deletions(-) delete mode 100644 check_process delete mode 100644 manifest.json diff --git a/check_process b/check_process deleted file mode 100644 index 326d831..0000000 --- a/check_process +++ /dev/null @@ -1,25 +0,0 @@ -;; Test complet - ; Manifest - domain="domain.tld" - path="/path" - is_public=1 - ; Checks - pkg_linter=1 - setup_sub_dir=1 - setup_root=1 - setup_nourl=0 - setup_private=1 - setup_public=1 - upgrade=1 - #1.5.0~ynh3 - #upgrade=1 from_commit=5887398434a96643fba4598b6864d78f4d6505ce - backup_restore=1 - multi_instance=1 - change_url=1 -;;; Options -Email= -Notification=none -;;; Upgrade options - ; commit=5887398434a96643fba4598b6864d78f4d6505ce - name=Merge pull request #5 from YunoHost-Apps/testing - manifest_arg=domain=DOMAIN&path=PATH&admin=USER&language=fr&is_public=1&password=pass&port=666& diff --git a/manifest.json b/manifest.json deleted file mode 100644 index 8d4fea0..0000000 --- a/manifest.json +++ /dev/null @@ -1,48 +0,0 @@ -{ - "name": "Shiori", - "id": "shiori", - "packaging_format": 1, - "description": { - "en": "Simple bookmark manager", - "fr": "Gestionnaire de liens simple" - }, - "version": "1.5.3~ynh6", - "url": "https://github.com/go-shiori/shiori", - "upstream": { - "license": "MIT", - "admindoc": "https://github.com/go-shiori/shiori/wiki", - "userdoc": "https://github.com/go-shiori/shiori/wiki/Usage", - "code": "https://github.com/go-shiori/shiori" - }, - "license": "MIT", - "maintainer": { - "name": "eric_G", - "email": "" - }, - "requirements": { - "yunohost": ">= 11.0.9" - }, - "multi_instance": true, - "services": [ - "nginx" - ], - "arguments": { - "install" : [ - { - "name": "domain", - "type": "domain" - }, - { - "name": "path", - "type": "path", - "example": "/shiori", - "default": "/shiori" - }, - { - "name": "is_public", - "type": "boolean", - "default": true - } - ] - } -} From 44fdbf7c41455049b031332b25647b965bca68df Mon Sep 17 00:00:00 2001 From: yunohost-bot Date: Fri, 3 Feb 2023 17:44:43 +0000 Subject: [PATCH 08/27] Auto-update README --- README.md | 1 + README_fr.md | 1 + 2 files changed, 2 insertions(+) diff --git a/README.md b/README.md index 5ea1f86..ac66638 100644 --- a/README.md +++ b/README.md @@ -35,6 +35,7 @@ Shiori is a simple bookmarks manager written in Go language. Intended as a simpl ## Documentation and resources +* Official app website: * Official user documentation: * Official admin documentation: * Upstream app code repository: diff --git a/README_fr.md b/README_fr.md index c2d89c9..abf1a5a 100644 --- a/README_fr.md +++ b/README_fr.md @@ -35,6 +35,7 @@ Shiori is a simple bookmarks manager written in Go language. Intended as a simpl ## Documentations et ressources +* Site officiel de l’app : * Documentation officielle utilisateur : * Documentation officielle de l’admin : * Dépôt de code officiel de l’app : From 26d664fc83da2b5ef0efaa19838cfa2d0167bbc5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Fri, 3 Feb 2023 18:46:03 +0100 Subject: [PATCH 09/27] Update tests.toml --- tests.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests.toml b/tests.toml index a5fab88..50116cb 100644 --- a/tests.toml +++ b/tests.toml @@ -6,4 +6,4 @@ test_format = 1.0 # Commits to test upgrade from # ------------------------------- - test_upgrade_from.d653976.name = "Upgrade from 23.01" + test_upgrade_from.787885e7.name = "Upgrade from 1.5.4" \ No newline at end of file From 14eb24f9054d743c8d3132ec03340b2ea5543af1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Fri, 3 Feb 2023 18:52:19 +0100 Subject: [PATCH 10/27] Fix --- scripts/backup | 18 ---------- scripts/install | 95 ------------------------------------------------- scripts/restore | 45 ----------------------- scripts/upgrade | 42 ---------------------- 4 files changed, 200 deletions(-) diff --git a/scripts/backup b/scripts/backup index 644b6ec..737146f 100755 --- a/scripts/backup +++ b/scripts/backup @@ -10,24 +10,6 @@ source ../settings/scripts/_common.sh source /usr/share/yunohost/helpers -#================================================= -# MANAGE SCRIPT FAILURE -#================================================= - -# Exit if an error occurs during the execution of the script -#REMOVEME? ynh_abort_if_errors - -#================================================= -# LOAD SETTINGS -#================================================= -#REMOVEME? ynh_print_info --message="Loading installation settings..." - -#REMOVEME? app=$YNH_APP_INSTANCE_NAME - -#REMOVEME? #REMOVEME? install_dir=$(ynh_app_setting_get --app=$app --key=install_dir) -#REMOVEME? domain=$(ynh_app_setting_get --app=$app --key=domain) -#REMOVEME? data_dir=$(ynh_app_setting_get --app=$app --key=data_dir) - #================================================= # DECLARE DATA AND CONF FILES TO BACKUP #================================================= diff --git a/scripts/install b/scripts/install index 5ea75ab..ff59092 100755 --- a/scripts/install +++ b/scripts/install @@ -9,67 +9,11 @@ source _common.sh source /usr/share/yunohost/helpers -#================================================= -# MANAGE SCRIPT FAILURE -#================================================= - -# Exit if an error occurs during the execution of the script -#REMOVEME? ynh_abort_if_errors - -#================================================= -# RETRIEVE ARGUMENTS FROM THE MANIFEST -#================================================= - -#REMOVEME? domain=$YNH_APP_ARG_DOMAIN -#REMOVEME? path=$YNH_APP_ARG_PATH -#REMOVEME? is_public=$YNH_APP_ARG_IS_PUBLIC - -#REMOVEME? app=$YNH_APP_INSTANCE_NAME - -#================================================= -# CHECK IF THE APP CAN BE INSTALLED WITH THESE ARGS -#================================================= -#REMOVEME? ynh_script_progression --message="Validating installation parameters..." --weight=1 - -#REMOVEME? install_dir=/var/www/$app -#REMOVEME? test ! -e "$install_dir" || ynh_die --message="This path already contains a folder" - -# Register (book) web path -#REMOVEME? ynh_webpath_register --app=$app --domain=$domain --path=$path - -#================================================= -# STORE SETTINGS FROM MANIFEST -#================================================= -#REMOVEME? ynh_script_progression --message="Storing installation settings..." --weight=1 - -#REMOVEME? ynh_app_setting_set --app=$app --key=domain --value=$domain -#REMOVEME? ynh_app_setting_set --app=$app --key=path --value=$path - -#================================================= -# STANDARD MODIFICATIONS -#================================================= -# FIND AND OPEN A PORT -#================================================= -#REMOVEME? ynh_script_progression --message="Finding an available port..." --weight=1 - -# Find an available port -#REMOVEME? port=$(ynh_find_port --port=8095) -#REMOVEME? ynh_app_setting_set --app=$app --key=port --value=$port - -#================================================= -# CREATE DEDICATED USER -#================================================= -#REMOVEME? ynh_script_progression --message="Configuring system user..." --weight=1 - -# Create a system user -#REMOVEME? ynh_system_user_create --username=$app --home_dir="$install_dir" - #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE #================================================= ynh_script_progression --message="Setting up source files..." --weight=1 -#REMOVEME? ynh_app_setting_set --app=$app --key=install_dir --value=$install_dir # Download, check integrity, uncompress and patch the source from app.src ynh_setup_source --dest_dir="$install_dir" --source_id=$YNH_ARCH @@ -86,27 +30,6 @@ ynh_script_progression --message="Configuring NGINX web server..." --weight=1 # Create a dedicated NGINX config ynh_add_nginx_config -#================================================= -# CREATE DATA DIRECTORY -#================================================= -ynh_script_progression --message="Creating a data directory..." --weight=1 - -#REMOVEME? data_dir=/home/yunohost.app/$app -#REMOVEME? ynh_app_setting_set --app=$app --key=data_dir --value=$data_dir - -mkdir -p $data_dir - -chmod 750 "$data_dir" -chmod -R o-rwx "$data_dir" -chown -R $app:www-data "$data_dir" - -# Run migrate for new install go-shiori/shiori#447 -#pushd $install_dir/ -# ynh_exec_as $app $install_dir/shiori --portable migrate -# ynh_exec_as $app mv shiori-data/shiori.db $data_dir -#REMOVEME? # ynh_secure_remove --file=$install_dir/shiori-data -#popd - #================================================= # SETUP SYSTEMD #================================================= @@ -145,24 +68,6 @@ ynh_script_progression --message="Starting a systemd service..." --weight=1 # Start a systemd service ynh_systemd_action --service_name=$app --action="start" --log_path="systemd" -#================================================= -# SETUP SSOWAT -#================================================= -#REMOVEME? ynh_script_progression --message="Configuring permissions..." --weight=1 - -# Make app public if necessary -#REMOVEME? if [ $is_public -eq 1 ] -then -#REMOVEME? ynh_permission_update --permission="main" --add="visitors" -fi - -#================================================= -# RELOAD NGINX -#================================================= -#REMOVEME? ynh_script_progression --message="Reloading NGINX web server..." --weight=1 - -#REMOVEME? ynh_systemd_action --service_name=nginx --action=reload - #================================================= # END OF SCRIPT #================================================= diff --git a/scripts/restore b/scripts/restore index d5600a5..1bda66d 100755 --- a/scripts/restore +++ b/scripts/restore @@ -10,33 +10,6 @@ source ../settings/scripts/_common.sh source /usr/share/yunohost/helpers -#================================================= -# MANAGE SCRIPT FAILURE -#================================================= - -# Exit if an error occurs during the execution of the script -#REMOVEME? ynh_abort_if_errors - -#================================================= -# LOAD SETTINGS -#================================================= -#REMOVEME? ynh_script_progression --message="Loading installation settings..." --weight=1 - -#REMOVEME? app=$YNH_APP_INSTANCE_NAME - -#REMOVEME? domain=$(ynh_app_setting_get --app=$app --key=domain) -#REMOVEME? path=$(ynh_app_setting_get --app=$app --key=path) -#REMOVEME? #REMOVEME? install_dir=$(ynh_app_setting_get --app=$app --key=install_dir) -#REMOVEME? data_dir=$(ynh_app_setting_get --app=$app --key=data_dir) - -#================================================= -# CHECK IF THE APP CAN BE RESTORED -#================================================= -#REMOVEME? ynh_script_progression --message="Validating restoration parameters..." --weight=1 - -#REMOVEME? test ! -d $install_dir \ - || ynh_die --message="There is already a directory: $install_dir" - #================================================= # STANDARD RESTORATION STEPS #================================================= @@ -46,14 +19,6 @@ ynh_script_progression --message="Restoring the NGINX configuration..." --weight ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf" -#================================================= -# RECREATE THE DEDICATED USER -#================================================= -#REMOVEME? ynh_script_progression --message="Recreating the dedicated system user..." --weight=1 - -# Create the dedicated user (if not existing) -#REMOVEME? ynh_system_user_create --username=$app --home_dir="$install_dir" - #================================================= # RESTORE THE APP MAIN DIR #================================================= @@ -79,16 +44,6 @@ chmod 750 "$data_dir" chmod -R o-rwx "$data_dir" chown -R $app:www-data "$data_dir" -#================================================= -# SPECIFIC RESTORATION -#================================================= -# REINSTALL DEPENDENCIES -#================================================= -#REMOVEME? ynh_script_progression --message="Reinstalling dependencies..." --weight=1 - -# Define and install dependencies -#REMOVEME? ynh_install_app_dependencies $pkg_dependencies - #================================================= # RESTORE SYSTEMD #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index 267abcf..8487e7d 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -9,39 +9,12 @@ source _common.sh source /usr/share/yunohost/helpers -#================================================= -# LOAD SETTINGS -#================================================= -#REMOVEME? ynh_script_progression --message="Loading installation settings..." --weight=1 - -#REMOVEME? app=$YNH_APP_INSTANCE_NAME - -#REMOVEME? domain=$(ynh_app_setting_get --app=$app --key=domain) -#REMOVEME? path=$(ynh_app_setting_get --app=$app --key=path) -#REMOVEME? port=$(ynh_app_setting_get --app=$app --key=port) -#REMOVEME? #REMOVEME? install_dir=$(ynh_app_setting_get --app=$app --key=install_dir) -#REMOVEME? data_dir=$(ynh_app_setting_get --app=$app --key=data_dir) - #================================================= # CHECK VERSION #================================================= upgrade_type=$(ynh_check_app_version_changed) -#================================================= -# BACKUP BEFORE UPGRADE THEN ACTIVE TRAP -#================================================= -#REMOVEME? ynh_script_progression --message="Backing up the app before upgrading (may take a while)..." --weight=1 - -# Backup the current version of the app -#REMOVEME? ynh_backup_before_upgrade -#REMOVEME? ynh_clean_setup () { - # Restore it if the upgrade fails -#REMOVEME? ynh_restore_upgradebackup -} -# Exit if an error occurs during the execution of the script -#REMOVEME? ynh_abort_if_errors - #================================================= # STANDARD UPGRADE STEPS #================================================= @@ -51,14 +24,6 @@ ynh_script_progression --message="Stopping a systemd service..." --weight=1 ynh_systemd_action --service_name=$app --action="stop" --log_path="systemd" -#================================================= -# CREATE DEDICATED USER -#================================================= -#REMOVEME? ynh_script_progression --message="Making sure dedicated system user exists..." --weight=1 - -# Create a dedicated user (if not existing) -#REMOVEME? ynh_system_user_create --username=$app --home_dir="$install_dir" - #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE #================================================= @@ -116,13 +81,6 @@ ynh_script_progression --message="Starting a systemd service..." --weight=1 ynh_systemd_action --service_name=$app --action="start" --log_path="systemd" -#================================================= -# RELOAD NGINX -#================================================= -#REMOVEME? ynh_script_progression --message="Reloading NGINX web server..." --weight=1 - -#REMOVEME? ynh_systemd_action --service_name=nginx --action=reload - #================================================= # END OF SCRIPT #================================================= From 20a513bf28867ac1a0acd18a5e074a976a0ca83c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Fri, 3 Feb 2023 18:52:32 +0100 Subject: [PATCH 11/27] Update remove --- scripts/remove | 40 ---------------------------------------- 1 file changed, 40 deletions(-) diff --git a/scripts/remove b/scripts/remove index 6fe741d..6b31155 100755 --- a/scripts/remove +++ b/scripts/remove @@ -9,17 +9,6 @@ source _common.sh source /usr/share/yunohost/helpers -#================================================= -# LOAD SETTINGS -#================================================= -#REMOVEME? ynh_script_progression --message="Loading installation settings..." --weight=1 - -#REMOVEME? app=$YNH_APP_INSTANCE_NAME - -#REMOVEME? domain=$(ynh_app_setting_get --app=$app --key=domain) -#REMOVEME? #REMOVEME? install_dir=$(ynh_app_setting_get --app=$app --key=install_dir) -#REMOVEME? data_dir=$(ynh_app_setting_get --app=$app --key=data_dir) - #================================================= # STANDARD REMOVE #================================================= @@ -51,25 +40,6 @@ ynh_secure_remove --file="/var/log/$app" # Remove the app-specific logrotate config ynh_remove_logrotate -#================================================= -# REMOVE APP MAIN DIR -#================================================= -#REMOVEME? ynh_script_progression --message="Removing app main directory..." --weight=1 - -# Remove the app directory securely -#REMOVEME? ynh_secure_remove --file="$install_dir" - -#================================================= -# REMOVE DATA DIR -#================================================= - -# 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..." --weight=1 -#REMOVEME? ynh_secure_remove --file="$data_dir" -fi - #================================================= # REMOVE NGINX CONFIGURATION #================================================= @@ -78,16 +48,6 @@ ynh_script_progression --message="Removing NGINX web server configuration..." -- # Remove the dedicated NGINX config ynh_remove_nginx_config -#================================================= -# GENERIC FINALIZATION -#================================================= -# REMOVE DEDICATED USER -#================================================= -#REMOVEME? ynh_script_progression --message="Removing the dedicated system user..." --weight=1 - -# Delete a system user -#REMOVEME? ynh_system_user_delete --username=$app - #================================================= # END OF SCRIPT #================================================= From 8959fe733d408809c6d98d7078770ab695c55e7d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Fri, 3 Feb 2023 18:54:37 +0100 Subject: [PATCH 12/27] Update manifest.toml --- manifest.toml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/manifest.toml b/manifest.toml index 111c1b8..9d1ac47 100644 --- a/manifest.toml +++ b/manifest.toml @@ -14,7 +14,6 @@ license = "MIT" admindoc = "https://github.com/go-shiori/shiori/wiki" userdoc = "https://github.com/go-shiori/shiori/wiki/Usage" code = "https://github.com/go-shiori/shiori" -website = "https://github.com/go-shiori/shiori" [integration] yunohost = ">= 11.0.9" @@ -45,5 +44,7 @@ ram.runtime = "50M" [resources.data_dir] + [resources.ports] + [resources.permissions] main.url = "/" From 8ea37ba57046f057f2d9557216807e341ae9bba3 Mon Sep 17 00:00:00 2001 From: yunohost-bot Date: Fri, 3 Feb 2023 17:54:41 +0000 Subject: [PATCH 13/27] Auto-update README --- README.md | 1 - README_fr.md | 1 - 2 files changed, 2 deletions(-) diff --git a/README.md b/README.md index ac66638..5ea1f86 100644 --- a/README.md +++ b/README.md @@ -35,7 +35,6 @@ Shiori is a simple bookmarks manager written in Go language. Intended as a simpl ## Documentation and resources -* Official app website: * Official user documentation: * Official admin documentation: * Upstream app code repository: diff --git a/README_fr.md b/README_fr.md index abf1a5a..c2d89c9 100644 --- a/README_fr.md +++ b/README_fr.md @@ -35,7 +35,6 @@ Shiori is a simple bookmarks manager written in Go language. Intended as a simpl ## Documentations et ressources -* Site officiel de l’app : * Documentation officielle utilisateur : * Documentation officielle de l’admin : * Dépôt de code officiel de l’app : From 22af2d58745912e500a5bd9d3ee00f46d34fcde5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Fri, 3 Feb 2023 19:04:59 +0100 Subject: [PATCH 14/27] Fix --- scripts/install | 14 +++++++++----- scripts/restore | 14 +++++++++----- scripts/upgrade | 14 +++++++++----- 3 files changed, 27 insertions(+), 15 deletions(-) diff --git a/scripts/install b/scripts/install index ff59092..91f223c 100755 --- a/scripts/install +++ b/scripts/install @@ -17,11 +17,6 @@ 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" --source_id=$YNH_ARCH -chmod 750 "$install_dir" -chmod -R o-rwx "$install_dir" -chown -R $app:www-data "$install_dir" -chmod +x "$install_dir/shiori" - #================================================= # NGINX CONFIGURATION #================================================= @@ -68,6 +63,15 @@ ynh_script_progression --message="Starting a systemd service..." --weight=1 # Start a systemd service ynh_systemd_action --service_name=$app --action="start" --log_path="systemd" +#================================================= +# SECURE FILES AND DIRECTORIES +#================================================= + +# Set permissions to app files +chmod -R o-rwx "$install_dir" +chown -R $app:www-data "$install_dir" +chmod +x "$install_dir/shiori" + #================================================= # END OF SCRIPT #================================================= diff --git a/scripts/restore b/scripts/restore index 1bda66d..8e4ecdd 100755 --- a/scripts/restore +++ b/scripts/restore @@ -26,11 +26,6 @@ ynh_script_progression --message="Restoring the app main directory..." --weight= ynh_restore_file --origin_path="$install_dir" -chmod 750 "$install_dir" -chmod -R o-rwx "$install_dir" -chown -R $app:www-data "$install_dir" -chmod +x "$install_dir/shiori" - #================================================= # RESTORE THE DATA DIRECTORY #================================================= @@ -73,6 +68,15 @@ ynh_script_progression --message="Starting a systemd service..." --weight=1 ynh_systemd_action --service_name=$app --action="start" --log_path="systemd" +#================================================= +# SECURE FILES AND DIRECTORIES +#================================================= + +# Set permissions to app files +chmod -R o-rwx "$install_dir" +chown -R $app:www-data "$install_dir" +chmod +x "$install_dir/shiori" + #================================================= # GENERIC FINALIZATION #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index 8487e7d..62044d5 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -36,11 +36,6 @@ then ynh_setup_source --dest_dir="$install_dir" --source_id=$YNH_ARCH fi -chmod 750 "$install_dir" -chmod -R o-rwx "$install_dir" -chown -R $app:www-data "$install_dir" -chmod +x "$install_dir/shiori" - #================================================= # NGINX CONFIGURATION #================================================= @@ -81,6 +76,15 @@ ynh_script_progression --message="Starting a systemd service..." --weight=1 ynh_systemd_action --service_name=$app --action="start" --log_path="systemd" +#================================================= +# SECURE FILES AND DIRECTORIES +#================================================= + +# Set permissions to app files +chmod -R o-rwx "$install_dir" +chown -R $app:www-data "$install_dir" +chmod +x "$install_dir/shiori" + #================================================= # END OF SCRIPT #================================================= From d7bd0ceec4030572d596ae1fc68e4185aecbae7a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Mon, 20 Feb 2023 16:20:49 +0100 Subject: [PATCH 15/27] fix --- manifest.toml | 5 ++++- scripts/install | 14 +++++--------- scripts/restore | 14 +++++--------- scripts/upgrade | 14 +++++--------- 4 files changed, 19 insertions(+), 28 deletions(-) diff --git a/manifest.toml b/manifest.toml index 9d1ac47..5abe36b 100644 --- a/manifest.toml +++ b/manifest.toml @@ -16,7 +16,7 @@ userdoc = "https://github.com/go-shiori/shiori/wiki/Usage" code = "https://github.com/go-shiori/shiori" [integration] -yunohost = ">= 11.0.9" +yunohost = ">= 11.1.8" architectures = "all" multi_instance = true ldap = "not_relevant" @@ -48,3 +48,6 @@ ram.runtime = "50M" [resources.permissions] main.url = "/" + + [resources.apt] + packages = "sqlite3" diff --git a/scripts/install b/scripts/install index 91f223c..ff59092 100755 --- a/scripts/install +++ b/scripts/install @@ -17,6 +17,11 @@ 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" --source_id=$YNH_ARCH +chmod 750 "$install_dir" +chmod -R o-rwx "$install_dir" +chown -R $app:www-data "$install_dir" +chmod +x "$install_dir/shiori" + #================================================= # NGINX CONFIGURATION #================================================= @@ -63,15 +68,6 @@ ynh_script_progression --message="Starting a systemd service..." --weight=1 # Start a systemd service ynh_systemd_action --service_name=$app --action="start" --log_path="systemd" -#================================================= -# SECURE FILES AND DIRECTORIES -#================================================= - -# Set permissions to app files -chmod -R o-rwx "$install_dir" -chown -R $app:www-data "$install_dir" -chmod +x "$install_dir/shiori" - #================================================= # END OF SCRIPT #================================================= diff --git a/scripts/restore b/scripts/restore index 8e4ecdd..1bda66d 100755 --- a/scripts/restore +++ b/scripts/restore @@ -26,6 +26,11 @@ ynh_script_progression --message="Restoring the app main directory..." --weight= ynh_restore_file --origin_path="$install_dir" +chmod 750 "$install_dir" +chmod -R o-rwx "$install_dir" +chown -R $app:www-data "$install_dir" +chmod +x "$install_dir/shiori" + #================================================= # RESTORE THE DATA DIRECTORY #================================================= @@ -68,15 +73,6 @@ ynh_script_progression --message="Starting a systemd service..." --weight=1 ynh_systemd_action --service_name=$app --action="start" --log_path="systemd" -#================================================= -# SECURE FILES AND DIRECTORIES -#================================================= - -# Set permissions to app files -chmod -R o-rwx "$install_dir" -chown -R $app:www-data "$install_dir" -chmod +x "$install_dir/shiori" - #================================================= # GENERIC FINALIZATION #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index 62044d5..8487e7d 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -36,6 +36,11 @@ then ynh_setup_source --dest_dir="$install_dir" --source_id=$YNH_ARCH fi +chmod 750 "$install_dir" +chmod -R o-rwx "$install_dir" +chown -R $app:www-data "$install_dir" +chmod +x "$install_dir/shiori" + #================================================= # NGINX CONFIGURATION #================================================= @@ -76,15 +81,6 @@ ynh_script_progression --message="Starting a systemd service..." --weight=1 ynh_systemd_action --service_name=$app --action="start" --log_path="systemd" -#================================================= -# SECURE FILES AND DIRECTORIES -#================================================= - -# Set permissions to app files -chmod -R o-rwx "$install_dir" -chown -R $app:www-data "$install_dir" -chmod +x "$install_dir/shiori" - #================================================= # END OF SCRIPT #================================================= From 14559719bd4e70b01f7a40713dcda54b146f3301 Mon Sep 17 00:00:00 2001 From: yunohost-bot Date: Mon, 20 Feb 2023 15:20:56 +0000 Subject: [PATCH 16/27] Auto-update README --- README.md | 1 + README_fr.md | 1 + 2 files changed, 2 insertions(+) diff --git a/README.md b/README.md index 5ea1f86..ce5c6c5 100644 --- a/README.md +++ b/README.md @@ -6,6 +6,7 @@ It shall NOT be edited by hand. # Shiori for YunoHost [![Integration level](https://dash.yunohost.org/integration/shiori.svg)](https://dash.yunohost.org/appci/app/shiori) ![Working status](https://ci-apps.yunohost.org/ci/badges/shiori.status.svg) ![Maintenance status](https://ci-apps.yunohost.org/ci/badges/shiori.maintain.svg) + [![Install Shiori with YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=shiori) *[Lire ce readme en français.](./README_fr.md)* diff --git a/README_fr.md b/README_fr.md index c2d89c9..b893705 100644 --- a/README_fr.md +++ b/README_fr.md @@ -6,6 +6,7 @@ It shall NOT be edited by hand. # Shiori pour YunoHost [![Niveau d’intégration](https://dash.yunohost.org/integration/shiori.svg)](https://dash.yunohost.org/appci/app/shiori) ![Statut du fonctionnement](https://ci-apps.yunohost.org/ci/badges/shiori.status.svg) ![Statut de maintenance](https://ci-apps.yunohost.org/ci/badges/shiori.maintain.svg) + [![Installer Shiori avec YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=shiori) *[Read this readme in english.](./README.md)* From c69cd5c244d720f908fd4ea1fcbe78de853e89f2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Mon, 20 Feb 2023 16:22:23 +0100 Subject: [PATCH 17/27] Fix --- doc/{notifications/PRE_INSTALL.md => POST_INSTALL.md} | 0 doc/notifications/POST_INSTALL.md | 4 ---- scripts/_common.sh | 3 --- 3 files changed, 7 deletions(-) rename doc/{notifications/PRE_INSTALL.md => POST_INSTALL.md} (100%) delete mode 100644 doc/notifications/POST_INSTALL.md diff --git a/doc/notifications/PRE_INSTALL.md b/doc/POST_INSTALL.md similarity index 100% rename from doc/notifications/PRE_INSTALL.md rename to doc/POST_INSTALL.md diff --git a/doc/notifications/POST_INSTALL.md b/doc/notifications/POST_INSTALL.md deleted file mode 100644 index fe5a180..0000000 --- a/doc/notifications/POST_INSTALL.md +++ /dev/null @@ -1,4 +0,0 @@ -The default account is `shiori` with password `gopher`. It is removed once another 'owner' account is created. - -- username: `shiori` -- password: `gopher` \ No newline at end of file diff --git a/scripts/_common.sh b/scripts/_common.sh index f0a867d..944a65e 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -4,9 +4,6 @@ # COMMON VARIABLES #================================================= -# dependencies used by the app -#REMOVEME? pkg_dependencies="sqlite3" - #================================================= # PERSONAL HELPERS #================================================= From 1942792630b5c47026ae9387bc1ca91692d2871e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Mon, 20 Feb 2023 16:22:57 +0100 Subject: [PATCH 18/27] Update change_url --- scripts/change_url | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/scripts/change_url b/scripts/change_url index a932008..3919fec 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -19,17 +19,6 @@ old_path=$YNH_APP_OLD_PATH new_domain=$YNH_APP_NEW_DOMAIN new_path=$YNH_APP_NEW_PATH -app=$YNH_APP_INSTANCE_NAME - -#================================================= -# LOAD SETTINGS -#================================================= -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) -port=$(ynh_app_setting_get --app=$app --key=port) - #================================================= # BACKUP BEFORE CHANGE URL THEN ACTIVE TRAP #================================================= From fed7c60454d8bed3c7a80aaa81ab9b53e05e333a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Mon, 20 Feb 2023 16:23:20 +0100 Subject: [PATCH 19/27] Update manifest.toml --- manifest.toml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/manifest.toml b/manifest.toml index 5abe36b..b762f90 100644 --- a/manifest.toml +++ b/manifest.toml @@ -42,6 +42,8 @@ ram.runtime = "50M" [resources.install_dir] + [resources.ports] + [resources.data_dir] [resources.ports] From 9cf92cf9d06f04ec9be50f9a691644e74f5b7211 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Mon, 20 Feb 2023 16:23:51 +0100 Subject: [PATCH 20/27] Update POST_INSTALL.md --- doc/POST_INSTALL.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/doc/POST_INSTALL.md b/doc/POST_INSTALL.md index e69de29..fe5a180 100644 --- a/doc/POST_INSTALL.md +++ b/doc/POST_INSTALL.md @@ -0,0 +1,4 @@ +The default account is `shiori` with password `gopher`. It is removed once another 'owner' account is created. + +- username: `shiori` +- password: `gopher` \ No newline at end of file From 7107245c9e16be24d37a479a705e70cdd815384d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Mon, 20 Feb 2023 16:25:13 +0100 Subject: [PATCH 21/27] Update manifest.toml --- manifest.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifest.toml b/manifest.toml index b762f90..6c58b7d 100644 --- a/manifest.toml +++ b/manifest.toml @@ -17,7 +17,7 @@ code = "https://github.com/go-shiori/shiori" [integration] yunohost = ">= 11.1.8" -architectures = "all" +architectures = ["amd64", "arm64", "armhf"] multi_instance = true ldap = "not_relevant" sso = "not_relevant" From 936b623a740a8eff61b86b18df7e12676df2f613 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Mon, 20 Feb 2023 16:31:16 +0100 Subject: [PATCH 22/27] fix --- manifest.toml | 6 ++---- scripts/install | 21 ++------------------- scripts/remove | 14 ++------------ scripts/restore | 40 ++++++---------------------------------- scripts/upgrade | 21 ++------------------- 5 files changed, 14 insertions(+), 88 deletions(-) diff --git a/manifest.toml b/manifest.toml index 6c58b7d..3489003 100644 --- a/manifest.toml +++ b/manifest.toml @@ -38,16 +38,14 @@ ram.runtime = "50M" default = "visitors" [resources] + [resources.ports] + [resources.system_user] [resources.install_dir] - [resources.ports] - [resources.data_dir] - [resources.ports] - [resources.permissions] main.url = "/" diff --git a/scripts/install b/scripts/install index ff59092..117108e 100755 --- a/scripts/install +++ b/scripts/install @@ -23,28 +23,16 @@ chown -R $app:www-data "$install_dir" chmod +x "$install_dir/shiori" #================================================= -# NGINX CONFIGURATION +# SYSTEM CONFIGURATION #================================================= -ynh_script_progression --message="Configuring NGINX web server..." --weight=1 +ynh_script_progression --message="Adding system configurations related to $app ..." --weight=1 # Create a dedicated NGINX config ynh_add_nginx_config -#================================================= -# SETUP SYSTEMD -#================================================= -ynh_script_progression --message="Configuring a systemd service..." --weight=1 - # Create a dedicated systemd config ynh_add_systemd_config -#================================================= -# GENERIC FINALIZATION -#================================================= -# SETUP LOGROTATE -#================================================= -ynh_script_progression --message="Configuring log rotation..." --weight=1 - # Use logrotate to manage application logfile(s) ynh_use_logrotate @@ -53,11 +41,6 @@ mkdir -p /var/log/$app touch /var/log/$app/$app.log chown $app -R /var/log/$app -#================================================= -# INTEGRATE SERVICE IN YUNOHOST -#================================================= -ynh_script_progression --message="Integrating service in YunoHost..." --weight=1 - yunohost service add $app --description="Simple bookmark manager" --log="/var/log/$app/$app.log" #================================================= diff --git a/scripts/remove b/scripts/remove index 6b31155..49f12dd 100755 --- a/scripts/remove +++ b/scripts/remove @@ -23,28 +23,18 @@ then fi #================================================= -# STOP AND REMOVE SERVICE +# REMOVE SYSTEM CONFIGURATIONS #================================================= -ynh_script_progression --message="Stopping and removing the systemd service..." --weight=1 +ynh_script_progression --message="Removing system configurations related to $app..." --weight=1 # Remove the dedicated systemd config ynh_remove_systemd_config -#================================================= -# REMOVE LOGROTATE CONFIGURATION -#================================================= -ynh_script_progression --message="Removing logrotate configuration..." --weight=1 - ynh_secure_remove --file="/var/log/$app" # Remove the app-specific logrotate config ynh_remove_logrotate -#================================================= -# REMOVE NGINX CONFIGURATION -#================================================= -ynh_script_progression --message="Removing NGINX web server configuration..." --weight=1 - # Remove the dedicated NGINX config ynh_remove_nginx_config diff --git a/scripts/restore b/scripts/restore index 1bda66d..883b266 100755 --- a/scripts/restore +++ b/scripts/restore @@ -10,15 +10,6 @@ source ../settings/scripts/_common.sh source /usr/share/yunohost/helpers -#================================================= -# STANDARD RESTORATION STEPS -#================================================= -# RESTORE THE NGINX CONFIGURATION -#================================================= -ynh_script_progression --message="Restoring the NGINX configuration..." --weight=1 - -ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf" - #================================================= # RESTORE THE APP MAIN DIR #================================================= @@ -38,48 +29,29 @@ ynh_script_progression --message="Restoring the data directory..." --weight=1 ynh_restore_file --origin_path="$data_dir" --not_mandatory -mkdir -p $data_dir - -chmod 750 "$data_dir" -chmod -R o-rwx "$data_dir" chown -R $app:www-data "$data_dir" #================================================= -# RESTORE SYSTEMD +# RESTORE SYSTEM CONFIGURATIONS #================================================= -ynh_script_progression --message="Restoring the systemd configuration..." --weight=1 +ynh_script_progression --message="Restoring system configurations related to $app..." --weight=1 + +ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf" ynh_restore_file --origin_path="/etc/systemd/system/$app.service" systemctl enable $app.service --quiet -#================================================= -# RESTORE THE LOGROTATE CONFIGURATION -#================================================= -ynh_script_progression --message="Restoring the logrotate configuration..." --weight=1 - ynh_restore_file --origin_path="/etc/logrotate.d/$app" -#================================================= -# INTEGRATE SERVICE IN YUNOHOST -#================================================= -ynh_script_progression --message="Integrating service in YunoHost..." --weight=1 - yunohost service add $app --description="Simple bookmark manager" --log="/var/log/$app/$app.log" #================================================= -# START SYSTEMD SERVICE +# RELOAD NGINX AND PHP-FPM OR THE APP SERVICE #================================================= -ynh_script_progression --message="Starting a systemd service..." --weight=1 +ynh_script_progression --message="Reloading NGINX web server and $app's service..." --weight=1 ynh_systemd_action --service_name=$app --action="start" --log_path="systemd" -#================================================= -# GENERIC FINALIZATION -#================================================= -# RELOAD NGINX AND PHP-FPM -#================================================= -ynh_script_progression --message="Reloading NGINX web server..." --weight=1 - ynh_systemd_action --service_name=nginx --action=reload #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index 8487e7d..51b91eb 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -42,36 +42,19 @@ chown -R $app:www-data "$install_dir" chmod +x "$install_dir/shiori" #================================================= -# NGINX CONFIGURATION +# REAPPLY SYSTEM CONFIGURATIONS #================================================= -ynh_script_progression --message="Upgrading NGINX web server configuration..." --weight=1 +ynh_script_progression --message="Upgrading system configurations related to $app..." --weight=1 # Create a dedicated NGINX config ynh_add_nginx_config -#================================================= -# SETUP SYSTEMD -#================================================= -ynh_script_progression --message="Upgrading systemd configuration..." --weight=1 - # Create a dedicated systemd config ynh_add_systemd_config -#================================================= -# GENERIC FINALIZATION -#================================================= -# SETUP LOGROTATE -#================================================= -ynh_script_progression --message="Upgrading logrotate configuration..." --weight=1 - # Use logrotate to manage app-specific logfile(s) ynh_use_logrotate --non-append -#================================================= -# INTEGRATE SERVICE IN YUNOHOST -#================================================= -ynh_script_progression --message="Integrating service in YunoHost..." --weight=1 - yunohost service add $app --description="Simple bookmark manager" --log="/var/log/$app/$app.log" #================================================= From c25789d4bc369652bfb3569124c40f1b14c8376a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Mon, 20 Feb 2023 16:32:32 +0100 Subject: [PATCH 23/27] 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 0345df9..7aebb6c 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -1,7 +1,7 @@ #sub_path_only rewrite ^__PATH__$ __PATH__/ permanent; location __PATH__/ { - proxy_pass http://127.0.0.1:__PORT__; + proxy_pass http://127.0.0.1:__PORT__/; proxy_redirect off; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; From 55053cfa7e74b9b9f7b7dc619451e0df25391611 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Thu, 16 Mar 2023 20:15:33 +0100 Subject: [PATCH 24/27] src --- conf/amd64.src | 7 ---- conf/arm64.src | 7 ---- conf/armhf.src | 7 ---- manifest.toml | 14 +++++++- scripts/change_url | 82 +--------------------------------------------- 5 files changed, 14 insertions(+), 103 deletions(-) delete mode 100644 conf/amd64.src delete mode 100644 conf/arm64.src delete mode 100644 conf/armhf.src diff --git a/conf/amd64.src b/conf/amd64.src deleted file mode 100644 index ccc4bbc..0000000 --- a/conf/amd64.src +++ /dev/null @@ -1,7 +0,0 @@ -SOURCE_URL=https://github.com/go-shiori/shiori/releases/download/v1.5.4/shiori_1.5.4_Linux_x86_64.tar.gz -SOURCE_SUM=e7d4ca6d92b0c90a0ff3a54f3b124db6409eff6c43c153cc955d3dc42111bada -SOURCE_SUM_PRG=sha256sum -SOURCE_FORMAT=tar.gz -SOURCE_IN_SUBDIR=false -SOURCE_FILENAME= -SOURCE_EXTRACT=true \ No newline at end of file diff --git a/conf/arm64.src b/conf/arm64.src deleted file mode 100644 index 13739e7..0000000 --- a/conf/arm64.src +++ /dev/null @@ -1,7 +0,0 @@ -SOURCE_URL=https://github.com/go-shiori/shiori/releases/download/v1.5.4/shiori_1.5.4_Linux_aarch64.tar.gz -SOURCE_SUM=a0285089d20dee0e5860a6d134df88c61a7240eef233cd706e6217400f9c5121 -SOURCE_SUM_PRG=sha256sum -SOURCE_FORMAT=tar.gz -SOURCE_IN_SUBDIR=false -SOURCE_FILENAME= -SOURCE_EXTRACT=true \ No newline at end of file diff --git a/conf/armhf.src b/conf/armhf.src deleted file mode 100644 index 444ad6d..0000000 --- a/conf/armhf.src +++ /dev/null @@ -1,7 +0,0 @@ -SOURCE_URL=https://github.com/go-shiori/shiori/releases/download/v1.5.4/shiori_1.5.4_Linux_armv7.tar.gz -SOURCE_SUM=193b0c999a23cd63c09731b9e3f3363e71e4ceaafa9172723060b5516e920409 -SOURCE_SUM_PRG=sha256sum -SOURCE_FORMAT=tar.gz -SOURCE_IN_SUBDIR=false -SOURCE_FILENAME= -SOURCE_EXTRACT=true diff --git a/manifest.toml b/manifest.toml index 3489003..4702d43 100644 --- a/manifest.toml +++ b/manifest.toml @@ -16,7 +16,7 @@ userdoc = "https://github.com/go-shiori/shiori/wiki/Usage" code = "https://github.com/go-shiori/shiori" [integration] -yunohost = ">= 11.1.8" +yunohost = ">= 11.1.15" architectures = ["amd64", "arm64", "armhf"] multi_instance = true ldap = "not_relevant" @@ -38,6 +38,18 @@ ram.runtime = "50M" default = "visitors" [resources] + + [resources.sources] + + [resources.sources.main] + amd64.url = "https://github.com/go-shiori/shiori/releases/download/v1.5.4/shiori_1.5.4_Linux_x86_64.tar.gz" + amd64.sha256 = "e7d4ca6d92b0c90a0ff3a54f3b124db6409eff6c43c153cc955d3dc42111bada" + arm64.url = "https://github.com/go-shiori/shiori/releases/download/v1.5.4/shiori_1.5.4_Linux_aarch64.tar.gz" + arm64.sha256 = "a0285089d20dee0e5860a6d134df88c61a7240eef233cd706e6217400f9c5121" + armhf.url = "https://github.com/go-shiori/shiori/releases/download/v1.5.4/shiori_1.5.4_Linux_armv7.tar.gz" + armhf.sha256 = "193b0c999a23cd63c09731b9e3f3363e71e4ceaafa9172723060b5516e920409" + in_subdir = false + [resources.ports] [resources.system_user] diff --git a/scripts/change_url b/scripts/change_url index 3919fec..3a9b28d 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -9,49 +9,6 @@ source _common.sh source /usr/share/yunohost/helpers -#================================================= -# RETRIEVE ARGUMENTS -#================================================= - -old_domain=$YNH_APP_OLD_DOMAIN -old_path=$YNH_APP_OLD_PATH - -new_domain=$YNH_APP_NEW_DOMAIN -new_path=$YNH_APP_NEW_PATH - -#================================================= -# BACKUP BEFORE CHANGE URL THEN ACTIVE TRAP -#================================================= -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 -ynh_clean_setup () { - # Remove the new domain config file, the remove script won't do it as it doesn't know yet its location. - ynh_secure_remove --file="/etc/nginx/conf.d/$new_domain.d/$app.conf" - - # Restore it if the upgrade fails - ynh_restore_upgradebackup -} -# Exit if an error occurs during the execution of the script -ynh_abort_if_errors - -#================================================= -# CHECK WHICH PARTS SHOULD BE CHANGED -#================================================= - -change_domain=0 -if [ "$old_domain" != "$new_domain" ] -then - change_domain=1 -fi - -change_path=0 -if [ "$old_path" != "$new_path" ] -then - change_path=1 -fi - #================================================= # STANDARD MODIFICATIONS #================================================= @@ -66,37 +23,7 @@ ynh_systemd_action --service_name=$app --action="stop" --log_path="systemd" #================================================= ynh_script_progression --message="Updating NGINX web server configuration..." --weight=1 -nginx_conf_path=/etc/nginx/conf.d/$old_domain.d/$app.conf -systemd_conf_path=/etc/systemd/system/$app.service - -# Change the path in the NGINX config file -if [ $change_path -eq 1 ] -then - # Make a backup of the original NGINX config file if modified - ynh_backup_if_checksum_is_different --file="$nginx_conf_path" - # Set global variables for NGINX helper - domain="$old_domain" - path_url="$new_path" - # Create a dedicated NGINX config - ynh_add_nginx_config - - # Make a backup of the original Systemd file if modified - ynh_backup_if_checksum_is_different --file="$systemd_conf_path" - # Get value for systemd helper - datadir=$(ynh_app_setting_get --app=$app --key=datadir) - # Create systemd service - ynh_add_systemd_config -fi - -# Change the domain for NGINX -if [ $change_domain -eq 1 ] -then - # Delete file checksum for the old conf file location - ynh_delete_file_checksum --file="$nginx_conf_path" - mv $nginx_conf_path /etc/nginx/conf.d/$new_domain.d/$app.conf - # Store file checksum for the new config file location - ynh_store_file_checksum --file="/etc/nginx/conf.d/$new_domain.d/$app.conf" -fi +ynh_change_url_nginx_config #================================================= # GENERIC FINALISATION @@ -107,13 +34,6 @@ ynh_script_progression --message="Starting a systemd service..." --weight=1 ynh_systemd_action --service_name=$app --action="start" --log_path="systemd" -#================================================= -# RELOAD NGINX -#================================================= -ynh_script_progression --message="Reloading NGINX web server..." --weight=1 - -ynh_systemd_action --service_name=nginx --action=reload - #================================================= # END OF SCRIPT #================================================= From 41dc27606d67a554c2d08e66f61162e2d562c7a2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Thu, 16 Mar 2023 20:20:21 +0100 Subject: [PATCH 25/27] cleaning --- scripts/install | 3 +-- scripts/restore | 1 - scripts/upgrade | 3 +-- 3 files changed, 2 insertions(+), 5 deletions(-) diff --git a/scripts/install b/scripts/install index 117108e..3e63e67 100755 --- a/scripts/install +++ b/scripts/install @@ -15,9 +15,8 @@ source /usr/share/yunohost/helpers 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" --source_id=$YNH_ARCH +ynh_setup_source --dest_dir="$install_dir" -chmod 750 "$install_dir" chmod -R o-rwx "$install_dir" chown -R $app:www-data "$install_dir" chmod +x "$install_dir/shiori" diff --git a/scripts/restore b/scripts/restore index 883b266..4485474 100755 --- a/scripts/restore +++ b/scripts/restore @@ -17,7 +17,6 @@ ynh_script_progression --message="Restoring the app main directory..." --weight= ynh_restore_file --origin_path="$install_dir" -chmod 750 "$install_dir" chmod -R o-rwx "$install_dir" chown -R $app:www-data "$install_dir" chmod +x "$install_dir/shiori" diff --git a/scripts/upgrade b/scripts/upgrade index 51b91eb..9f1d860 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -33,10 +33,9 @@ then 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="$install_dir" --source_id=$YNH_ARCH + ynh_setup_source --dest_dir="$install_dir" fi -chmod 750 "$install_dir" chmod -R o-rwx "$install_dir" chown -R $app:www-data "$install_dir" chmod +x "$install_dir/shiori" From 13e2748b0cbb6a4a9115bb721d658df02a2db69f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Fri, 17 Mar 2023 22:53:33 +0100 Subject: [PATCH 26/27] Update tests.toml --- tests.toml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tests.toml b/tests.toml index 50116cb..8131bc1 100644 --- a/tests.toml +++ b/tests.toml @@ -2,6 +2,12 @@ test_format = 1.0 [default] + # ------------ + # Tests to run + # ------------ + + exclude = ["install.subdir"] + # ------------------------------- # Commits to test upgrade from # ------------------------------- From 727480d6faa5e5a6f9c75201ac58ac42d1bfa60c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Fri, 17 Mar 2023 22:54:11 +0100 Subject: [PATCH 27/27] Update manifest.toml --- manifest.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/manifest.toml b/manifest.toml index 4702d43..269f6c1 100644 --- a/manifest.toml +++ b/manifest.toml @@ -19,8 +19,8 @@ code = "https://github.com/go-shiori/shiori" yunohost = ">= 11.1.15" architectures = ["amd64", "arm64", "armhf"] multi_instance = true -ldap = "not_relevant" -sso = "not_relevant" +ldap = false +sso = false disk = "50M" ram.build = "50M" ram.runtime = "50M"