From c493d90707b8f15bc918a920480e9fd5020d8f34 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Fri, 6 Oct 2023 13:52:35 +0200 Subject: [PATCH 1/8] cleaning --- conf/nginx.conf | 1 + conf/systemd.service | 2 +- doc/DESCRIPTION.md | 4 +-- doc/DESCRIPTION_fr.md | 1 + manifest.toml | 53 ++++++---------------------- scripts/_common.sh | 1 + scripts/backup | 17 +++------ scripts/change_url | 51 +++++++++++++++++++++++++++ scripts/install | 60 ++++--------------------------- scripts/remove | 27 +++----------- scripts/restore | 25 +++++-------- scripts/upgrade | 82 +++++++------------------------------------ 12 files changed, 103 insertions(+), 221 deletions(-) create mode 100644 doc/DESCRIPTION_fr.md create mode 100644 scripts/change_url diff --git a/conf/nginx.conf b/conf/nginx.conf index 1c84f07..74bcc57 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -1,3 +1,4 @@ +#sub_path_only rewrite ^__PATH__$ __PATH__/ permanent; location __PATH__/ { proxy_pass http://127.0.0.1:__PORT__; diff --git a/conf/systemd.service b/conf/systemd.service index 0b1029b..93f2bbf 100644 --- a/conf/systemd.service +++ b/conf/systemd.service @@ -1,5 +1,5 @@ [Unit] -Description=Gancio : federated agenda +Description=Gancio: federated agenda After=network.target [Service] diff --git a/doc/DESCRIPTION.md b/doc/DESCRIPTION.md index 4821b65..760caef 100644 --- a/doc/DESCRIPTION.md +++ b/doc/DESCRIPTION.md @@ -1,3 +1 @@ -This app provide an online agenda open to contributions, and federated with the fediverse using ActivityPub. - -*Note that this package is still work in progress, don't consider it as stable.* +Gancio provide an online agenda open to contributions, and federated with the fediverse using ActivityPub. diff --git a/doc/DESCRIPTION_fr.md b/doc/DESCRIPTION_fr.md new file mode 100644 index 0000000..455d1a4 --- /dev/null +++ b/doc/DESCRIPTION_fr.md @@ -0,0 +1 @@ +Gancio propose un agenda en ligne ouvert aux contributions, et fédéré avec le fediverse via ActivityPub. \ No newline at end of file diff --git a/manifest.toml b/manifest.toml index 5ce1104..83179ab 100644 --- a/manifest.toml +++ b/manifest.toml @@ -3,15 +3,14 @@ packaging_format = 2 id = "gancio" name = "Gancio" -description.en = "Shared agenda for local communities, federated with the fediverse." -description.fr = "Agenda partagé pour les communautés locales, fédéré avec le fédiverse." +description.en = "Shared agenda for local communities, federated with the fediverse" +description.fr = "Agenda partagé pour les communautés locales, fédéré avec le fédiverse" version = "1.6.17~ynh1" maintainers = ["Lapineige"] [upstream] -# NB: Only the "license" key is mandatory. Remove entries for which there's no relevant data license = "AGPL-3.0-only" website = "https://gancio.org" demo = "https://demo.gancio.org/" @@ -19,27 +18,22 @@ admindoc = "https://gancio.org/install/" userdoc = "https://gancio.org/usage" code = "https://framagit.org/les/gancio" - [integration] -yunohost = ">= 11.1.21" -# List of supported archs using the dpkg --print-architecture nomenclature (amd64/i386/armhf/arm64), for example: ["amd64", "i386'] +yunohost = ">= 11.2" architectures = "all" multi_instance = false ldap = false sso = false -# FIXME: replace with an **estimate** minimum disk and RAM requirements. e.g. 20M, 400M, 1G... You may have have a look at CI results 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.init_main_permission] - # this is a generic question - ask strings are automatically handled by YunoHost's core - # This won't be saved as setting and will instead be used to initialize the SSOwat permission type = "group" default = "visitors" @@ -51,65 +45,40 @@ ram.runtime = "50M" default = "en" [install.admin] - # this is a generic question - ask strings are automatically handled by YunoHost's core type = "user" + [install.password] - # this is a generic question - ask strings are automatically handled by YunoHost's core - # Note that user-provided passwords questions are not automatically saved as setting help.en = "Choose admin user password" help.fr = "Choisissez le mot de passe du compte d'administration." type = "password" [resources] - # See the packaging documentation for the full set - # of explanation regarding the behavior and properties for each of those + [resources.sources] [resources.sources.main] - # This will pre-fetch the asset which can then be deployed during the install/upgrade scripts with : - # ynh_setup_source --dest_dir="$install_dir" - # You can also define other assets than "main" and add --source_id="foobar" in the previous command url = "https://gancio.org/releases/gancio-v1.6.17.tgz" sha256 = "fd9b0869d4c733c4b7de9f3bec0889918170822f1b12104ec32923c30648746f" - # These infos are used by https://github.com/YunoHost/apps/blob/master/tools/autoupdate_app_sources/autoupdate_app_sources.py - # to auto-update the previous asset urls and sha256sum + manifest version - # assuming the upstream's code repo is on github and relies on tags or releases - # See the 'sources' resource documentation for more details - - # autoupdate.strategy = "latest_github_tag" [resources.system_user] - # This will provision/deprovision a unix system user - - allow_email = true + #allow_email = true [resources.install_dir] - # This will create/remove the install dir as /var/www/$app - # and store the corresponding setting $install_dir - + [resources.data_dir] - # This will create/remove the data dir as /home/yunohost.app/$app - # and store the corresponding setting $data_dir - subdirs = ['uploads', 'user_locale'] + subdirs = ['uploads', 'user_locale', 'plugins'] [resources.permissions] - # This will configure SSOwat permission for $domain/$path/ - # The initial allowed group of user is configured via the init_main_permission question (public=visitors, private=all_users) main.url = "/" [resources.ports] - # This will pick a random port for reverse-proxying and store it as the $port setting - + [resources.apt] - # This will automatically install/uninstall the following apt packages - # and implicitly define the $phpversion setting as 8.0 (if phpX.Y-foobar dependencies are listed) packages = "postgresql" - # This will configure an extra repository to install yarn dependency extras.yarn.repo = "deb https://dl.yarnpkg.com/debian/ stable main" extras.yarn.key = "https://dl.yarnpkg.com/debian/pubkey.gpg" extras.yarn.packages = "yarn" [resources.database] - # This will automatically provision/deprovison a MySQL DB and store the corresponding credentials in settings $db_user, $db_name, $db_pwd type = "postgresql" - + \ No newline at end of file diff --git a/scripts/_common.sh b/scripts/_common.sh index bbbed30..b818f0f 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -5,6 +5,7 @@ #================================================= nodejs_version=16 + #================================================= # PERSONAL HELPERS #================================================= diff --git a/scripts/backup b/scripts/backup index a758c5b..129a147 100644 --- a/scripts/backup +++ b/scripts/backup @@ -1,8 +1,5 @@ #!/bin/bash -#### App file generated with YoloGen, the Yunohost app generator, version 0.6. -# This is the tutorial version of the app. -# It contains extra commands to explain what should be done in case you want to adjust some part of the script. -# Once you are done, you may remove them. + #================================================= # GENERIC START #================================================= @@ -18,10 +15,6 @@ source /usr/share/yunohost/helpers #================================================= ynh_print_info --message="Declaring files to be backed up..." -### N.B. : the following 'ynh_backup' calls are only a *declaration* of what needs -### to be backuped and not an actual copy of any file. The actual backup that -### creates and fill the archive with the files happens in the core after this -### script is called. Hence ynh_backups calls takes basically 0 seconds to run. #================================================= # BACKUP THE APP MAIN DIR #================================================= @@ -32,9 +25,8 @@ ynh_backup --src_path="$install_dir" # BACKUP THE DATA DIR #================================================= - # The --is_big parameters ensure this folder is not included in the backup by default (taking less space), except if BACKUP_CORE_ONLY=0 is passed before the backup command. You might want to document that for your users. - # Only relevant if there is a "data_dir" resource for this app ynh_backup --src_path="$data_dir" --is_big + #================================================= # BACKUP THE NGINX CONFIGURATION #================================================= @@ -48,6 +40,7 @@ ynh_backup --src_path="/etc/nginx/conf.d/$domain.d/$app.conf" #================================================= ynh_backup --src_path="/etc/logrotate.d/$app" + #================================================= # BACKUP SYSTEMD #================================================= @@ -59,10 +52,8 @@ ynh_backup --src_path="/etc/systemd/system/$app.service" #================================================= ynh_print_info --message="Backing up the postgresql database..." -### (However, things like MySQL dumps *do* take some time to run, though the -### copy of the generated dump to the archive still happens later) +ynh_psql_dump_db --database="$db_name" > db.sql -ynh_mysql_dump_db --database="$db_name" > db.sql #================================================= # END OF SCRIPT #================================================= diff --git a/scripts/change_url b/scripts/change_url new file mode 100644 index 0000000..6c33e71 --- /dev/null +++ b/scripts/change_url @@ -0,0 +1,51 @@ +#!/bin/bash + +#================================================= +# GENERIC STARTING +#================================================= +# IMPORT GENERIC HELPERS +#================================================= + +source _common.sh +source /usr/share/yunohost/helpers + +#================================================= +# STANDARD MODIFICATIONS +#================================================= +# STOP SYSTEMD SERVICE +#================================================= +ynh_script_progression --message="Stopping a systemd service..." --weight=1 + +ynh_systemd_action --service_name=$app --action="stop" --log_path="systemd" + +#================================================= +# MODIFY URL IN NGINX CONF +#================================================= +ynh_script_progression --message="Updating NGINX web server configuration..." --weight=1 + +ynh_change_url_nginx_config + +#================================================= +# ADD A CONFIGURATION +#================================================= +ynh_script_progression --message="Adding a configuration file..." --weight=1 + +ynh_add_config --template="config.json" --destination="$install_dir/config.json" + +chmod 400 "$install_dir/config.json" +chown $app:$app "$install_dir/config.json" + +#================================================= +# GENERIC FINALISATION +#================================================= +# START SYSTEMD SERVICE +#================================================= +ynh_script_progression --message="Starting a systemd service..." --weight=1 + +ynh_systemd_action --service_name=$app --action="start" --log_path="systemd" + +#================================================= +# END OF SCRIPT +#================================================= + +ynh_script_progression --message="Change of URL completed for $app" --last diff --git a/scripts/install b/scripts/install index 404c5b2..6f2115a 100644 --- a/scripts/install +++ b/scripts/install @@ -1,36 +1,14 @@ #!/bin/bash -#### App file generated with YoloGen, the Yunohost app generator, version 0.6. -# This is the tutorial version of the app. -# It contains extra commands to explain what should be done in case you want to adjust some part of the script. -# Once you are done, you may remove them. + #================================================= # GENERIC START #================================================= # IMPORT GENERIC HELPERS #================================================= + source _common.sh source /usr/share/yunohost/helpers -# Install parameters are automatically saved as settings -# -# Settings are automatically loaded as bash variables -# in every app script context, therefore typically these will exist: -# - $domain -# - $path -# - $language -# ... etc -# -# Resources defined in the manifest are provisioned prior to this script -# and corresponding settings are also available, such as: -# - $install_dir -# - $port -# - $db_name -# ... - -# -# $app is the app id (i.e. 'example' for first install, -# or 'example__2', '__3', ... for multi-instance installs) -# #================================================= # INSTALL DEPENDENCIES #================================================= @@ -38,6 +16,7 @@ ynh_script_progression --message="Installing dependencies..." --weight=10 # Install Nodejs ynh_exec_warn_less ynh_install_nodejs --nodejs_version=$nodejs_version + #================================================= # APP "BUILD" (DEPLOYING SOURCES, VENV, COMPILING ETC) #================================================= @@ -45,29 +24,22 @@ ynh_exec_warn_less ynh_install_nodejs --nodejs_version=$nodejs_version #================================================= ynh_script_progression --message="Setting up source files..." --weight=1 -### `ynh_setup_source` is used to install an app from a zip or tar.gz file, -### downloaded from an upstream source, like a git repository. -### `ynh_setup_source` use the file conf/app.src -# Download, check integrity, uncompress and patch the source from app.src ynh_setup_source --dest_dir="$install_dir" -# $install_dir will automatically be initialized with some decent -# permission by default ... however, you may need to recursively reapply -# ownership to all files such as after the ynh_setup_source step chown -R $app:www-data "$install_dir" - #================================================= # SYSTEM CONFIGURATION #================================================= ynh_script_progression --message="Adding system configurations related to $app..." --weight=1 + # Create a dedicated NGINX config using the conf/nginx.conf template ynh_add_nginx_config # Create a dedicated systemd config ynh_add_systemd_config -yunohost service add $app --description="A federated shared agenda for local communities." --log="/var/log/$app/$app.log" +yunohost service add $app --description="Federated shared agenda for local communities" --log="/var/log/$app/$app.log" # Use logrotate to manage application logfile(s) ynh_use_logrotate @@ -81,20 +53,10 @@ ynh_script_progression --message="Adding a configuration file..." --weight=1 ynh_add_config --template="config.json" --destination="$install_dir/config.json" -# FIXME: this should be handled by the core in the future -# You may need to use chmod 600 instead of 400, -# for example if the app is expected to be able to modify its own config chmod 400 "$install_dir/config.json" chown $app:$app "$install_dir/config.json" chown $app:$app "/var/log/$app" -### For more complex cases where you want to replace stuff using regexes, -### you shoud rely on ynh_replace_string (which is basically a wrapper for sed) -### When doing so, you also need to manually call ynh_store_file_checksum -### -### ynh_replace_string --match_string="match_string" --replace_string="replace_string" --target_file="$install_dir/some_config_file" -### ynh_store_file_checksum --file="$install_dir/some_config_file" - #================================================= # INSTALL YARN AND APP #================================================= @@ -103,14 +65,6 @@ ynh_script_progression --message="Installing app dependencies..." --weight=15 pushd $install_dir ynh_use_nodejs ynh_exec_warn_less ynh_exec_as $app $ynh_node_load_PATH yarn install # Install dependencies -popd - -#================================================= -# CREATE ADMIN USER -#================================================= -ynh_script_progression --message="Creating admin user..." --weight=15 - -pushd $install_dir ynh_exec_warn_less ynh_exec_as $app $ynh_node_load_PATH ./server/cli.js users create __ADMIN__ --admin --config ./config.json popd @@ -121,9 +75,9 @@ popd #================================================= ynh_script_progression --message="Starting a systemd service..." --weight=1 - # Start a systemd service -ynh_systemd_action --service_name=$app --action="start" --log_path="/var/log/$app/$app.log" +ynh_systemd_action --service_name=$app --action="start" --log_path="systemd" + #================================================= # END OF SCRIPT #================================================= diff --git a/scripts/remove b/scripts/remove index a691112..7d5b107 100644 --- a/scripts/remove +++ b/scripts/remove @@ -1,28 +1,14 @@ #!/bin/bash -#### App file generated with YoloGen, the Yunohost app generator, version 0.6. -# This is the tutorial version of the app. -# It contains extra commands to explain what should be done in case you want to adjust some part of the script. -# Once you are done, you may remove them. + #================================================= # GENERIC START #================================================= # IMPORT GENERIC HELPERS #================================================= + source _common.sh source /usr/share/yunohost/helpers -# Settings are automatically loaded as bash variables -# in every app script context, therefore typically these will exist: -# - $domain -# - $path -# - $language -# - $install_dir -# - $port -# ... - -# For remove operations : -# - the core will deprovision every resource defined in the manifest **after** this script is ran -# this includes removing the install directory, and data directory (if --purge was used) #================================================= # REMOVE SYSTEM CONFIGURATIONS #================================================= @@ -30,7 +16,6 @@ source /usr/share/yunohost/helpers #================================================= ynh_script_progression --message="Removing system configurations related to $app..." --weight=1 -# This should be a symetric version of what happens in the install script # Remove the service from the list of services known by YunoHost (added from `yunohost service add`) if ynh_exec_warn_less yunohost service status $app >/dev/null then @@ -39,14 +24,10 @@ then fi ynh_remove_systemd_config + ynh_remove_nginx_config ynh_remove_logrotate -# Remove other various files specific to the app... such as : - -ynh_secure_remove --file="/etc/cron.d/$app" - -ynh_secure_remove --file="/etc/$app" ynh_secure_remove --file="/var/log/$app" @@ -54,4 +35,4 @@ ynh_secure_remove --file="/var/log/$app" # END OF SCRIPT #================================================= -ynh_script_progression --message="Removal of $app completed" --last \ No newline at end of file +ynh_script_progression --message="Removal of $app completed" --last diff --git a/scripts/restore b/scripts/restore index efe99ab..4fb2375 100644 --- a/scripts/restore +++ b/scripts/restore @@ -1,8 +1,5 @@ #!/bin/bash -#### App file generated with YoloGen, the Yunohost app generator, version 0.6. -# This is the tutorial version of the app. -# It contains extra commands to explain what should be done in case you want to adjust some part of the script. -# Once you are done, you may remove them. + #================================================= # GENERIC START #================================================= @@ -20,9 +17,6 @@ ynh_script_progression --message="Restoring the app main directory..." --weight= ynh_restore_file --origin_path="$install_dir" -# $install_dir will automatically be initialized with some decent -# permission by default ... however, you may need to recursively reapply -# ownership to all files such as after the ynh_setup_source step chown -R $app:www-data "$install_dir" #================================================= @@ -34,32 +28,29 @@ ynh_restore_file --origin_path="$data_dir" --not_mandatory # (Same as for install dir) chown -R $app:www-data "$data_dir" + #================================================= # RESTORE THE MYSQL DATABASE #================================================= - ynh_script_progression --message="Restoring the PostgreSQL database..." --weight=1 +ynh_script_progression --message="Restoring the PostgreSQL database..." --weight=1 ynh_psql_connect_as --user=$db_user --password=$db_pwd --database=$db_name < ./db.sql - #================================================= + +#================================================= # RESTORE SYSTEM CONFIGURATIONS #================================================= # RESTORE THE PHP-FPM CONFIGURATION #================================================= ynh_script_progression --message="Restoring system configurations related to $app..." --weight=1 -# This should be a symetric version of what happens in the install script - 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 -yunohost service add $app --description="A federated shared agenda for local communities." --log="/var/log/$app/$app.log" -ynh_restore_file --origin_path="/etc/logrotate.d/$app" -# Other various files... +yunohost service add $app --description="Federated shared agenda for local communities" --log="/var/log/$app/$app.log" -ynh_restore_file --origin_path="/etc/cron.d/$app" -ynh_restore_file --origin_path="/etc/$app/" +ynh_restore_file --origin_path="/etc/logrotate.d/$app" #================================================= # GENERIC FINALIZATION @@ -69,7 +60,7 @@ ynh_restore_file --origin_path="/etc/$app/" ynh_script_progression --message="Reloading NGINX web server and $app's service..." --weight=1 # Typically you only have either $app or php-fpm but not both at the same time... -ynh_systemd_action --service_name=$app --action="start" --log_path="/var/log/$app/$app.log" +ynh_systemd_action --service_name=$app --action="start" --log_path="systemd" ynh_systemd_action --service_name=nginx --action=reload #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index ea11838..ada8243 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -1,8 +1,5 @@ #!/bin/bash -#### App file generated with YoloGen, the Yunohost app generator, version 0.6. -# This is the tutorial version of the app. -# It contains extra commands to explain what should be done in case you want to adjust some part of the script. -# Once you are done, you may remove them. + #================================================= # GENERIC START #================================================= @@ -12,59 +9,15 @@ source _common.sh source /usr/share/yunohost/helpers -# Settings are automatically loaded as bash variables -# in every app script context, therefore typically these will exist: -# - $domain -# - $path -# - $language -# - $install_dir -# - $port -# ... - -# In the context of upgrade, -# - resources are automatically provisioned / updated / deleted (depending on existing resources) -# - a safety backup is automatically created by the core and will be restored if the upgrade fails - -### This helper will compare the version of the currently installed app and the version of the upstream package. -### $upgrade_type can have 2 different values -### - UPGRADE_APP if the upstream app version has changed -### - UPGRADE_PACKAGE if only the YunoHost package has changed -### ynh_check_app_version_changed will stop the upgrade if the app is up to date. -### UPGRADE_APP should be used to upgrade the core app only if there's an upgrade to do. upgrade_type=$(ynh_check_app_version_changed) -#================================================= -# STANDARD UPGRADE STEPS -#================================================= -# ENSURE DOWNWARD COMPATIBILITY -#================================================= -#ynh_script_progression --message="Ensuring downward compatibility..." --weight=1 - -# -# N.B. : the followings setting migrations snippets are provided as *EXAMPLES* -# of what you may want to do in some cases (e.g. a setting was not defined on -# some legacy installs and you therefore want to initiaze stuff during upgrade) -# - -# If db_name doesn't exist, create it -#if [ -z "$db_name" ]; then -# db_name=$(ynh_sanitize_dbid --db_name=$app) -# ynh_app_setting_set --app=$app --key=db_name --value=$db_name -#fi - -# If install_dir doesn't exist, create it -#if [ -z "$install_dir" ]; then -# install_dir=/var/www/$app -# ynh_app_setting_set --app=$app --key=install_dir --value=$install_dir -#fi #================================================= # STOP SYSTEMD SERVICE #================================================= ynh_script_progression --message="Stopping a systemd service..." --weight=1 -ynh_systemd_action --service_name=$app --action="stop" --log_path="/var/log/$app/$app.log" -#================================================= -# "REBUILD" THE APP (DEPLOY NEW SOURCES, RERUN NPM BUILD...) +ynh_systemd_action --service_name=$app --action="stop" --log_path="systemd" + #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE #================================================= @@ -74,12 +27,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" + ynh_setup_source --dest_dir="$install_dir" --keep="config.json" fi -# $install_dir will automatically be initialized with some decent -# permission by default ... however, you may need to recursively reapply -# ownership to all files such as after the ynh_setup_source step chown -R $app:www-data "$install_dir" #================================================= @@ -100,28 +50,21 @@ ynh_add_nginx_config ynh_add_systemd_config -yunohost service add $app --description="A federated shared agenda for local communities." --log="/var/log/$app/$app.log" - ynh_use_logrotate --non-append +yunohost service add $app --description="Federated shared agenda for local communities" --log="/var/log/$app/$app.log" + #================================================= # RECONFIGURE THE APP (UPDATE CONF, APPLY MIGRATIONS...) #================================================= # UPDATE A CONFIG FILE #================================================= -ynh_script_progression --message="Updating a configuration file..." --weight=1 +#ynh_script_progression --message="Updating a configuration file..." --weight=1 -### Same as during install -### -### The file will automatically be backed-up if it's found to be manually modified (because -### ynh_add_config keeps track of the file's checksum) -ynh_add_config --template="config.json" --destination="$install_dir/config.json" +#ynh_add_config --template="config.json" --destination="$install_dir/config.json" -# FIXME: this should be handled by the core in the future -# You may need to use chmod 600 instead of 400, -# for example if the app is expected to be able to modify its own config -chmod 400 "$install_dir/some_config_file" -chown $app:$app "$install_dir/some_config_file" +#chmod 400 "$install_dir/config.json" +#chown $app:$app "$install_dir/config.json" #================================================= # CONFIGURE THE APP @@ -130,7 +73,7 @@ ynh_script_progression --message="Updating app dependencies..." --weight=15 pushd $install_dir ynh_use_nodejs - ynh_exec_warn_less ynh_exec_as $app $ynh_node_load_PATH yarn install # Install dependencies + ynh_exec_warn_less ynh_exec_as $app $ynh_node_load_PATH yarn install popd #================================================= @@ -138,7 +81,8 @@ popd #================================================= ynh_script_progression --message="Starting a systemd service..." --weight=1 -ynh_systemd_action --service_name=$app --action="start" --log_path="/var/log/$app/$app.log" +ynh_systemd_action --service_name=$app --action="start" --log_path="systemd" + #================================================= # END OF SCRIPT #================================================= From f80b9678941bf7680899d2067ab80c45c72d59ef Mon Sep 17 00:00:00 2001 From: yunohost-bot Date: Fri, 6 Oct 2023 11:52:39 +0000 Subject: [PATCH 2/8] Auto-update README --- README.md | 4 +--- README_fr.md | 5 +---- 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index c0e9ba3..70a2d00 100644 --- a/README.md +++ b/README.md @@ -16,9 +16,7 @@ If you don't have YunoHost, please consult [the guide](https://yunohost.org/#/in ## Overview -This app provide an online agenda open to contributions, and federated with the fediverse using ActivityPub. - -*Note that this package is still work in progress, don't consider it as stable.* +Gancio provide an online agenda open to contributions, and federated with the fediverse using ActivityPub. **Shipped version:** 1.6.17~ynh1 diff --git a/README_fr.md b/README_fr.md index 93b0422..3a0fda1 100644 --- a/README_fr.md +++ b/README_fr.md @@ -16,10 +16,7 @@ Si vous n’avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) po ## Vue d’ensemble -This app provide an online agenda open to contributions, and federated with the fediverse using ActivityPub. - -*Note that this package is still work in progress, don't consider it as stable.* - +Gancio propose un agenda en ligne ouvert aux contributions, et fédéré avec le fediverse via ActivityPub. **Version incluse :** 1.6.17~ynh1 From 6cccdf38254d2d689499baf65ac522c35d7582f7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Fri, 6 Oct 2023 14:25:09 +0200 Subject: [PATCH 3/8] fix --- scripts/install | 8 +++++--- scripts/restore | 7 ++++--- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/scripts/install b/scripts/install index 6f2115a..65cb3d0 100644 --- a/scripts/install +++ b/scripts/install @@ -39,11 +39,14 @@ ynh_add_nginx_config # Create a dedicated systemd config ynh_add_systemd_config -yunohost service add $app --description="Federated shared agenda for local communities" --log="/var/log/$app/$app.log" - # Use logrotate to manage application logfile(s) ynh_use_logrotate +mkdir -p /var/log/$app +chown $app -R /var/log/$app + +yunohost service add $app --description="Federated shared agenda for local communities" --log="/var/log/$app/$app.log" + #================================================= # APP INITIAL CONFIGURATION #================================================= @@ -55,7 +58,6 @@ ynh_add_config --template="config.json" --destination="$install_dir/config.json" chmod 400 "$install_dir/config.json" chown $app:$app "$install_dir/config.json" -chown $app:$app "/var/log/$app" #================================================= # INSTALL YARN AND APP diff --git a/scripts/restore b/scripts/restore index 4fb2375..5693046 100644 --- a/scripts/restore +++ b/scripts/restore @@ -18,6 +18,7 @@ ynh_script_progression --message="Restoring the app main directory..." --weight= ynh_restore_file --origin_path="$install_dir" chown -R $app:www-data "$install_dir" +chown $app:$app "/var/log/$app" #================================================= # RESTORE THE DATA DIRECTORY @@ -48,10 +49,10 @@ 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 -yunohost service add $app --description="Federated shared agenda for local communities" --log="/var/log/$app/$app.log" - ynh_restore_file --origin_path="/etc/logrotate.d/$app" +yunohost service add $app --description="Federated shared agenda for local communities" --log="/var/log/$app/$app.log" + #================================================= # GENERIC FINALIZATION #================================================= @@ -67,4 +68,4 @@ ynh_systemd_action --service_name=nginx --action=reload # END OF SCRIPT #================================================= -ynh_script_progression --message="Restoration completed for $app" --last \ No newline at end of file +ynh_script_progression --message="Restoration completed for $app" --last From 75fa92387d830da3f886d74e992babf9a9099dc7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Fri, 6 Oct 2023 14:40:47 +0200 Subject: [PATCH 4/8] Update restore --- scripts/restore | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/scripts/restore b/scripts/restore index 5693046..fddbb8b 100644 --- a/scripts/restore +++ b/scripts/restore @@ -18,7 +18,6 @@ ynh_script_progression --message="Restoring the app main directory..." --weight= ynh_restore_file --origin_path="$install_dir" chown -R $app:www-data "$install_dir" -chown $app:$app "/var/log/$app" #================================================= # RESTORE THE DATA DIRECTORY @@ -46,11 +45,14 @@ ynh_script_progression --message="Restoring system configurations related to $ap ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf" +mkdir -p /var/log/$app +chown $app -R /var/log/$app + ynh_restore_file --origin_path="/etc/systemd/system/$app.service" systemctl enable $app.service --quiet ynh_restore_file --origin_path="/etc/logrotate.d/$app" - +chown $app:$app "/var/log/$app" yunohost service add $app --description="Federated shared agenda for local communities" --log="/var/log/$app/$app.log" #================================================= From bc7513653181dc3e84c965dc1aa2d1b43bad10d7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Fri, 6 Oct 2023 15:02:39 +0200 Subject: [PATCH 5/8] Update restore --- scripts/restore | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/scripts/restore b/scripts/restore index fddbb8b..961e5f1 100644 --- a/scripts/restore +++ b/scripts/restore @@ -10,6 +10,14 @@ source ../settings/scripts/_common.sh source /usr/share/yunohost/helpers +#================================================= +# INSTALL DEPENDENCIES +#================================================= +ynh_script_progression --message="Installing dependencies..." --weight=10 + +# Install Nodejs +ynh_exec_warn_less ynh_install_nodejs --nodejs_version=$nodejs_version + #================================================= # RESTORE THE APP MAIN DIR #================================================= @@ -53,6 +61,7 @@ systemctl enable $app.service --quiet ynh_restore_file --origin_path="/etc/logrotate.d/$app" chown $app:$app "/var/log/$app" + yunohost service add $app --description="Federated shared agenda for local communities" --log="/var/log/$app/$app.log" #================================================= From 7fddf86e1c54a2b7c0bd351fac298e0e253d0aa8 Mon Sep 17 00:00:00 2001 From: lapineige Date: Sat, 7 Oct 2023 08:05:09 +0200 Subject: [PATCH 6/8] allow_email --- manifest.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/manifest.toml b/manifest.toml index 83179ab..1cc2df3 100644 --- a/manifest.toml +++ b/manifest.toml @@ -61,7 +61,7 @@ ram.runtime = "50M" sha256 = "fd9b0869d4c733c4b7de9f3bec0889918170822f1b12104ec32923c30648746f" [resources.system_user] - #allow_email = true + allow_email = true [resources.install_dir] @@ -81,4 +81,4 @@ ram.runtime = "50M" [resources.database] type = "postgresql" - \ No newline at end of file + From 6a990363cc6f93ce48f42f7f868fbb3a595d6f50 Mon Sep 17 00:00:00 2001 From: lapineige Date: Sat, 7 Oct 2023 08:05:36 +0200 Subject: [PATCH 7/8] more verbosity --- scripts/install | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/install b/scripts/install index 65cb3d0..4118fb1 100644 --- a/scripts/install +++ b/scripts/install @@ -62,7 +62,7 @@ chown $app:$app "$install_dir/config.json" #================================================= # INSTALL YARN AND APP #================================================= -ynh_script_progression --message="Installing app dependencies..." --weight=15 +ynh_script_progression --message="Installing app dependencies and creating admin user..." --weight=15 pushd $install_dir ynh_use_nodejs From 54723703d8b883f1c542817861bf19efa9f8112e Mon Sep 17 00:00:00 2001 From: lapineige Date: Sat, 7 Oct 2023 08:06:23 +0200 Subject: [PATCH 8/8] restore better comments --- scripts/upgrade | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/upgrade b/scripts/upgrade index ada8243..0f45e8f 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -73,7 +73,7 @@ ynh_script_progression --message="Updating app dependencies..." --weight=15 pushd $install_dir ynh_use_nodejs - ynh_exec_warn_less ynh_exec_as $app $ynh_node_load_PATH yarn install + ynh_exec_warn_less ynh_exec_as $app $ynh_node_load_PATH yarn install # Install/upgrade dependencies popd #=================================================