From 34cfd7372a283deee34def06ee6ba35031cb5899 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Wed, 8 Sep 2021 09:48:09 +0200 Subject: [PATCH] Fix --- doc/DESCRIPTION.md | 1 + doc/DESCRIPTION_fr.md | 1 + doc/DISCLAIMER.md | 14 ++++++++++++++ doc/DISCLAIMER_fr.md | 15 +++++++++++++++ {sources => doc/screenshots}/screenshot.png | Bin manifest.json | 13 ++++++++++--- scripts/install | 12 +++++++----- scripts/restore | 5 ++--- scripts/upgrade | 6 ++---- 9 files changed, 52 insertions(+), 15 deletions(-) create mode 100644 doc/DESCRIPTION.md create mode 100644 doc/DESCRIPTION_fr.md create mode 100644 doc/DISCLAIMER.md create mode 100644 doc/DISCLAIMER_fr.md rename {sources => doc/screenshots}/screenshot.png (100%) diff --git a/doc/DESCRIPTION.md b/doc/DESCRIPTION.md new file mode 100644 index 0000000..94f198b --- /dev/null +++ b/doc/DESCRIPTION.md @@ -0,0 +1 @@ +Haste is an open-source pastebin software written in node.js, which is easily installable in any network. YunoHost Project uses Haste as pastebin for log sharing: [paste.yunohost.org](https://paste.yunohost.org/) diff --git a/doc/DESCRIPTION_fr.md b/doc/DESCRIPTION_fr.md new file mode 100644 index 0000000..11d7dbc --- /dev/null +++ b/doc/DESCRIPTION_fr.md @@ -0,0 +1 @@ +Haste est un logiciel pastebin open-source écrit en node.js, facilement installable sur n'importe quel réseau. Le projet YunoHost utilise Haste comme pastebin pour le partage de log : [paste.yunohost.org](https://paste.yunohost.org/) diff --git a/doc/DISCLAIMER.md b/doc/DISCLAIMER.md new file mode 100644 index 0000000..4fcef40 --- /dev/null +++ b/doc/DISCLAIMER.md @@ -0,0 +1,14 @@ +#### Multi-user support + +* Are LDAP and HTTP auth supported? **No** +* Can the app be used by multiple users? **Yes** + +## `haste` command + +This Haste package for Yunohost includes the [`haste` command](https://github.com/diethnis/standalones/blob/master/hastebin.sh), allowing you to share content from terminal: + +```bash +cat something | haste +https://haste.example.com/zuyejeduzu +``` +The [Haste-client](https://github.com/seejohnrun/haste-client) is a simple client for uploading data to you Haste server. diff --git a/doc/DISCLAIMER_fr.md b/doc/DISCLAIMER_fr.md new file mode 100644 index 0000000..caa910a --- /dev/null +++ b/doc/DISCLAIMER_fr.md @@ -0,0 +1,15 @@ +### Support multi-utilisateur + +* L'authentification LDAP et HTTP est-elle prise en charge ? **Non** +* L'application peut-elle être utilisée par plusieurs utilisateurs ? **Oui** + +## `haste` command + +Ce paquet de Haste pour YunoHost comprend une commande [`haste`](https://github.com/diethnis/standalones/blob/master/hastebin.sh), vous permettant de partager du contenu avec le terminal : + +```bash +cat something | haste +https://haste.example.com/zuyejeduzu +``` + +Le [client Haste](https://github.com/seejohnrun/haste-client) est un client simple pour télécharger des données sur votre serveur Haste. diff --git a/sources/screenshot.png b/doc/screenshots/screenshot.png similarity index 100% rename from sources/screenshot.png rename to doc/screenshots/screenshot.png diff --git a/manifest.json b/manifest.json index b3dde7a..04f6401 100644 --- a/manifest.json +++ b/manifest.json @@ -6,8 +6,15 @@ "en": "Open-source pastebin allowing to upload texts", "fr": "Pastebin open-source permettant de mettre en ligne du texte" }, - "version": "0.1.0~ynh7", - "url": "https://github.com/seejohnrun/haste-server", + "version": "0.1.0~ynh8", + "url": "http://hastebin.com/", + "upstream": { + "license": "MIT", + "website": "https://example.com", + "demo": "http://hastebin.com/", + "userdoc": "https://hastebin.com/about.md", + "code": "https://github.com/seejohnrun/haste-server" + }, "license": "MIT", "maintainer": { "name": "eric_G", @@ -31,7 +38,7 @@ "type": "domain", "help": { "en": "Haste can only be installed in a root domain or subdomain", - "fr": "Haste ne peut être installé que dans un domaine racine ou un sous-domaine " + "fr": "Haste ne peut être installé que dans un domaine racine ou un sous-domaine" }, "example": "paste.example.com" }, diff --git a/scripts/install b/scripts/install index 05612cf..307e3c2 100755 --- a/scripts/install +++ b/scripts/install @@ -96,7 +96,6 @@ ynh_exec_warn_less ynh_install_nodejs --nodejs_version=$nodejs_version #================================================= ynh_replace_string --match_string="__ENV_PATH__" --replace_string="$PATH" --target_file="../conf/systemd.service" -ynh_replace_string --match_string="__YNH_NPM__" --replace_string="$ynh_npm" --target_file="../conf/systemd.service" ynh_add_systemd_config @@ -104,10 +103,10 @@ ynh_add_systemd_config # INSTALL HASTEBIN #================================================= -pushd "$final_path" || ynh_die +pushd "$final_path" ynh_use_nodejs ynh_exec_warn_less ynh_npm install -popd || ynh_die +popd #================================================= # CREATE DIRECTORY FOR DATA @@ -116,10 +115,14 @@ ynh_script_progression --message="Creating the data directory..." # Define app's data directory data_path="/home/yunohost.app/${app}" +ynh_app_setting_set --app=$app --key=data_path --value=$data_path # Create app folders mkdir -p "$data_path" -ynh_app_setting_set --app=$app --key=data_path --value=$data_path + +chmod 750 "$data_path" +chmod -R o-rwx "$data_path" +chown -R $app:www-data "$data_path" #================================================= # CONFIGURE HASTE @@ -148,7 +151,6 @@ ynh_add_config --template="../conf/haste.sh" --destination="/usr/bin/$app" chmod 750 "$final_path" chmod -R o-rwx "$final_path" chown -R $app:www-data "$final_path" -chown -R $app: $data_path chmod +x /usr/bin/$app #================================================= diff --git a/scripts/restore b/scripts/restore index 9d68823..0cb0ac8 100755 --- a/scripts/restore +++ b/scripts/restore @@ -33,8 +33,6 @@ data_path=$(ynh_app_setting_get --app=$app --key=data_path) #================================================= ynh_script_progression --message="Validating restoration parameters..." --weight=2 -ynh_webpath_available $domain $path_url \ - || ynh_die "Path not available: ${domain}${path_url}" test ! -d $final_path \ || ynh_die "There is already a directory: $final_path " @@ -66,6 +64,7 @@ ynh_system_user_create --username=$app --home_dir=$final_path #================================================= # INSTALL NODEJS #================================================= +ynh_script_progression --message="Reinstalling dependencies..." --weight=1 ynh_exec_warn_less ynh_install_nodejs --nodejs_version=$nodejs_version @@ -73,7 +72,7 @@ ynh_exec_warn_less ynh_install_nodejs --nodejs_version=$nodejs_version # RESTORE VARIOUS FILES #================================================= -ynh_restore_file "$data_path" +ynh_restore_file --origin_path="$data_path" #================================================= # RESTORE BINARY diff --git a/scripts/upgrade b/scripts/upgrade index 23933b2..8f9fae4 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -115,10 +115,10 @@ ynh_exec_warn_less ynh_install_nodejs --nodejs_version=$nodejs_version # UPGRADE NPM MODULES #================================================= -pushd "$final_path" || ynh_die +pushd "$final_path" ynh_use_nodejs ynh_exec_warn_less ynh_npm install -popd || ynh_die +popd #================================================= # SETUP LOGROTATE @@ -134,7 +134,6 @@ ynh_use_logrotate --non-append ynh_script_progression --message="Upgrading systemd configuration..." --weight=1 ynh_replace_string --match_string="__ENV_PATH__" --replace_string="$PATH" --target_file="../conf/systemd.service" -ynh_replace_string --match_string="__YNH_NPM__" --replace_string="$ynh_npm" --target_file="../conf/systemd.service" ynh_add_systemd_config @@ -163,7 +162,6 @@ ynh_add_config --template="../conf/haste.sh" --destination="/usr/bin/$app" chmod 750 "$final_path" chmod -R o-rwx "$final_path" chown -R $app:www-data "$final_path" -chown -R $app: $data_path chmod +x /usr/bin/$app #=================================================