From 603244adc45ea5166e2dbe1e15c7079baaabb928 Mon Sep 17 00:00:00 2001 From: eric_G <46165813+ericgaspar@users.noreply.github.com> Date: Sun, 10 Dec 2023 11:16:54 +0100 Subject: [PATCH 1/2] Testing (#44) * Fix check_process warning * Update change_url * Update manifest.json * Fix linter warning * Update remove * Set badge in SVG * Use SVG for badge * Finding an available port * Patch (#21) * Fix linter warnings * Small fixes * Cleaning up * Update manifest.json * Cleaning up * Fix badges * [autopatch] Update issue and PR templates (#25) Co-authored-by: Yunohost-Bot <> * Add templates * Fix * Update restore * Fix * Update install * Fix * Update check_process * Patch (#27) * Fix * Auto-update README * Update systemd.service * Update nginx.conf Co-authored-by: Yunohost-Bot <> * Update manifest.json * 4.3 * Fix ynh_npm * Add purge option * Auto-update README * Update version (#30) * update * Auto-update README Co-authored-by: Yunohost-Bot <> * Upgrade (#32) * Fix * Auto-update README Co-authored-by: yunohost-bot * Update _common.sh (#34) * Update _common.sh * Fix * cleaning up * Update manifest.json * Auto-update README * Auto-update README * set relative path for --keep opt * Auto-update README * Update manifest.json * Auto-update README * Upgrade to upstream * Auto-update README * Reorder script * Update restore * Update systemd.service * Version 2 (#38) * v2 * Auto-update README * v2 * Auto-update README * fix * Update config.js --------- Co-authored-by: yunohost-bot * Update manifest.toml * Auto-update README * source autoupdate: fix version format because upstream doesn't have proper versioning ... * Upgrade to v0.1.2023.03.06 (#40) * Upgrade to v0.1.2023.03.06 * Auto-update README * cleaning * Update manifest.toml * Update manifest.toml * Update manifest.toml * Upgrade to v0.1.2023.09.21 (#42) * Upgrade to v0.1.2023.09.21 * Auto-update README * cleaning * Update manifest.toml * Auto-update README --------- Co-authored-by: Alexandre Aubin Co-authored-by: YunoHost Bot Co-authored-by: Yunohost-Bot <> Co-authored-by: yunohost-bot Co-authored-by: yalh76 --- README.md | 2 +- README_fr.md | 2 +- check_process | 25 ---------------- manifest.toml | 5 +++- scripts/install | 77 +++++++++++++++++++------------------------------ scripts/remove | 27 ----------------- scripts/restore | 16 +++++----- scripts/upgrade | 45 +++++++++-------------------- 8 files changed, 57 insertions(+), 142 deletions(-) delete mode 100644 check_process diff --git a/README.md b/README.md index 35a2593..1cd399b 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@ If you don't have YunoHost, please consult [the guide](https://yunohost.org/#/in 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/) -**Shipped version:** 0.1.2023.09.21~ynh1 +**Shipped version:** 0.1.2023.09.21~ynh2 **Demo:** http://hastebin.com/ diff --git a/README_fr.md b/README_fr.md index b04b184..cd74234 100644 --- a/README_fr.md +++ b/README_fr.md @@ -19,7 +19,7 @@ Si vous n’avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) po 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/) -**Version incluse :** 0.1.2023.09.21~ynh1 +**Version incluse :** 0.1.2023.09.21~ynh2 **Démo :** http://hastebin.com/ diff --git a/check_process b/check_process deleted file mode 100644 index 3554c31..0000000 --- a/check_process +++ /dev/null @@ -1,25 +0,0 @@ -;; Test complet - ; Manifest - domain="domain.tld" - path="/" - is_public=1 - port="7777" - ; Checks - pkg_linter=1 - setup_sub_dir=0 - setup_root=1 - setup_nourl=0 - setup_private=1 - setup_public=1 - upgrade=1 - upgrade=1 from_commit=0ea46c375b775316cec39a96fa917ec240e45970 - backup_restore=1 - multi_instance=0 - change_url=1 -;;; Options -Email= -Notification=none -;;; Upgrade options - ; commit=0ea46c375b775316cec39a96fa917ec240e45970 - name=Testing (#33) - manifest_arg=domain=DOMAIN&path=PATH&is_public=1&language=fr&admin=USER&password=pass&port=666& diff --git a/manifest.toml b/manifest.toml index a3f308e..aa2fdab 100644 --- a/manifest.toml +++ b/manifest.toml @@ -5,7 +5,7 @@ name = "Haste" description.en = "Open-source pastebin allowing to upload texts" description.fr = "Pastebin open-source permettant de mettre en ligne du texte" -version = "0.1.2023.09.21~ynh1" +version = "0.1.2023.09.21~ynh2" maintainers = ["eric_G"] @@ -20,8 +20,11 @@ code = "https://github.com/seejohnrun/haste-server" yunohost = ">= 11.2" architectures = "all" multi_instance = false + ldap = false + sso = true + disk = "50M" ram.build = "50M" ram.runtime = "50M" diff --git a/scripts/install b/scripts/install index 3de9d32..615d5d3 100755 --- a/scripts/install +++ b/scripts/install @@ -9,6 +9,14 @@ source _common.sh source /usr/share/yunohost/helpers +#================================================= +# INSTALL NODEJS +#================================================= +ynh_script_progression --message="Installing dependencies..." --weight=10 + +# Install Nodejs +ynh_exec_warn_less ynh_install_nodejs --nodejs_version=$nodejs_version + #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE #================================================= @@ -25,24 +33,30 @@ ynh_script_progression --message="Configuring NGINX web server..." --weight=2 # Create a dedicated NGINX config ynh_add_nginx_config -#================================================= -# SPECIFIC SETUP -#================================================= -# INSTALL NODEJS -#================================================= -ynh_script_progression --message="Installing dependencies..." --weight=10 - -# Install Nodejs -ynh_exec_warn_less ynh_install_nodejs --nodejs_version=$nodejs_version - -#================================================= -# ADD SYSTEMD SERVICE -#================================================= -ynh_script_progression --message="Configuring a systemd service..." --weight=1 - env_path="$PATH" ynh_add_systemd_config +# FIXME Currently, the log is only redirected to syslog. +mkdir -p /var/log/$app +touch /var/log/$app/$app.log +chown $app -R /var/log/$app + +ynh_use_logrotate + +yunohost service add $app --description="Haste is a pastebin software" --log="/var/log/$app/$app.log" + +#================================================= +# CONFIGURE HASTE +#================================================= +ynh_script_progression --message="Adding a configuration file..." --weight=1 + +ynh_add_config --template="config.js" --destination="$install_dir/config.js" + +# Replace ajax.googleapis by local file +cp ../sources/jquery.min.js "$install_dir/static/jquery.min.js" + +ynh_replace_string --match_string="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js" --replace_string="jquery.min.js" --target_file="$install_dir/static/index.html" + #================================================= # INSTALL HASTEBIN #================================================= @@ -53,24 +67,12 @@ pushd "$install_dir" ynh_exec_warn_less $ynh_npm install popd -#================================================= -# CONFIGURE HASTE -#================================================= -ynh_script_progression --message="Adding a configuration file..." --weight=1 - -ynh_add_config --template="../conf/config.js" --destination="$install_dir/config.js" - -# Replace ajax.googleapis by local file -cp ../sources/jquery.min.js "$install_dir/static/jquery.min.js" - -ynh_replace_string --match_string="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js" --replace_string="jquery.min.js" --target_file="$install_dir/static/index.html" - #================================================= # ADD HASTE AS A BINARY FILE #================================================= haste_url="${domain}${path}" -ynh_add_config --template="../conf/haste.sh" --destination="/usr/bin/$app" +ynh_add_config --template="haste.sh" --destination="/usr/bin/$app" #================================================= # GENERIC FINALIZATION @@ -83,25 +85,6 @@ chmod -R o-rwx "$install_dir" chown -R $app:www-data "$install_dir" chmod +x /usr/bin/$app -#================================================= -# HANDLE LOG FILES AND SETUP LOGROTATE -#================================================= -ynh_script_progression --message="Configuring log rotation..." --weight=1 - -# FIXME Currently, the log is only redirected to syslog. -mkdir -p /var/log/$app -touch /var/log/$app/$app.log -chown $app -R /var/log/$app - -ynh_use_logrotate - -#================================================= -# INTEGRATE SERVICE IN YUNOHOST -#================================================= -ynh_script_progression --message="Integrating service in YunoHost..." --weight=1 - -yunohost service add $app --description="Haste is a pastebin software" --log="/var/log/$app/$app.log" - #================================================= # START SYSTEMD SERVICE #================================================= diff --git a/scripts/remove b/scripts/remove index 2972035..9434ca3 100755 --- a/scripts/remove +++ b/scripts/remove @@ -22,43 +22,16 @@ then yunohost service remove $app fi -#================================================= -# STOP AND REMOVE SERVICE -#================================================= -ynh_script_progression --message="Stopping and removing the systemd service..." --weight=1 - # Remove the dedicated systemd config ynh_remove_systemd_config -#================================================= -# REMOVE NGINX CONFIGURATION -#================================================= -ynh_script_progression --message="Removing NGINX web server configuration..." --weight=1 - # Remove the dedicated NGINX config ynh_remove_nginx_config -#================================================= -# REMOVE LOGROTATE CONFIGURATION -#================================================= -ynh_script_progression --message="Removing logrotate configuration..." --weight=1 - ynh_remove_logrotate -#================================================= -# SPECIFIC REMOVE -#================================================= -# REMOVE HASTE BINARY -#================================================= -ynh_script_progression --message="Removing various files..." --weight=1 - ynh_secure_remove --file="/usr/bin/$app" -#================================================= -# REMOVE NODEJS -#================================================= -ynh_script_progression --message="Removing dependencies..." --weight=5 - ynh_remove_nodejs #================================================= diff --git a/scripts/restore b/scripts/restore index b4f893f..2dccb71 100755 --- a/scripts/restore +++ b/scripts/restore @@ -9,6 +9,13 @@ source ../settings/scripts/_common.sh source /usr/share/yunohost/helpers +#================================================= +# INSTALL NODEJS +#================================================= +ynh_script_progression --message="Reinstalling dependencies..." --weight=1 + +ynh_exec_warn_less ynh_install_nodejs --nodejs_version=$nodejs_version + #================================================= # RESTORE THE APP MAIN DIR #================================================= @@ -19,15 +26,6 @@ ynh_restore_file --origin_path="$install_dir" chmod -R o-rwx "$install_dir" chown -R $app:www-data "$install_dir" -#================================================= -# SPECIFIC RESTORE -#================================================= -# INSTALL NODEJS -#================================================= -ynh_script_progression --message="Reinstalling dependencies..." --weight=1 - -ynh_exec_warn_less ynh_install_nodejs --nodejs_version=$nodejs_version - #================================================= # RESTORE VARIOUS FILES #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index 54b12c9..45bdbce 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -34,6 +34,13 @@ then ynh_setup_source --dest_dir="$install_dir" --keep="config.js" fi +#================================================= +# UPGRADE NODEJS +#================================================= +ynh_script_progression --message="Upgrading dependencies..." --weight=8 + +ynh_exec_warn_less ynh_install_nodejs --nodejs_version=$nodejs_version + #================================================= # NGINX CONFIGURATION #================================================= @@ -42,14 +49,13 @@ ynh_script_progression --message="Upgrading NGINX web server configuration..." - # Create a dedicated NGINX config ynh_add_nginx_config -#================================================= -# SPECIFIC UPGRADE -#================================================= -# UPGRADE NODEJS -#================================================= -ynh_script_progression --message="Upgrading dependencies..." --weight=8 +# FIXME Currently, the log is only redirected to syslog. +ynh_use_logrotate --non-append -ynh_exec_warn_less ynh_install_nodejs --nodejs_version=$nodejs_version +env_path="$PATH" +ynh_add_systemd_config + +yunohost service add $app --description="Haste is a pastebin software" --log="/var/log/$app/$app.log" #================================================= # UPGRADE NPM MODULES @@ -61,22 +67,6 @@ pushd "$install_dir" ynh_exec_warn_less $ynh_npm install popd -#================================================= -# SETUP LOGROTATE -#================================================= -ynh_script_progression --message="Upgrading logrotate configuration..." --weight=1 - -# FIXME Currently, the log is only redirected to syslog. -ynh_use_logrotate --non-append - -#================================================= -# SETUP SYSTEMD -#================================================= -ynh_script_progression --message="Upgrading systemd configuration..." --weight=1 - -env_path="$PATH" -ynh_add_systemd_config - #================================================= # UPGRADE HASTE CONFIGURATION #================================================= @@ -92,7 +82,7 @@ ynh_replace_string --match_string="https://ajax.googleapis.com/ajax/libs/jquery/ ynh_script_progression --message="Updating a configuration file..." --weight=1 haste_url="${domain}${path}" -ynh_add_config --template="../conf/haste.sh" --destination="/usr/bin/$app" +ynh_add_config --template="haste.sh" --destination="/usr/bin/$app" #================================================= # GENERIC FINALIZATION @@ -105,13 +95,6 @@ chmod -R o-rwx "$install_dir" chown -R $app:www-data "$install_dir" chmod +x /usr/bin/$app -#================================================= -# INTEGRATE SERVICE IN YUNOHOST -#================================================= -ynh_script_progression --message="Integrating service in YunoHost..." --weight=1 - -yunohost service add $app --description="Haste is a pastebin software" --log="/var/log/$app/$app.log" - #================================================= # START SYSTEMD SERVICE #================================================= From ef7e0744e9b52ff0c33e5587f2879026f5fc51cd Mon Sep 17 00:00:00 2001 From: yunohost-bot Date: Fri, 29 Mar 2024 07:06:12 +0100 Subject: [PATCH 2/2] Auto-update README --- ALL_README.md | 6 ++++++ README.md | 26 +++++++++++++------------- README_fr.md | 32 ++++++++++++++++---------------- README_gl.md | 50 ++++++++++++++++++++++++++++++++++++++++++++++++++ README_it.md | 50 ++++++++++++++++++++++++++++++++++++++++++++++++++ 5 files changed, 135 insertions(+), 29 deletions(-) create mode 100644 ALL_README.md create mode 100644 README_gl.md create mode 100644 README_it.md diff --git a/ALL_README.md b/ALL_README.md new file mode 100644 index 0000000..3d6c579 --- /dev/null +++ b/ALL_README.md @@ -0,0 +1,6 @@ +# All available README files by language + +- [Read the README in English](README.md) +- [Lire le README en français](README_fr.md) +- [Le o README en galego](README_gl.md) +- [Leggi il “README” in italiano](README_it.md) diff --git a/README.md b/README.md index 1cd399b..e3502d4 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ @@ -9,10 +9,10 @@ It shall NOT be edited by hand. [![Install Haste with YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=haste) -*[Lire ce readme en français.](./README_fr.md)* +*[Read this README is other languages.](./ALL_README.md)* -> *This package allows you to install Haste quickly and simply on a YunoHost server. -If you don't have YunoHost, please consult [the guide](https://yunohost.org/#/install) to learn how to install it.* +> *This package allows you to install Haste quickly and simply on a YunoHost server.* +> *If you don't have YunoHost, please consult [the guide](https://yunohost.org/install) to learn how to install it.* ## Overview @@ -21,7 +21,7 @@ Haste is an open-source pastebin software written in node.js, which is easily in **Shipped version:** 0.1.2023.09.21~ynh2 -**Demo:** http://hastebin.com/ +**Demo:** ## Screenshots @@ -29,19 +29,19 @@ Haste is an open-source pastebin software written in node.js, which is easily in ## Documentation and resources -* Official app website: -* Official user documentation: -* Upstream app code repository: -* YunoHost Store: -* Report a bug: +- Official app website: +- Official user documentation: +- Upstream app code repository: +- YunoHost Store: +- Report a bug: ## Developer info -Please send your pull request to the [testing branch](https://github.com/YunoHost-Apps/haste_ynh/tree/testing). +Please send your pull request to the [`testing` branch](https://github.com/YunoHost-Apps/haste_ynh/tree/testing). -To try the testing branch, please proceed like that. +To try the `testing` branch, please proceed like that: -``` bash +```bash sudo yunohost app install https://github.com/YunoHost-Apps/haste_ynh/tree/testing --debug or sudo yunohost app upgrade haste -u https://github.com/YunoHost-Apps/haste_ynh/tree/testing --debug diff --git a/README_fr.md b/README_fr.md index cd74234..f461914 100644 --- a/README_fr.md +++ b/README_fr.md @@ -1,6 +1,6 @@ # Haste pour YunoHost @@ -9,19 +9,19 @@ It shall NOT be edited by hand. [![Installer Haste avec YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=haste) -*[Read this readme in english.](./README.md)* +*[Lire le README dans d'autres langues.](./ALL_README.md)* -> *Ce package vous permet d’installer Haste rapidement et simplement sur un serveur YunoHost. -Si vous n’avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) pour savoir comment l’installer et en profiter.* +> *Ce package vous permet d’installer Haste rapidement et simplement sur un serveur YunoHost.* +> *Si vous n’avez pas YunoHost, consultez [ce guide](https://yunohost.org/install) pour savoir comment l’installer et en profiter.* ## Vue d’ensemble 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/) -**Version incluse :** 0.1.2023.09.21~ynh2 +**Version incluse :** 0.1.2023.09.21~ynh2 -**Démo :** http://hastebin.com/ +**Démo :** ## Captures d’écran @@ -29,22 +29,22 @@ Haste est un logiciel pastebin open-source écrit en node.js, facilement install ## Documentations et ressources -* Site officiel de l’app : -* Documentation officielle utilisateur : -* Dépôt de code officiel de l’app : -* YunoHost Store: -* Signaler un bug : +- Site officiel de l’app : +- Documentation officielle utilisateur : +- Dépôt de code officiel de l’app : +- YunoHost Store : +- Signaler un bug : ## Informations pour les développeurs -Merci de faire vos pull request sur la [branche testing](https://github.com/YunoHost-Apps/haste_ynh/tree/testing). +Merci de faire vos pull request sur la [branche `testing`](https://github.com/YunoHost-Apps/haste_ynh/tree/testing). -Pour essayer la branche testing, procédez comme suit. +Pour essayer la branche `testing`, procédez comme suit : -``` bash +```bash sudo yunohost app install https://github.com/YunoHost-Apps/haste_ynh/tree/testing --debug ou sudo yunohost app upgrade haste -u https://github.com/YunoHost-Apps/haste_ynh/tree/testing --debug ``` -**Plus d’infos sur le packaging d’applications :** \ No newline at end of file +**Plus d’infos sur le packaging d’applications :** diff --git a/README_gl.md b/README_gl.md new file mode 100644 index 0000000..bb59b0e --- /dev/null +++ b/README_gl.md @@ -0,0 +1,50 @@ + + +# Haste para YunoHost + +[![Nivel de integración](https://dash.yunohost.org/integration/haste.svg)](https://dash.yunohost.org/appci/app/haste) ![Estado de funcionamento](https://ci-apps.yunohost.org/ci/badges/haste.status.svg) ![Estado de mantemento](https://ci-apps.yunohost.org/ci/badges/haste.maintain.svg) + +[![Instalar Haste con YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=haste) + +*[Le este README en outros idiomas.](./ALL_README.md)* + +> *Este paquete permíteche instalar Haste de xeito rápido e doado nun servidor YunoHost.* +> *Se non usas YunoHost, le a [documentación](https://yunohost.org/install) para saber como instalalo.* + +## Vista xeral + +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/) + + +**Versión proporcionada:** 0.1.2023.09.21~ynh2 + +**Demo:** + +## Capturas de pantalla + +![Captura de pantalla de Haste](./doc/screenshots/screenshot.png) + +## Documentación e recursos + +- Web oficial da app: +- Documentación oficial para usuarias: +- Repositorio de orixe do código: +- Tenda YunoHost: +- Informar dun problema: + +## Info de desenvolvemento + +Envía a túa colaboración á [rama `testing`](https://github.com/YunoHost-Apps/haste_ynh/tree/testing). + +Para probar a rama `testing`, procede deste xeito: + +```bash +sudo yunohost app install https://github.com/YunoHost-Apps/haste_ynh/tree/testing --debug +ou +sudo yunohost app upgrade haste -u https://github.com/YunoHost-Apps/haste_ynh/tree/testing --debug +``` + +**Máis info sobre o empaquetado da app:** diff --git a/README_it.md b/README_it.md new file mode 100644 index 0000000..ac00e15 --- /dev/null +++ b/README_it.md @@ -0,0 +1,50 @@ + + +# Haste per YunoHost + +[![Livello di integrazione](https://dash.yunohost.org/integration/haste.svg)](https://dash.yunohost.org/appci/app/haste) ![Stato di funzionamento](https://ci-apps.yunohost.org/ci/badges/haste.status.svg) ![Stato di manutenzione](https://ci-apps.yunohost.org/ci/badges/haste.maintain.svg) + +[![Installa Haste con YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=haste) + +*[Leggi questo README in altre lingue.](./ALL_README.md)* + +> *Questo pacchetto ti permette di installare Haste su un server YunoHost in modo semplice e veloce.* +> *Se non hai YunoHost, consulta [la guida](https://yunohost.org/install) per imparare a installarlo.* + +## Panoramica + +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/) + + +**Versione pubblicata:** 0.1.2023.09.21~ynh2 + +**Prova:** + +## Screenshot + +![Screenshot di Haste](./doc/screenshots/screenshot.png) + +## Documentazione e risorse + +- Sito web ufficiale dell’app: +- Documentazione ufficiale per gli utenti: +- Repository upstream del codice dell’app: +- Store di YunoHost: +- Segnala un problema: + +## Informazioni per sviluppatori + +Si prega di inviare la tua pull request alla [branch di `testing`](https://github.com/YunoHost-Apps/haste_ynh/tree/testing). + +Per provare la branch di `testing`, si prega di procedere in questo modo: + +```bash +sudo yunohost app install https://github.com/YunoHost-Apps/haste_ynh/tree/testing --debug +o +sudo yunohost app upgrade haste -u https://github.com/YunoHost-Apps/haste_ynh/tree/testing --debug +``` + +**Maggiori informazioni riguardo il pacchetto di quest’app:**