diff --git a/README.md b/README.md index d3b7ec4..df3070f 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ If you don't have YunoHost, please consult [the guide](https://yunohost.org/#/install) to learn how to install it.* ## Overview -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 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. @@ -51,8 +51,7 @@ The app can be used by multiple users, anonymously. --- -Developer info ----------------- +## Developer info Please send your pull request to the [testing branch](https://github.com/YunoHost-Apps/distbin_ynh/tree/testing). diff --git a/check_process b/check_process index 6aeafc3..4725ec0 100644 --- a/check_process +++ b/check_process @@ -22,13 +22,8 @@ upgrade=1 from_commit=0dda384e84bbe2513cb67cfd1eef15d667e50354 backup_restore=1 multi_instance=1 - # This test is no longer necessary since the version 2.7 (PR: https://github.com/YunoHost/yunohost/pull/304), you can still do it if your app could be installed with this version. - # incorrect_path=1 port_already_use=0 change_url=1 -;;; Levels - # If the level 5 (Package linter) is forced to 1. Please add justifications here. - Level 5=auto ;;; Options Email=yalh@yahoo.com Notification=all @@ -37,4 +32,3 @@ Notification=all name=1.2.0~ynh3 ; commit=0dda384e84bbe2513cb67cfd1eef15d667e50354 name=1.3.0~ynh4 - diff --git a/manifest.json b/manifest.json index 9202c7c..2b1cc4c 100644 --- a/manifest.json +++ b/manifest.json @@ -7,12 +7,13 @@ "fr": "Pastebin distribué utilisant le protocole ActivityPub." }, "version": "1.3.0~ynh5", + "url": "https://distbin.com/", "license": "Apache-2.0", "maintainer": { "name": "yalh76" }, "requirements": { - "yunohost": ">= 3.5" + "yunohost": ">= 3.8.1" }, "multi_instance": true, "services": [ diff --git a/scripts/change_url b/scripts/change_url index f7daf64..1dfc46b 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -29,11 +29,6 @@ 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) - -# Add settings here as needed by your application -#db_name=$(ynh_app_setting_get --app=$app --key=db_name) -#db_user=$db_name -#db_pwd=$(ynh_app_setting_get --app=$app --key=db_pwd) port=$(ynh_app_setting_get --app=$app --key=port) #================================================= @@ -81,23 +76,23 @@ ynh_systemd_action --service_name=$app --action="stop" --log_path=systemd --line #================================================= # MODIFY URL IN NGINX CONF #================================================= -ynh_script_progression --message="Updating nginx web server configuration..." +ynh_script_progression --message="Updating NGINX web server configuration..." nginx_conf_path=/etc/nginx/conf.d/$old_domain.d/$app.conf -# Change the path in the nginx config file +# 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 + # Make a backup of the original NGINX config file if modified ynh_backup_if_checksum_is_different --file="$nginx_conf_path" - # Set global variables for nginx helper + # Set global variables for NGINX helper domain="$old_domain" path_url="$new_path" - # Create a dedicated nginx config + # Create a dedicated NGINX config ynh_add_nginx_config fi -# Change the domain for nginx +# Change the domain for NGINX if [ $change_domain -eq 1 ] then # Delete file checksum for the old conf file location @@ -153,7 +148,7 @@ fi #================================================= # RELOAD NGINX #================================================= -ynh_script_progression --message="Reloading nginx web server..." +ynh_script_progression --message="Reloading NGINX web server..." ynh_systemd_action --service_name=nginx --action=reload diff --git a/scripts/install b/scripts/install index d4d0937..6bad382 100644 --- a/scripts/install +++ b/scripts/install @@ -61,13 +61,6 @@ ynh_script_progression --message="Configuring firewall..." port=$(ynh_find_port --port=8095) ynh_app_setting_set --app=$app --key=port --value=$port -# Optional: Expose this port publicly -# (N.B. : you only need to do this if the app actually needs to expose the port publicly. -# If you do this and the app doesn't actually need you are CREATING SECURITY HOLES IN THE SERVER !) - -# Open the port -# ynh_exec_warn_less yunohost firewall allow --no-upnp TCP $port - #================================================= # INSTALL DEPENDENCIES #================================================= @@ -88,7 +81,7 @@ ynh_setup_source --dest_dir="$final_path" #================================================= # NGINX CONFIGURATION #================================================= -ynh_script_progression --message="Configuring nginx web server..." +ynh_script_progression --message="Configuring NGINX web server..." # Create a dedicated nginx config ynh_add_nginx_config @@ -123,7 +116,7 @@ mkdir -p "$final_path/distbin-db/inbox" #================================================= # INSTALLING DISTBIN #================================================= -ynh_script_progression --message="Installing distin..." +ynh_script_progression --message="Installing Distbin..." chown -R "$app":"$app" "$final_path" @@ -135,7 +128,7 @@ pushd $final_path popd pushd $final_path/dist - sudo -u $app $ynh_node_load_PATH $ynh_npm install --ignore-scripts --production + sudo -u $app $ynh_node_load_PATH $ynh_npm install --ignore-scripts --production popd #================================================= @@ -176,7 +169,7 @@ ynh_use_logrotate #================================================= ynh_script_progression --message="Integrating service in YunoHost..." -yunohost service add $app --description "$app daemon for distbin" --log "/var/log/$app/$app.log" +yunohost service add $app --description="$app daemon for distbin" --log="/var/log/$app/$app.log" #================================================= # START SYSTEMD SERVICE @@ -204,7 +197,7 @@ fi #================================================= # RELOAD NGINX #================================================= -ynh_script_progression --message="Reloading nginx web server..." +ynh_script_progression --message="Reloading NGINX web server..." ynh_systemd_action --service_name=nginx --action=reload diff --git a/scripts/remove b/scripts/remove index 5c75f29..fd81101 100644 --- a/scripts/remove +++ b/scripts/remove @@ -61,9 +61,9 @@ ynh_secure_remove --file="$final_path" #================================================= # REMOVE NGINX CONFIGURATION #================================================= -ynh_script_progression --message="Removing nginx web server configuration..." +ynh_script_progression --message="Removing NGINX web server configuration..." -# Remove the dedicated nginx config +# Remove the dedicated NGINX config ynh_remove_nginx_config #================================================= @@ -74,16 +74,6 @@ ynh_script_progression --message="Removing logrotate configuration..." # Remove the app-specific logrotate config ynh_remove_logrotate -#================================================= -# CLOSE A PORT -#================================================= - -if yunohost firewall list | grep -q "\- $port$" -then - ynh_script_progression --message="Closing port $port..." - ynh_exec_warn_less yunohost firewall disallow TCP $port -fi - #================================================= # SPECIFIC REMOVE #================================================= diff --git a/scripts/restore b/scripts/restore index f59d78b..fdd5d88 100644 --- a/scripts/restore +++ b/scripts/restore @@ -46,7 +46,7 @@ test ! -d $final_path \ #================================================= # RESTORE THE NGINX CONFIGURATION #================================================= -ynh_script_progression --message="Restoring the nginx configuration..." +ynh_script_progression --message="Restoring the NGINX configuration..." ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf" @@ -98,14 +98,14 @@ ynh_install_nodejs --nodejs_version=$nodejs_version ynh_script_progression --message="Restoring the systemd configuration..." ynh_restore_file --origin_path="/etc/systemd/system/$app.service" -systemctl enable $app.service +systemctl enable $app.service --quiet #================================================= # INTEGRATE SERVICE IN YUNOHOST #================================================= ynh_script_progression --message="Integrating service in YunoHost..." -yunohost service add $app --description "$app daemon for distbin" --log "/var/log/$app/$app.log" +yunohost service add $app --description="$app daemon for distbin" --log="/var/log/$app/$app.log" #================================================= # START SYSTEMD SERVICE @@ -129,7 +129,7 @@ ynh_restore_file --origin_path="/etc/logrotate.d/$app" #================================================= # RELOAD NGINX AND PHP-FPM #================================================= -ynh_script_progression --message="Reloading nginx web server..." +ynh_script_progression --message="Reloading NGINX web server..." ynh_systemd_action --service_name=nginx --action=reload diff --git a/scripts/upgrade b/scripts/upgrade index 8d8b1d9..94c61d5 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -89,9 +89,9 @@ fi #================================================= # NGINX CONFIGURATION #================================================= -ynh_script_progression --message="Upgrading nginx web server configuration..." +ynh_script_progression --message="Upgrading NGINX web server configuration..." -# Create a dedicated nginx config +# Create a dedicated NGINX config ynh_add_nginx_config #================================================= @@ -188,7 +188,7 @@ ynh_use_logrotate --non-append #================================================= ynh_script_progression --message="Integrating service in YunoHost..." -yunohost service add $app --description "$app daemon for distbin" --log "/var/log/$app/$app.log" +yunohost service add $app --description="$app daemon for distbin" --log="/var/log/$app/$app.log" #================================================= # START SYSTEMD SERVICE @@ -215,7 +215,7 @@ fi #================================================= # RELOAD NGINX #================================================= -ynh_script_progression --message="Reloading nginx web server..." +ynh_script_progression --message="Reloading NGINX web server..." ynh_systemd_action --service_name=nginx --action=reload