From a67bad40cfb21b07ed5e596f42f4b2458a4831f0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Tue, 15 Aug 2023 12:18:13 +0200 Subject: [PATCH 01/16] Update systemd.service --- conf/systemd.service | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conf/systemd.service b/conf/systemd.service index 077ba40..0cb538d 100644 --- a/conf/systemd.service +++ b/conf/systemd.service @@ -1,5 +1,5 @@ [Unit] -Description=Distbin Service +Description=Distbin: istributed pastebin After=network.target [Service] From 0d4e46a60b75f6195cb6c1794f242c1b83c12836 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Tue, 15 Aug 2023 12:19:13 +0200 Subject: [PATCH 02/16] v2 --- conf/.env | 2 +- conf/app.src | 7 ---- conf/systemd.service | 6 +-- manifest.toml | 57 ++++++++++++++++++++++++++++ scripts/_common.sh | 2 +- scripts/backup | 18 ++++----- scripts/change_url | 68 +++++++++++++++++---------------- scripts/install | 86 +++++++++++++++++++++--------------------- scripts/remove | 26 ++++++------- scripts/restore | 48 +++++++++++------------ scripts/upgrade | 90 ++++++++++++++++++++++---------------------- 11 files changed, 231 insertions(+), 179 deletions(-) delete mode 100644 conf/app.src create mode 100644 manifest.toml diff --git a/conf/.env b/conf/.env index b3f13b4..774fcdc 100644 --- a/conf/.env +++ b/conf/.env @@ -5,7 +5,7 @@ PATH=__YNH_NODE_LOAD_PATH__ PORT=__PORT__ # The directory where is store the database -DB_DIR=__DATADIR__/distbin-db +DB_DIR=__DATA_DIR__/distbin-db # The external URL EXTERNAL_URL=https://__DOMAIN____PATH__/ diff --git a/conf/app.src b/conf/app.src deleted file mode 100644 index 84e6716..0000000 --- a/conf/app.src +++ /dev/null @@ -1,7 +0,0 @@ -SOURCE_URL=https://github.com/gobengo/distbin/archive/v1.3.0.tar.gz -SOURCE_SUM=65d9774cafbb5829b82d09b0ea0d3d5d1ec5f076fadef2b8576d29a901c58a90 -SOURCE_SUM_PRG=sha256sum -SOURCE_FORMAT=tar.gz -SOURCE_IN_SUBDIR=true -SOURCE_FILENAME= -SOURCE_EXTRACT=true diff --git a/conf/systemd.service b/conf/systemd.service index 0cb538d..6ae5c23 100644 --- a/conf/systemd.service +++ b/conf/systemd.service @@ -6,12 +6,12 @@ After=network.target Type=simple User=__APP__ Group=__APP__ -WorkingDirectory=__FINALPATH__/ -ExecStart=__YNH_NODE__ __FINALPATH__/dist/bin/server >> +WorkingDirectory=__INSTALL_DIR__/ +ExecStart=__YNH_NODE__ __INSTALL_DIR__/dist/bin/server >> StandardOutput=append:/var/log/__APP__/__APP__.log StandardError=inherit Restart=always -EnvironmentFile=__FINALPATH__/.env +EnvironmentFile=__INSTALL_DIR__/.env # 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..6e9f617 --- /dev/null +++ b/manifest.toml @@ -0,0 +1,57 @@ +packaging_format = 2 + +id = "distbin" +name = "Distbin" +description.en = "Distributed pastebin with ActivityPub." +description.fr = "Pastebin distribué utilisant le protocole ActivityPub." + +version = "1.3.0~ynh12" + +maintainers = ["yalh76"] + +[upstream] +license = "Apache-2.0" +website = "https://distbin.com/about" +demo = "https://distbin.com/" +code = "https://github.com/gobengo/distbin" +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 = ">= 4.3.0" +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 = "/distbin" + + [install.init_main_permission] + type = "group" + default = "visitors" + +[resources] + [resources.sources.main] + url = "https://github.com/gobengo/distbin/archive/v1.3.0.tar.gz" + sha256 = "65d9774cafbb5829b82d09b0ea0d3d5d1ec5f076fadef2b8576d29a901c58a90" + + + [resources.system_user] + + [resources.install_dir] + + [resources.data_dir] + + [resources.permissions] + main.url = "/" diff --git a/scripts/_common.sh b/scripts/_common.sh index f1abfde..43c8346 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -5,7 +5,7 @@ #================================================= # dependencies used by the app -pkg_dependencies="ca-certificates curl rsync" +#REMOVEME? pkg_dependencies="ca-certificates curl rsync" NODEJS_VERSION=10 diff --git a/scripts/backup b/scripts/backup index 26abcf6..0fa59ca 100644 --- a/scripts/backup +++ b/scripts/backup @@ -14,22 +14,22 @@ source /usr/share/yunohost/helpers # MANAGE SCRIPT FAILURE #================================================= -ynh_clean_setup () { +#REMOVEME? ynh_clean_setup () { ynh_clean_check_starting } # 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 @@ -40,13 +40,13 @@ 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 DATA DIR #================================================= -ynh_backup --src_path="$datadir" --is_big +ynh_backup --src_path="$data_dir" --is_big #================================================= # BACKUP THE NGINX CONFIGURATION diff --git a/scripts/change_url b/scripts/change_url index 781a0db..5cd6453 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -13,55 +13,55 @@ source /usr/share/yunohost/helpers # RETRIEVE ARGUMENTS #================================================= -old_domain=$YNH_APP_OLD_DOMAIN -old_path=$YNH_APP_OLD_PATH +#REMOVEME? old_domain=$YNH_APP_OLD_DOMAIN +#REMOVEME? old_path=$YNH_APP_OLD_PATH -new_domain=$YNH_APP_NEW_DOMAIN -new_path=$YNH_APP_NEW_PATH +#REMOVEME? new_domain=$YNH_APP_NEW_DOMAIN +#REMOVEME? new_path=$YNH_APP_NEW_PATH -app=$YNH_APP_INSTANCE_NAME +#REMOVEME? app=$YNH_APP_INSTANCE_NAME #================================================= # LOAD SETTINGS #================================================= -ynh_script_progression --message="Loading installation settings..." +#REMOVEME? ynh_script_progression --message="Loading installation settings..." -# 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) +#REMOVEME? # Needed for helper "ynh_add_nginx_config" +#REMOVEME? #REMOVEME? install_dir=$(ynh_app_setting_get --app=$app --key=install_dir) +#REMOVEME? port=$(ynh_app_setting_get --app=$app --key=port) #================================================= # BACKUP BEFORE CHANGE URL THEN ACTIVE TRAP #================================================= -ynh_script_progression --message="Backing up the app before changing its URL (may take a while)..." +#REMOVEME? ynh_script_progression --message="Backing up the app before changing its URL (may take a while)..." # Backup the current version of the app -ynh_backup_before_upgrade -ynh_clean_setup () { - ynh_clean_check_starting +#REMOVEME? ynh_backup_before_upgrade +#REMOVEME? ynh_clean_setup () { + #REMOVEME? ynh_clean_check_starting # 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" +#REMOVEME? ynh_secure_remove --file="/etc/nginx/conf.d/$new_domain.d/$app.conf" # 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 #================================================= # CHECK WHICH PARTS SHOULD BE CHANGED #================================================= -change_domain=0 -if [ "$old_domain" != "$new_domain" ] +#REMOVEME? change_domain=0 +#REMOVEME? if [ "$old_domain" != "$new_domain" ] then - change_domain=1 + #REMOVEME? change_domain=1 fi -change_path=0 -if [ "$old_path" != "$new_path" ] +#REMOVEME? change_path=0 +#REMOVEME? if [ "$old_path" != "$new_path" ] then - change_path=1 + #REMOVEME? change_path=1 fi #================================================= @@ -78,28 +78,30 @@ ynh_systemd_action --service_name=$app --action="stop" --log_path=systemd --line #================================================= ynh_script_progression --message="Updating NGINX web server configuration..." -nginx_conf_path=/etc/nginx/conf.d/$old_domain.d/$app.conf +ynh_change_url_nginx_config + +#REMOVEME? nginx_conf_path=/etc/nginx/conf.d/$old_domain.d/$app.conf # 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" +#REMOVEME? ynh_backup_if_checksum_is_different --file="$nginx_conf_path" # Set global variables for NGINX helper - domain="$old_domain" - path_url="$new_path" +#REMOVEME? domain="$old_domain" +#REMOVEME? path="$new_path" # Create a dedicated NGINX config - ynh_add_nginx_config +#REMOVEME? ynh_add_nginx_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 +#REMOVEME? ynh_delete_file_checksum --file="$nginx_conf_path" +#REMOVEME? 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" +#REMOVEME? ynh_store_file_checksum --file="/etc/nginx/conf.d/$new_domain.d/$app.conf" fi #================================================= @@ -109,7 +111,7 @@ fi #================================================= ynh_print_info --message="Modifying config file..." -config="$final_path/.env" +config="$install_dir/.env" ynh_backup_if_checksum_is_different --file="$config" # Change the URL in the configuration file @@ -148,9 +150,9 @@ fi #================================================= # RELOAD NGINX #================================================= -ynh_script_progression --message="Reloading NGINX web server..." +#REMOVEME? ynh_script_progression --message="Reloading NGINX web server..." -ynh_systemd_action --service_name=nginx --action=reload +#REMOVEME? #REMOVEME? ynh_systemd_action --service_name=nginx --action=reload #================================================= # END OF SCRIPT diff --git a/scripts/install b/scripts/install index 9cbe80d..8d03b67 100644 --- a/scripts/install +++ b/scripts/install @@ -13,80 +13,80 @@ source /usr/share/yunohost/helpers # MANAGE SCRIPT FAILURE #================================================= -ynh_clean_setup () { +#REMOVEME? ynh_clean_setup () { ynh_clean_check_starting } # 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..." +#REMOVEME? ynh_script_progression --message="Validating installation parameters..." -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..." +#REMOVEME? ynh_script_progression --message="Storing installation settings..." -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..." +#REMOVEME? ynh_script_progression --message="Finding an available port..." # 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 #================================================= # INSTALL DEPENDENCIES #================================================= -ynh_script_progression --message="Installing dependencies..." +#REMOVEME? ynh_script_progression --message="Installing dependencies..." -ynh_install_app_dependencies $pkg_dependencies +#REMOVEME? ynh_install_app_dependencies $pkg_dependencies ynh_install_nodejs --nodejs_version=$NODEJS_VERSION #================================================= # CREATE DEDICATED USER #================================================= -ynh_script_progression --message="Configuring system user..." +#REMOVEME? ynh_script_progression --message="Configuring system user..." # 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..." -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" +ynh_setup_source --dest_dir="$install_dir" -chmod 750 "$final_path" -chmod -R o-rwx "$final_path" -chown -R $app:$app "$final_path" +chmod 750 "$install_dir" +chmod -R o-rwx "$install_dir" +chown -R $app:$app "$install_dir" #================================================= # NGINX CONFIGURATION @@ -103,14 +103,14 @@ ynh_add_nginx_config #================================================= ynh_script_progression --message="Installing Distbin..." -pushd $final_path +pushd $install_dir ynh_use_nodejs ynh_exec_warn_less ynh_exec_as $app $ynh_node_load_PATH $ynh_npm install --ignore-scripts ynh_exec_warn_less ynh_exec_as $app $ynh_node_load_PATH $ynh_npm run build ynh_exec_warn_less ynh_exec_as $app cp -af package* dist/ popd -pushd $final_path/dist +pushd $install_dir/dist ynh_exec_warn_less ynh_exec_as $app $ynh_node_load_PATH $ynh_npm install --ignore-scripts --production popd @@ -130,26 +130,26 @@ chown -R $app:$app "/var/log/$app" #================================================= ynh_script_progression --message="Creating a data directory..." -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/distbin-db" -mkdir -p "$datadir/distbin-db/activities" -mkdir -p "$datadir/distbin-db/inbox" +mkdir -p "$data_dir/distbin-db" +mkdir -p "$data_dir/distbin-db/activities" +mkdir -p "$data_dir/distbin-db/inbox" -chmod 750 "$datadir" -chmod -R o-rwx "$datadir" -chown -R $app:$app "$datadir" +chmod 750 "$data_dir" +chmod -R o-rwx "$data_dir" +chown -R $app:$app "$data_dir" #================================================= # ADD A CONFIGURATION #================================================= ynh_script_progression --message="Adding a configuration file..." -ynh_add_config --template="../conf/.env" --destination="$final_path/.env" +ynh_add_config --template="../conf/.env" --destination="$install_dir/.env" -chmod 400 "$final_path/.env" -chown $app:$app "$final_path/.env" +chmod 400 "$install_dir/.env" +chown $app:$app "$install_dir/.env" #================================================= # SETUP SYSTEMD @@ -191,22 +191,22 @@ fi #================================================= # SETUP SSOWAT #================================================= -ynh_script_progression --message="Configuring permissions..." +#REMOVEME? ynh_script_progression --message="Configuring permissions..." # Make app public if necessary -if [ $is_public -eq 1 ] +#REMOVEME? if [ $is_public -eq 1 ] then # Everyone can access the app. # The "main" permission is automatically created before the install script. - 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..." +#REMOVEME? ynh_script_progression --message="Reloading NGINX web server..." -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 c72cefc..df10513 100644 --- a/scripts/remove +++ b/scripts/remove @@ -12,14 +12,14 @@ source /usr/share/yunohost/helpers #================================================= # LOAD SETTINGS #================================================= -ynh_script_progression --message="Loading installation settings..." +#REMOVEME? ynh_script_progression --message="Loading installation settings..." -app=$YNH_APP_INSTANCE_NAME +#REMOVEME? app=$YNH_APP_INSTANCE_NAME -domain=$(ynh_app_setting_get --app=$app --key=domain) -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? 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) #================================================= # STANDARD REMOVE @@ -53,10 +53,10 @@ ynh_remove_logrotate #================================================= # REMOVE APP MAIN DIR #================================================= -ynh_script_progression --message="Removing app main directory..." +#REMOVEME? ynh_script_progression --message="Removing app main directory..." # Remove the app directory securely -ynh_secure_remove --file="$final_path" +#REMOVEME? ynh_secure_remove --file="$install_dir" #================================================= # REMOVE DATA DIR @@ -66,7 +66,7 @@ ynh_secure_remove --file="$final_path" if [ "${YNH_APP_PURGE:-0}" -eq 1 ] then ynh_script_progression --message="Removing app data directory..." - ynh_secure_remove --file="$datadir" +#REMOVEME? ynh_secure_remove --file="$data_dir" fi #================================================= @@ -80,11 +80,11 @@ ynh_remove_nginx_config #================================================= # REMOVE DEPENDENCIES #================================================= -ynh_script_progression --message="Removing dependencies..." +#REMOVEME? ynh_script_progression --message="Removing dependencies..." # Remove metapackage and its dependencies ynh_remove_nodejs -ynh_remove_app_dependencies +#REMOVEME? ynh_remove_app_dependencies #================================================= # SPECIFIC REMOVE @@ -101,10 +101,10 @@ ynh_secure_remove --file="/var/log/$app" #================================================= # REMOVE DEDICATED USER #================================================= -ynh_script_progression --message="Removing the dedicated system user..." +#REMOVEME? ynh_script_progression --message="Removing the dedicated system user..." # 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 793c6fa..9db0999 100644 --- a/scripts/restore +++ b/scripts/restore @@ -14,31 +14,31 @@ source /usr/share/yunohost/helpers # MANAGE SCRIPT FAILURE #================================================= -ynh_clean_setup () { +#REMOVEME? ynh_clean_setup () { ynh_clean_check_starting } # 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..." +#REMOVEME? ynh_script_progression --message="Loading installation settings..." -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..." +#REMOVEME? ynh_script_progression --message="Validating restoration parameters..." -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 @@ -52,34 +52,34 @@ 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..." +#REMOVEME? ynh_script_progression --message="Recreating the dedicated system user..." # 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..." -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:$app "$final_path" +chmod 750 "$install_dir" +chmod -R o-rwx "$install_dir" +chown -R $app:$app "$install_dir" #================================================= # RESTORE THE DATA DIRECTORY #================================================= ynh_script_progression --message="Restoring the data directory..." -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" #================================================= # CREATE LOG FOLDER @@ -97,10 +97,10 @@ chown -R $app:$app "/var/log/$app" #================================================= # REINSTALL DEPENDENCIES #================================================= -ynh_script_progression --message="Reinstalling dependencies..." +#REMOVEME? ynh_script_progression --message="Reinstalling dependencies..." # Define and install dependencies -ynh_install_app_dependencies $pkg_dependencies +#REMOVEME? ynh_install_app_dependencies $pkg_dependencies ynh_install_nodejs --nodejs_version=$NODEJS_VERSION #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index 44140c9..45ffbe1 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..." +#REMOVEME? ynh_script_progression --message="Loading installation settings..." -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) -port=$(ynh_app_setting_get --app=$app --key=port) -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? port=$(ynh_app_setting_get --app=$app --key=port) +#REMOVEME? data_dir=$(ynh_app_setting_get --app=$app --key=data_dir) #================================================= # CHECK VERSION @@ -32,17 +32,17 @@ 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)..." +#REMOVEME? ynh_script_progression --message="Backing up the app before upgrading (may take a while)..." # Backup the current version of the app -ynh_backup_before_upgrade -ynh_clean_setup () { +#REMOVEME? ynh_backup_before_upgrade +#REMOVEME? ynh_clean_setup () { ynh_clean_check_starting # 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 @@ -59,48 +59,48 @@ ynh_systemd_action --service_name=$app --action="stop" --log_path=systemd --line ynh_script_progression --message="Ensuring downward compatibility..." # Cleaning legacy permissions -if ynh_legacy_permissions_exists; then - ynh_legacy_permissions_delete_all +#REMOVEME? if ynh_legacy_permissions_exists; then +#REMOVEME? ynh_legacy_permissions_delete_all ynh_app_setting_delete --app=$app --key=is_public fi ynh_script_progression --message="Creating storage folder..." -if [ -z "$datadir" ]; then - datadir=/home/yunohost.app/$app - ynh_app_setting_set --app=$app --key=datadir --value=$datadir +if [ -z "$data_dir" ]; then + data_dir=/home/yunohost.app/$app +#REMOVEME? ynh_app_setting_set --app=$app --key=data_dir --value=$data_dir fi -mkdir -p "$datadir/distbin-db/" +mkdir -p "$data_dir/distbin-db/" # Move old db -if [ -d "$final_path/db/" ]; then - rsync -arz "$final_path/db/" "$datadir/distbin-db/" --delete-after --remove-source-files - ynh_secure_remove --file="$final_path/db" +if [ -d "$install_dir/db/" ]; then + rsync -arz "$install_dir/db/" "$data_dir/distbin-db/" --delete-after --remove-source-files +#REMOVEME? ynh_secure_remove --file="$install_dir/db" fi # Move old db -if [ -d "$final_path/distbin-db/" ]; then - if [ -d "$final_path/distbin-db/db/" ]; then - rsync -arz "$final_path/distbin-db/db/" "$datadir/distbin-db/" --delete-after --remove-source-files - ynh_secure_remove --file="$final_path/distbin-db/db" +if [ -d "$install_dir/distbin-db/" ]; then + if [ -d "$install_dir/distbin-db/db/" ]; then + rsync -arz "$install_dir/distbin-db/db/" "$data_dir/distbin-db/" --delete-after --remove-source-files +#REMOVEME? ynh_secure_remove --file="$install_dir/distbin-db/db" fi - rsync -arz "$final_path/distbin-db/" "$datadir/distbin-db/" --delete-after --remove-source-files - ynh_secure_remove --file="$final_path/distbin-db" + rsync -arz "$install_dir/distbin-db/" "$data_dir/distbin-db/" --delete-after --remove-source-files +#REMOVEME? ynh_secure_remove --file="$install_dir/distbin-db" fi -chmod 750 "$datadir" -chmod -R o-rwx "$datadir" -chown -R $app:$app "$datadir" +chmod 750 "$data_dir" +chmod -R o-rwx "$data_dir" +chown -R $app:$app "$data_dir" #================================================= # CREATE DEDICATED USER #================================================= -ynh_script_progression --message="Making sure dedicated system user exists..." +#REMOVEME? ynh_script_progression --message="Making sure dedicated system user exists..." # 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 @@ -111,12 +111,12 @@ then ynh_script_progression --message="Upgrading source files..." # Download, check integrity, uncompress and patch the source from app.src - ynh_setup_source --dest_dir="$final_path" + ynh_setup_source --dest_dir="$install_dir" fi -chmod 750 "$final_path" -chmod -R o-rwx "$final_path" -chown -R $app:$app "$final_path" +chmod 750 "$install_dir" +chmod -R o-rwx "$install_dir" +chown -R $app:$app "$install_dir" #================================================= # NGINX CONFIGURATION @@ -129,9 +129,9 @@ ynh_add_nginx_config #================================================= # UPGRADE DEPENDENCIES #================================================= -ynh_script_progression --message="Upgrading dependencies..." +#REMOVEME? ynh_script_progression --message="Upgrading dependencies..." -ynh_install_app_dependencies $pkg_dependencies +#REMOVEME? ynh_install_app_dependencies $pkg_dependencies ynh_install_nodejs --nodejs_version=$NODEJS_VERSION #================================================= @@ -152,14 +152,14 @@ chown -R $app:$app "/var/log/$app" #================================================= ynh_script_progression --message="Making upgrade..." -pushd $final_path +pushd $install_dir ynh_use_nodejs ynh_exec_warn_less ynh_exec_as $app $ynh_node_load_PATH $ynh_npm install --ignore-scripts ynh_exec_warn_less ynh_exec_as $app $ynh_node_load_PATH $ynh_npm run build ynh_exec_warn_less ynh_exec_as $app cp -af package* dist/ popd -pushd $final_path/dist +pushd $install_dir/dist ynh_exec_warn_less ynh_exec_as $app $ynh_node_load_PATH $ynh_npm install --ignore-scripts --production popd @@ -168,10 +168,10 @@ popd #================================================= ynh_script_progression --message="Updating a config file..." -ynh_add_config --template="../conf/.env" --destination="$final_path/.env" +ynh_add_config --template="../conf/.env" --destination="$install_dir/.env" -chmod 400 "$final_path/.env" -chown $app:$app "$final_path/.env" +chmod 400 "$install_dir/.env" +chown $app:$app "$install_dir/.env" #================================================= # SETUP SYSTEMD @@ -212,9 +212,9 @@ fi #================================================= # RELOAD NGINX #================================================= -ynh_script_progression --message="Reloading NGINX web server..." +#REMOVEME? ynh_script_progression --message="Reloading NGINX web server..." -ynh_systemd_action --service_name=nginx --action=reload +#REMOVEME? ynh_systemd_action --service_name=nginx --action=reload #================================================= # END OF SCRIPT From b04c004f299d73cf14ccb53551e5f107ef03fc24 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Tue, 15 Aug 2023 12:31:35 +0200 Subject: [PATCH 03/16] v2 --- manifest.json | 47 -------------- manifest.toml | 25 ++++---- scripts/_common.sh | 3 - scripts/install | 153 +++++---------------------------------------- scripts/remove | 69 -------------------- scripts/restore | 77 +---------------------- 6 files changed, 30 insertions(+), 344 deletions(-) delete mode 100644 manifest.json diff --git a/manifest.json b/manifest.json deleted file mode 100644 index 6ebef2a..0000000 --- a/manifest.json +++ /dev/null @@ -1,47 +0,0 @@ -{ - "name": "Distbin", - "id": "distbin", - "packaging_format": 1, - "description": { - "en": "Distributed pastebin with ActivityPub.", - "fr": "Pastebin distribué utilisant le protocole ActivityPub." - }, - "version": "1.3.0~ynh12", - "url": "https://distbin.com", - "upstream": { - "license": "Apache-2.0", - "website": "https://distbin.com/about", - "demo": "https://distbin.com/", - "code": "https://github.com/gobengo/distbin" - }, - "license": "Apache-2.0", - "maintainer": { - "name": "yalh76" - }, - "requirements": { - "yunohost": ">= 4.3.0" - }, - "multi_instance": true, - "services": [ - "nginx" - ], - "arguments": { - "install" : [ - { - "name": "domain", - "type": "domain" - }, - { - "name": "path", - "type": "path", - "example": "/distbin", - "default": "/distbin" - }, - { - "name": "is_public", - "type": "boolean", - "default": true - } - ] - } -} diff --git a/manifest.toml b/manifest.toml index 6e9f617..4c9f335 100644 --- a/manifest.toml +++ b/manifest.toml @@ -14,26 +14,22 @@ license = "Apache-2.0" website = "https://distbin.com/about" demo = "https://distbin.com/" code = "https://github.com/gobengo/distbin" -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 = ">= 4.3.0" -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"] +yunohost = ">= 11.2" +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 = false +sso = false +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 = "/distbin" @@ -46,12 +42,17 @@ ram.runtime = "50M" # FIXME: replace with an **estimate** minimum ram requiremen url = "https://github.com/gobengo/distbin/archive/v1.3.0.tar.gz" sha256 = "65d9774cafbb5829b82d09b0ea0d3d5d1ec5f076fadef2b8576d29a901c58a90" - [resources.system_user] + [resources.ports] + [resources.install_dir] [resources.data_dir] + subdirs =["distbin-db, distbin-db/activities, distbin-db/inbox"] [resources.permissions] main.url = "/" + + [resources.apt] + packages = "ca-certificates curl rsync" diff --git a/scripts/_common.sh b/scripts/_common.sh index 43c8346..5737a2c 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -4,9 +4,6 @@ # COMMON VARIABLES #================================================= -# dependencies used by the app -#REMOVEME? pkg_dependencies="ca-certificates curl rsync" - NODEJS_VERSION=10 #================================================= diff --git a/scripts/install b/scripts/install index 8d03b67..a8830b9 100644 --- a/scripts/install +++ b/scripts/install @@ -9,93 +9,44 @@ source _common.sh source /usr/share/yunohost/helpers -#================================================= -# MANAGE SCRIPT FAILURE -#================================================= - -#REMOVEME? ynh_clean_setup () { - ynh_clean_check_starting -} -# 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..." - -#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..." - -#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..." - -# Find an available port -#REMOVEME? port=$(ynh_find_port --port=8095) -#REMOVEME? ynh_app_setting_set --app=$app --key=port --value=$port - #================================================= # INSTALL DEPENDENCIES #================================================= -#REMOVEME? ynh_script_progression --message="Installing dependencies..." +ynh_script_progression --message="Installing dependencies..." -#REMOVEME? ynh_install_app_dependencies $pkg_dependencies ynh_install_nodejs --nodejs_version=$NODEJS_VERSION -#================================================= -# CREATE DEDICATED USER -#================================================= -#REMOVEME? ynh_script_progression --message="Configuring system user..." - -# 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..." -#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" -chmod 750 "$install_dir" chmod -R o-rwx "$install_dir" chown -R $app:$app "$install_dir" #================================================= -# NGINX CONFIGURATION +# SETUP SYSTEMD #================================================= -ynh_script_progression --message="Configuring NGINX web server..." +ynh_script_progression --message="Configuring a systemd service..." # Create a dedicated NGINX config ynh_add_nginx_config +# Create a dedicated systemd config +ynh_add_systemd_config + +# Use logrotate to manage application logfile(s) +ynh_use_logrotate + +yunohost service add $app --description="Distributed pastebin" --log="/var/log/$app/$app.log" + +mkdir -p "/var/log/$app" +chmod 750 "/var/log/$app" +chmod -R o-rwx "/var/log/$app" +chown -R $app:$app "/var/log/$app" + #================================================= # SPECIFIC SETUP #================================================= @@ -114,33 +65,6 @@ pushd $install_dir/dist ynh_exec_warn_less ynh_exec_as $app $ynh_node_load_PATH $ynh_npm install --ignore-scripts --production popd -#================================================= -# CREATE LOG DIRECTORY -#================================================= -ynh_script_progression --message="Creating log folder..." - -mkdir -p "/var/log/$app" - -chmod 750 "/var/log/$app" -chmod -R o-rwx "/var/log/$app" -chown -R $app:$app "/var/log/$app" - -#================================================= -# CREATE DATA DIRECTORY -#================================================= -ynh_script_progression --message="Creating a data directory..." - -#REMOVEME? data_dir=/home/yunohost.app/$app -#REMOVEME? ynh_app_setting_set --app=$app --key=data_dir --value=$data_dir - -mkdir -p "$data_dir/distbin-db" -mkdir -p "$data_dir/distbin-db/activities" -mkdir -p "$data_dir/distbin-db/inbox" - -chmod 750 "$data_dir" -chmod -R o-rwx "$data_dir" -chown -R $app:$app "$data_dir" - #================================================= # ADD A CONFIGURATION #================================================= @@ -151,31 +75,6 @@ ynh_add_config --template="../conf/.env" --destination="$install_dir/.env" chmod 400 "$install_dir/.env" chown $app:$app "$install_dir/.env" -#================================================= -# SETUP SYSTEMD -#================================================= -ynh_script_progression --message="Configuring a systemd service..." - -# Create a dedicated systemd config -ynh_add_systemd_config - -#================================================= -# GENERIC FINALIZATION -#================================================= -# SETUP LOGROTATE -#================================================= -ynh_script_progression --message="Configuring log rotation..." - -# Use logrotate to manage application logfile(s) -ynh_use_logrotate - -#================================================= -# INTEGRATE SERVICE IN YUNOHOST -#================================================= -ynh_script_progression --message="Integrating service in YunoHost..." - -yunohost service add $app --description="Distributed pastebin" --log="/var/log/$app/$app.log" - #================================================= # START SYSTEMD SERVICE #================================================= @@ -188,26 +87,6 @@ if [ ${PACKAGE_CHECK_EXEC:-0} -eq 1 ]; then sleep 60 fi -#================================================= -# SETUP SSOWAT -#================================================= -#REMOVEME? ynh_script_progression --message="Configuring permissions..." - -# Make app public if necessary -#REMOVEME? if [ $is_public -eq 1 ] -then - # Everyone can access the app. - # The "main" permission is automatically created before the install script. -#REMOVEME? ynh_permission_update --permission="main" --add="visitors" -fi - -#================================================= -# RELOAD NGINX -#================================================= -#REMOVEME? ynh_script_progression --message="Reloading NGINX web server..." - -#REMOVEME? ynh_systemd_action --service_name=nginx --action=reload - #================================================= # END OF SCRIPT #================================================= diff --git a/scripts/remove b/scripts/remove index df10513..f0f5cad 100644 --- a/scripts/remove +++ b/scripts/remove @@ -9,18 +9,6 @@ source _common.sh source /usr/share/yunohost/helpers -#================================================= -# LOAD SETTINGS -#================================================= -#REMOVEME? ynh_script_progression --message="Loading installation settings..." - -#REMOVEME? app=$YNH_APP_INSTANCE_NAME - -#REMOVEME? domain=$(ynh_app_setting_get --app=$app --key=domain) -#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) - #================================================= # STANDARD REMOVE #================================================= @@ -34,78 +22,21 @@ then yunohost service remove $app fi -#================================================= -# STOP AND REMOVE SERVICE -#================================================= -ynh_script_progression --message="Stopping and removing the systemd service..." - # Remove the dedicated systemd config ynh_remove_systemd_config -#================================================= -# REMOVE LOGROTATE CONFIGURATION -#================================================= -ynh_script_progression --message="Removing logrotate configuration..." - # Remove the app-specific logrotate config ynh_remove_logrotate -#================================================= -# REMOVE APP MAIN DIR -#================================================= -#REMOVEME? ynh_script_progression --message="Removing app main directory..." - -# 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..." -#REMOVEME? ynh_secure_remove --file="$data_dir" -fi - -#================================================= -# REMOVE NGINX CONFIGURATION -#================================================= -ynh_script_progression --message="Removing NGINX web server configuration..." - # Remove the dedicated NGINX config ynh_remove_nginx_config -#================================================= -# REMOVE DEPENDENCIES -#================================================= -#REMOVEME? ynh_script_progression --message="Removing dependencies..." - # Remove metapackage and its dependencies ynh_remove_nodejs -#REMOVEME? ynh_remove_app_dependencies - -#================================================= -# SPECIFIC REMOVE -#================================================= -# REMOVE VARIOUS FILES -#================================================= -ynh_script_progression --message="Removing various files..." # Remove the log files ynh_secure_remove --file="/var/log/$app" -#================================================= -# GENERIC FINALIZATION -#================================================= -# REMOVE DEDICATED USER -#================================================= -#REMOVEME? ynh_script_progression --message="Removing the dedicated system user..." - -# Delete a system user -#REMOVEME? ynh_system_user_delete --username=$app - #================================================= # END OF SCRIPT #================================================= diff --git a/scripts/restore b/scripts/restore index 9db0999..6f81649 100644 --- a/scripts/restore +++ b/scripts/restore @@ -10,53 +10,6 @@ source ../settings/scripts/_common.sh source /usr/share/yunohost/helpers -#================================================= -# MANAGE SCRIPT FAILURE -#================================================= - -#REMOVEME? ynh_clean_setup () { - ynh_clean_check_starting -} -# 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..." - -#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..." - -#REMOVEME? test ! -d $install_dir \ - || ynh_die --message="There is already a directory: $install_dir " - -#================================================= -# STANDARD RESTORATION STEPS -#================================================= -# RESTORE THE NGINX CONFIGURATION -#================================================= -ynh_script_progression --message="Restoring the NGINX web server configuration..." - -ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf" - -#================================================= -# RECREATE THE DEDICATED USER -#================================================= -#REMOVEME? ynh_script_progression --message="Recreating the dedicated system user..." - -# Create the dedicated user (if not existing) -#REMOVEME? ynh_system_user_create --username=$app --home_dir=$install_dir - #================================================= # RESTORE THE APP MAIN DIR #================================================= @@ -64,7 +17,6 @@ ynh_script_progression --message="Restoring the app main directory..." ynh_restore_file --origin_path="$install_dir" -chmod 750 "$install_dir" chmod -R o-rwx "$install_dir" chown -R $app:$app "$install_dir" @@ -75,10 +27,6 @@ ynh_script_progression --message="Restoring the data directory..." 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" #================================================= @@ -87,42 +35,19 @@ chown -R $app:www-data "$data_dir" ynh_script_progression --message="Creating log folder..." mkdir -p "/var/log/$app" - chmod 750 "/var/log/$app" chmod -R o-rwx "/var/log/$app" chown -R $app:$app "/var/log/$app" -#================================================= -# SPECIFIC RESTORATION -#================================================= -# REINSTALL DEPENDENCIES -#================================================= -#REMOVEME? ynh_script_progression --message="Reinstalling dependencies..." +ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf" -# Define and install dependencies -#REMOVEME? ynh_install_app_dependencies $pkg_dependencies ynh_install_nodejs --nodejs_version=$NODEJS_VERSION -#================================================= -# RESTORE SYSTEMD -#================================================= -ynh_script_progression --message="Restoring the systemd configuration..." - 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..." - ynh_restore_file --origin_path="/etc/logrotate.d/$app" -#================================================= -# INTEGRATE SERVICE IN YUNOHOST -#================================================= -ynh_script_progression --message="Integrating service in YunoHost..." - yunohost service add $app --description="Distributed pastebin" --log="/var/log/$app/$app.log" #================================================= From d0e60547bda3c411e47f655bea45035c466578ff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Tue, 15 Aug 2023 12:34:42 +0200 Subject: [PATCH 04/16] fix --- conf/systemd.service | 2 +- doc/DESCRIPTION.md | 8 ---- scripts/upgrade | 104 ------------------------------------------- 3 files changed, 1 insertion(+), 113 deletions(-) diff --git a/conf/systemd.service b/conf/systemd.service index 6ae5c23..08af0f9 100644 --- a/conf/systemd.service +++ b/conf/systemd.service @@ -1,5 +1,5 @@ [Unit] -Description=Distbin: istributed pastebin +Description=Distbin: distributed pastebin After=network.target [Service] diff --git a/doc/DESCRIPTION.md b/doc/DESCRIPTION.md index a675b91..9eac0c8 100644 --- a/doc/DESCRIPTION.md +++ b/doc/DESCRIPTION.md @@ -1,11 +1,3 @@ A distributed pastebin. i.e. it is a service where anyone can post things on the web, and others can react by posting anywhere else on the web (including here). A networked place to store posted web documents. This is meant to allow for distributed social commentary and reaction around these documents using best practices recommended or noted by the W3C Social Web Working Group. - -### Features - -- Ut enim ad minim veniam, quis nostrud exercitation ullamco ; -- Laboris nisi ut aliquip ex ea commodo consequat ; -- Duis aute irure dolor in reprehenderit in voluptate ; -- Velit esse cillum dolore eu fugiat nulla pariatur ; -- Excepteur sint occaecat cupidatat non proident, sunt in culpa." diff --git a/scripts/upgrade b/scripts/upgrade index 45ffbe1..511e954 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -9,41 +9,12 @@ source _common.sh source /usr/share/yunohost/helpers -#================================================= -# LOAD SETTINGS -#================================================= -#REMOVEME? ynh_script_progression --message="Loading installation settings..." - -#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? port=$(ynh_app_setting_get --app=$app --key=port) -#REMOVEME? data_dir=$(ynh_app_setting_get --app=$app --key=data_dir) - #================================================= # CHECK VERSION #================================================= -ynh_script_progression --message="Checking 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)..." - -# Backup the current version of the app -#REMOVEME? ynh_backup_before_upgrade -#REMOVEME? ynh_clean_setup () { - ynh_clean_check_starting - # 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 #================================================= @@ -53,55 +24,6 @@ ynh_script_progression --message="Stopping a systemd service..." ynh_systemd_action --service_name=$app --action="stop" --log_path=systemd --line_match="Stopped" -#================================================= -# ENSURE DOWNWARD COMPATIBILITY -#================================================= -ynh_script_progression --message="Ensuring downward compatibility..." - -# Cleaning legacy permissions -#REMOVEME? if ynh_legacy_permissions_exists; then -#REMOVEME? ynh_legacy_permissions_delete_all - - ynh_app_setting_delete --app=$app --key=is_public -fi - -ynh_script_progression --message="Creating storage folder..." - -if [ -z "$data_dir" ]; then - data_dir=/home/yunohost.app/$app -#REMOVEME? ynh_app_setting_set --app=$app --key=data_dir --value=$data_dir -fi - -mkdir -p "$data_dir/distbin-db/" - -# Move old db -if [ -d "$install_dir/db/" ]; then - rsync -arz "$install_dir/db/" "$data_dir/distbin-db/" --delete-after --remove-source-files -#REMOVEME? ynh_secure_remove --file="$install_dir/db" -fi - -# Move old db -if [ -d "$install_dir/distbin-db/" ]; then - if [ -d "$install_dir/distbin-db/db/" ]; then - rsync -arz "$install_dir/distbin-db/db/" "$data_dir/distbin-db/" --delete-after --remove-source-files -#REMOVEME? ynh_secure_remove --file="$install_dir/distbin-db/db" - fi - rsync -arz "$install_dir/distbin-db/" "$data_dir/distbin-db/" --delete-after --remove-source-files -#REMOVEME? ynh_secure_remove --file="$install_dir/distbin-db" -fi - -chmod 750 "$data_dir" -chmod -R o-rwx "$data_dir" -chown -R $app:$app "$data_dir" - -#================================================= -# CREATE DEDICATED USER -#================================================= -#REMOVEME? ynh_script_progression --message="Making sure dedicated system user exists..." - -# Create a dedicated user (if not existing) -#REMOVEME? ynh_system_user_create --username=$app --home_dir=$install_dir - #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE #================================================= @@ -114,7 +36,6 @@ then ynh_setup_source --dest_dir="$install_dir" fi -chmod 750 "$install_dir" chmod -R o-rwx "$install_dir" chown -R $app:$app "$install_dir" @@ -126,12 +47,6 @@ ynh_script_progression --message="Upgrading NGINX web server configuration..." # Create a dedicated NGINX config ynh_add_nginx_config -#================================================= -# UPGRADE DEPENDENCIES -#================================================= -#REMOVEME? ynh_script_progression --message="Upgrading dependencies..." - -#REMOVEME? ynh_install_app_dependencies $pkg_dependencies ynh_install_nodejs --nodejs_version=$NODEJS_VERSION #================================================= @@ -181,21 +96,9 @@ ynh_script_progression --message="Upgrading systemd configuration..." # Create a dedicated systemd config ynh_add_systemd_config -#================================================= -# GENERIC FINALIZATION -#================================================= -# SETUP LOGROTATE -#================================================= -ynh_script_progression --message="Upgrading logrotate configuration..." - # 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..." - yunohost service add $app --description="Distributed pastebin" --log="/var/log/$app/$app.log" #================================================= @@ -209,13 +112,6 @@ if [ ${PACKAGE_CHECK_EXEC:-0} -eq 1 ]; then sleep 60 fi -#================================================= -# RELOAD NGINX -#================================================= -#REMOVEME? ynh_script_progression --message="Reloading NGINX web server..." - -#REMOVEME? ynh_systemd_action --service_name=nginx --action=reload - #================================================= # END OF SCRIPT #================================================= From aeaabf9531a7ad3887603da097b4d106f8399db8 Mon Sep 17 00:00:00 2001 From: yunohost-bot Date: Tue, 15 Aug 2023 10:34:46 +0000 Subject: [PATCH 05/16] Auto-update README --- README.md | 8 -------- README_fr.md | 8 -------- 2 files changed, 16 deletions(-) diff --git a/README.md b/README.md index 645ab78..222e3cf 100644 --- a/README.md +++ b/README.md @@ -20,14 +20,6 @@ A distributed pastebin. i.e. it is a service where anyone can post things on the A networked place to store posted web documents. This is meant to allow for distributed social commentary and reaction around these documents using best practices recommended or noted by the W3C Social Web Working Group. -### Features - -- Ut enim ad minim veniam, quis nostrud exercitation ullamco ; -- Laboris nisi ut aliquip ex ea commodo consequat ; -- Duis aute irure dolor in reprehenderit in voluptate ; -- Velit esse cillum dolore eu fugiat nulla pariatur ; -- Excepteur sint occaecat cupidatat non proident, sunt in culpa." - **Shipped version:** 1.3.0~ynh12 diff --git a/README_fr.md b/README_fr.md index cd8b4b9..7030adc 100644 --- a/README_fr.md +++ b/README_fr.md @@ -20,14 +20,6 @@ A distributed pastebin. i.e. it is a service where anyone can post things on the A networked place to store posted web documents. This is meant to allow for distributed social commentary and reaction around these documents using best practices recommended or noted by the W3C Social Web Working Group. -### Features - -- Ut enim ad minim veniam, quis nostrud exercitation ullamco ; -- Laboris nisi ut aliquip ex ea commodo consequat ; -- Duis aute irure dolor in reprehenderit in voluptate ; -- Velit esse cillum dolore eu fugiat nulla pariatur ; -- Excepteur sint occaecat cupidatat non proident, sunt in culpa." - **Version incluse :** 1.3.0~ynh12 From 77c7cc7d0caa0e8f11df4ab8366b8636ec0307d5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Tue, 15 Aug 2023 12:35:37 +0200 Subject: [PATCH 06/16] Create tests.toml --- tests.toml | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 tests.toml diff --git a/tests.toml b/tests.toml new file mode 100644 index 0000000..91daf17 --- /dev/null +++ b/tests.toml @@ -0,0 +1,7 @@ +test_format = 1.0 + +[default] + + # ------------ + # Tests to run + # ------------ \ No newline at end of file From 30fb9a8ee8668ca69c102f5418272e7bb558d8a4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Tue, 15 Aug 2023 12:36:10 +0200 Subject: [PATCH 07/16] Update systemd.service --- conf/systemd.service | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conf/systemd.service b/conf/systemd.service index 0cb538d..13d19cd 100644 --- a/conf/systemd.service +++ b/conf/systemd.service @@ -1,5 +1,5 @@ [Unit] -Description=Distbin: istributed pastebin +Description=Distbin: distributed pastebin After=network.target [Service] From b335139ef9391c2591fc4a38fc68a0d44a433471 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Tue, 15 Aug 2023 13:46:33 +0200 Subject: [PATCH 08/16] fix --- check_process | 45 ------------------------ doc/DISCLAIMER.md | 1 - scripts/backup | 21 ----------- scripts/change_url | 86 ---------------------------------------------- 4 files changed, 153 deletions(-) delete mode 100644 check_process delete mode 100644 doc/DISCLAIMER.md diff --git a/check_process b/check_process deleted file mode 100644 index 62bf58b..0000000 --- a/check_process +++ /dev/null @@ -1,45 +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.2.0~ynh3 - #upgrade=1 from_commit=b01da8e6f8d621a1b9c7aec4b82bbe96c0e7cc03 - # 1.3.0~ynh4 - #upgrade=1 from_commit=0dda384e84bbe2513cb67cfd1eef15d667e50354 - # 1.3.0~ynh5 - #upgrade=1 from_commit=f7bc083d037eb771afeddc2237a24505a5ef1c68 - # 1.3.0~ynh6 - #upgrade=1 from_commit=cdec64125b179f6b19470ceb8379225ed03c10a8 - # 1.3.0~ynh7 - #upgrade=1 from_commit=481c0c5ce62caa9c79a6bd536f390f3814128b3a - # 1.3.0~ynh8 - upgrade=1 from_commit=e53a85de775501b13d8ef9c546d6b523c0a99e4f - backup_restore=1 - multi_instance=1 - port_already_use=0 - change_url=1 -;;; Options -Email=yalh@yahoo.com -Notification=all -;;; Upgrade options - ; commit=b01da8e6f8d621a1b9c7aec4b82bbe96c0e7cc03 - name=1.2.0~ynh3 - ; commit=0dda384e84bbe2513cb67cfd1eef15d667e50354 - name=1.3.0~ynh4 - ; commit=f7bc083d037eb771afeddc2237a24505a5ef1c68 - name=1.3.0~ynh5 - ; commit=cdec64125b179f6b19470ceb8379225ed03c10a8 - name=1.3.0~ynh6 - ; commit=481c0c5ce62caa9c79a6bd536f390f3814128b3a - name=1.3.0~ynh7 - ; commit=e53a85de775501b13d8ef9c546d6b523c0a99e4f - name=1.3.0~ynh8 diff --git a/doc/DISCLAIMER.md b/doc/DISCLAIMER.md deleted file mode 100644 index 8060069..0000000 --- a/doc/DISCLAIMER.md +++ /dev/null @@ -1 +0,0 @@ -* No configuration parameters available for now. diff --git a/scripts/backup b/scripts/backup index 0fa59ca..d4006e2 100644 --- a/scripts/backup +++ b/scripts/backup @@ -10,27 +10,6 @@ source ../settings/scripts/_common.sh source /usr/share/yunohost/helpers -#================================================= -# MANAGE SCRIPT FAILURE -#================================================= - -#REMOVEME? ynh_clean_setup () { - ynh_clean_check_starting -} -# 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/change_url b/scripts/change_url index 5cd6453..783cb76 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -9,61 +9,6 @@ source _common.sh source /usr/share/yunohost/helpers -#================================================= -# RETRIEVE ARGUMENTS -#================================================= - -#REMOVEME? old_domain=$YNH_APP_OLD_DOMAIN -#REMOVEME? old_path=$YNH_APP_OLD_PATH - -#REMOVEME? new_domain=$YNH_APP_NEW_DOMAIN -#REMOVEME? new_path=$YNH_APP_NEW_PATH - -#REMOVEME? app=$YNH_APP_INSTANCE_NAME - -#================================================= -# LOAD SETTINGS -#================================================= -#REMOVEME? ynh_script_progression --message="Loading installation settings..." - -#REMOVEME? # Needed for helper "ynh_add_nginx_config" -#REMOVEME? #REMOVEME? install_dir=$(ynh_app_setting_get --app=$app --key=install_dir) -#REMOVEME? port=$(ynh_app_setting_get --app=$app --key=port) - -#================================================= -# BACKUP BEFORE CHANGE URL THEN ACTIVE TRAP -#================================================= -#REMOVEME? ynh_script_progression --message="Backing up the app before changing its URL (may take a while)..." - -# Backup the current version of the app -#REMOVEME? ynh_backup_before_upgrade -#REMOVEME? ynh_clean_setup () { - #REMOVEME? ynh_clean_check_starting - # Remove the new domain config file, the remove script won't do it as it doesn't know yet its location. -#REMOVEME? ynh_secure_remove --file="/etc/nginx/conf.d/$new_domain.d/$app.conf" - - # 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 - -#================================================= -# CHECK WHICH PARTS SHOULD BE CHANGED -#================================================= - -#REMOVEME? change_domain=0 -#REMOVEME? if [ "$old_domain" != "$new_domain" ] -then - #REMOVEME? change_domain=1 -fi - -#REMOVEME? change_path=0 -#REMOVEME? if [ "$old_path" != "$new_path" ] -then - #REMOVEME? change_path=1 -fi - #================================================= # STANDARD MODIFICATIONS #================================================= @@ -80,30 +25,6 @@ ynh_script_progression --message="Updating NGINX web server configuration..." ynh_change_url_nginx_config -#REMOVEME? nginx_conf_path=/etc/nginx/conf.d/$old_domain.d/$app.conf - -# 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 -#REMOVEME? ynh_backup_if_checksum_is_different --file="$nginx_conf_path" - # Set global variables for NGINX helper -#REMOVEME? domain="$old_domain" -#REMOVEME? path="$new_path" - # Create a dedicated NGINX config -#REMOVEME? ynh_add_nginx_config -fi - -# Change the domain for NGINX -if [ $change_domain -eq 1 ] -then - # Delete file checksum for the old conf file location -#REMOVEME? ynh_delete_file_checksum --file="$nginx_conf_path" -#REMOVEME? mv $nginx_conf_path /etc/nginx/conf.d/$new_domain.d/$app.conf - # Store file checksum for the new config file location -#REMOVEME? ynh_store_file_checksum --file="/etc/nginx/conf.d/$new_domain.d/$app.conf" -fi - #================================================= # SPECIFIC MODIFICATIONS #================================================= @@ -147,13 +68,6 @@ if [ ${PACKAGE_CHECK_EXEC:-0} -eq 1 ]; then sleep 60 fi -#================================================= -# RELOAD NGINX -#================================================= -#REMOVEME? ynh_script_progression --message="Reloading NGINX web server..." - -#REMOVEME? #REMOVEME? ynh_systemd_action --service_name=nginx --action=reload - #================================================= # END OF SCRIPT #================================================= From eec46bec5633d219c549a708a889b4100e8876c4 Mon Sep 17 00:00:00 2001 From: yunohost-bot Date: Tue, 15 Aug 2023 11:46:38 +0000 Subject: [PATCH 09/16] Auto-update README --- README.md | 4 ---- README_fr.md | 4 ---- 2 files changed, 8 deletions(-) diff --git a/README.md b/README.md index 222e3cf..7954ff9 100644 --- a/README.md +++ b/README.md @@ -29,10 +29,6 @@ A networked place to store posted web documents. This is meant to allow for dist ![Screenshot of Distbin](./doc/screenshots/screenshot.PNG) -## Disclaimers / important information - -* No configuration parameters available for now. - ## Documentation and resources * Official app website: diff --git a/README_fr.md b/README_fr.md index 7030adc..e03c070 100644 --- a/README_fr.md +++ b/README_fr.md @@ -29,10 +29,6 @@ A networked place to store posted web documents. This is meant to allow for dist ![Capture d’écran de Distbin](./doc/screenshots/screenshot.PNG) -## Avertissements / informations importantes - -* No configuration parameters available for now. - ## Documentations et ressources * Site officiel de l’app : From 03629697f8b556d491becaf1958b5f55efe9288c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Tue, 15 Aug 2023 13:54:48 +0200 Subject: [PATCH 10/16] Update .env --- conf/.env | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conf/.env b/conf/.env index 774fcdc..a44c5d0 100644 --- a/conf/.env +++ b/conf/.env @@ -11,7 +11,7 @@ DB_DIR=__DATA_DIR__/distbin-db EXTERNAL_URL=https://__DOMAIN____PATH__/ # The internal URL -INTERNAL_URL=http://localhost:__PORT__/ +INTERNAL_URL=http://127.0.0.1:__PORT__/ # The Node Environnement NODE_ENV=production \ No newline at end of file From f45d5b94d92b4a6ec41ebd7f8671e4244ea07315 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Sat, 23 Sep 2023 14:02:46 +0200 Subject: [PATCH 11/16] Update manifest.toml --- manifest.toml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/manifest.toml b/manifest.toml index 4c9f335..de733f3 100644 --- a/manifest.toml +++ b/manifest.toml @@ -2,8 +2,8 @@ packaging_format = 2 id = "distbin" name = "Distbin" -description.en = "Distributed pastebin with ActivityPub." -description.fr = "Pastebin distribué utilisant le protocole ActivityPub." +description.en = "Distributed pastebin with ActivityPub" +description.fr = "Pastebin distribué utilisant le protocole ActivityPub" version = "1.3.0~ynh12" @@ -41,6 +41,7 @@ ram.runtime = "50M" [resources.sources.main] url = "https://github.com/gobengo/distbin/archive/v1.3.0.tar.gz" sha256 = "65d9774cafbb5829b82d09b0ea0d3d5d1ec5f076fadef2b8576d29a901c58a90" + autoupdate.strategy = "latest_github_tag" [resources.system_user] @@ -55,4 +56,4 @@ ram.runtime = "50M" main.url = "/" [resources.apt] - packages = "ca-certificates curl rsync" + packages = "ca-certificates, curl, rsync" From 278081f49a0f1779edb71640d20d89071bb02296 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Sat, 7 Oct 2023 19:36:27 +0200 Subject: [PATCH 12/16] Update manifest.toml --- manifest.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifest.toml b/manifest.toml index de733f3..cb1caf5 100644 --- a/manifest.toml +++ b/manifest.toml @@ -50,7 +50,7 @@ ram.runtime = "50M" [resources.install_dir] [resources.data_dir] - subdirs =["distbin-db, distbin-db/activities, distbin-db/inbox"] + subdirs =["distbin-db/activities", "distbin-db/inbox"] [resources.permissions] main.url = "/" From 51cc82a85e15b4c149f75369391a68cbc3bb20e6 Mon Sep 17 00:00:00 2001 From: yunohost-bot Date: Sat, 7 Oct 2023 17:36:32 +0000 Subject: [PATCH 13/16] Auto-update README --- README.md | 1 - README_fr.md | 1 - 2 files changed, 2 deletions(-) diff --git a/README.md b/README.md index 7954ff9..cd53875 100644 --- a/README.md +++ b/README.md @@ -33,7 +33,6 @@ A networked place to store posted web documents. This is meant to allow for dist * Official app website: * Upstream app code repository: -* YunoHost documentation for this app: * Report a bug: ## Developer info diff --git a/README_fr.md b/README_fr.md index e03c070..829992f 100644 --- a/README_fr.md +++ b/README_fr.md @@ -33,7 +33,6 @@ A networked place to store posted web documents. This is meant to allow for dist * Site officiel de l’app : * Dépôt de code officiel de l’app : -* Documentation YunoHost pour cette app : * Signaler un bug : ## Informations pour les développeurs From a77f8ad2aca3a23ee02da27e7afb3a89230ec1be Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Sat, 7 Oct 2023 20:33:24 +0200 Subject: [PATCH 14/16] Update _common.sh --- scripts/_common.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/_common.sh b/scripts/_common.sh index 5737a2c..3693f10 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -4,7 +4,7 @@ # COMMON VARIABLES #================================================= -NODEJS_VERSION=10 +NODEJS_VERSION=16 #================================================= # PERSONAL HELPERS From 4d223a408566f2bd58806b50b180f567f38c2fc6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Sat, 7 Oct 2023 20:39:10 +0200 Subject: [PATCH 15/16] Update manifest.toml --- manifest.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifest.toml b/manifest.toml index cb1caf5..a6950a5 100644 --- a/manifest.toml +++ b/manifest.toml @@ -5,7 +5,7 @@ name = "Distbin" description.en = "Distributed pastebin with ActivityPub" description.fr = "Pastebin distribué utilisant le protocole ActivityPub" -version = "1.3.0~ynh12" +version = "1.3.0~ynh13" maintainers = ["yalh76"] From fdb53e1bee407bb5af0e99003fb9b397cc7a11f5 Mon Sep 17 00:00:00 2001 From: yunohost-bot Date: Sat, 7 Oct 2023 18:39:14 +0000 Subject: [PATCH 16/16] 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 cd53875..43ad798 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,7 @@ A distributed pastebin. i.e. it is a service where anyone can post things on the A networked place to store posted web documents. This is meant to allow for distributed social commentary and reaction around these documents using best practices recommended or noted by the W3C Social Web Working Group. -**Shipped version:** 1.3.0~ynh12 +**Shipped version:** 1.3.0~ynh13 **Demo:** https://distbin.com/ diff --git a/README_fr.md b/README_fr.md index 829992f..21f7e1d 100644 --- a/README_fr.md +++ b/README_fr.md @@ -21,7 +21,7 @@ A distributed pastebin. i.e. it is a service where anyone can post things on the A networked place to store posted web documents. This is meant to allow for distributed social commentary and reaction around these documents using best practices recommended or noted by the W3C Social Web Working Group. -**Version incluse :** 1.3.0~ynh12 +**Version incluse :** 1.3.0~ynh13 **Démo :** https://distbin.com/