1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/haste_ynh.git synced 2024-09-03 20:36:28 +02:00
* 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 <yunohost@yunohost.org>

* Update _common.sh (#34)

* Update _common.sh

* Fix

* cleaning up

* Update manifest.json

* Auto-update README

Co-authored-by: Alexandre Aubin <alex.aubin@mailoo.org>
Co-authored-by: YunoHost Bot <yunohost-bot@users.noreply.github.com>
Co-authored-by: Yunohost-Bot <>
Co-authored-by: yunohost-bot <yunohost@yunohost.org>
This commit is contained in:
Éric Gaspar 2022-05-13 23:11:01 +02:00 committed by GitHub
parent 0ea46c375b
commit 22e72e31dc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 41 additions and 21 deletions

View file

@ -18,7 +18,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.0~ynh10
**Shipped version:** 0.1.0~ynh11
**Demo:** http://hastebin.com/

View file

@ -14,7 +14,7 @@ Si vous n'avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) pour
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.0~ynh10
**Version incluse :** 0.1.0~ynh11
**Démo :** http://hastebin.com/

View file

@ -12,9 +12,14 @@
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&

View file

@ -6,7 +6,7 @@
"en": "Open-source pastebin allowing to upload texts",
"fr": "Pastebin open-source permettant de mettre en ligne du texte"
},
"version": "0.1.0~ynh10",
"version": "0.1.0~ynh11",
"url": "http://hastebin.com/",
"upstream": {
"license": "MIT",

View file

@ -4,7 +4,7 @@
# COMMON VARIABLES
#=================================================
nodejs_version=14
nodejs_version=18
#=================================================
# PERSONAL HELPERS

View file

@ -55,7 +55,7 @@ ynh_backup --src_path="/etc/logrotate.d/$app"
# BACKUP DATADIR DIRECTORY
#=================================================
ynh_backup --src_path="$data_path"
ynh_backup --src_path="$data_path" --is_big
#=================================================
# BACKUP BINARY

View file

@ -94,14 +94,15 @@ ynh_exec_warn_less ynh_install_nodejs --nodejs_version=$nodejs_version
#=================================================
# ADD SYSTEMD SERVICE
#=================================================
ynh_script_progression --message="Configuring a systemd service..." --weight=1
ynh_replace_string --match_string="__ENV_PATH__" --replace_string="$PATH" --target_file="../conf/systemd.service"
env_path="$PATH"
ynh_add_systemd_config
#=================================================
# INSTALL HASTEBIN
#=================================================
ynh_script_progression --message="Installing $app..." --weight=5
pushd "$final_path"
ynh_use_nodejs
@ -111,7 +112,7 @@ popd
#=================================================
# CREATE DIRECTORY FOR DATA
#=================================================
ynh_script_progression --message="Creating the data directory..."
ynh_script_progression --message="Creating the data directory..." --weight=1
# Define app's data directory
data_path="/home/yunohost.app/${app}"
@ -127,6 +128,7 @@ chown -R $app:www-data "$data_path"
#=================================================
# CONFIGURE HASTE
#=================================================
ynh_script_progression --message="Adding a configuration file..." --weight=1
ynh_add_config --template="../conf/config.js" --destination="$final_path/config.js"
@ -168,6 +170,7 @@ 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"

View file

@ -69,15 +69,10 @@ ynh_remove_logrotate
#=================================================
# REMOVE HASTE BINARY
#=================================================
ynh_script_progression --message="Removing various files..." --weight=1
ynh_secure_remove --file="/usr/bin/$app"
#=================================================
# REMOVE DATADIR DIRECTORY
#=================================================
ynh_secure_remove --file="$data_path"
#=================================================
# REMOVE DATA DIR
#=================================================
@ -92,6 +87,7 @@ fi
#=================================================
# REMOVE NODEJS
#=================================================
ynh_script_progression --message="Removing dependencies..." --weight=5
ynh_remove_nodejs

View file

@ -40,6 +40,7 @@ test ! -d $final_path || ynh_die "There is already a directory: $final_path "
#=================================================
# RESTORE THE NGINX CONFIGURATION
#=================================================
ynh_script_progression --message="Restoring the NGINX web server configuration..." --weight=1
ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf"
@ -70,12 +71,21 @@ ynh_exec_warn_less ynh_install_nodejs --nodejs_version=$nodejs_version
#=================================================
# RESTORE VARIOUS FILES
#=================================================
ynh_script_progression --message="Restoring the data directory..." --weight=1
ynh_restore_file --origin_path="$data_path"
ynh_restore_file --origin_path="$data_path" --not_mandatory
# Create app folders
mkdir -p "$data_path"
chmod 750 "$data_path"
chmod -R o-rwx "$data_path"
chown -R $app:www-data "$data_path"
#=================================================
# RESTORE BINARY
#=================================================
ynh_script_progression --message="Restoring various files..." --weight=1
ynh_restore_file --origin_path="/usr/bin/$app"
@ -100,6 +110,7 @@ chown $app -R /var/log/$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"
@ -111,6 +122,13 @@ ynh_script_progression --message="Restoring the systemd configuration..." --weig
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..." --weight=1
ynh_restore_file --origin_path="/etc/logrotate.d/$app"
#=================================================
# START SYSTEMD SERVICE
#=================================================
@ -118,12 +136,6 @@ ynh_script_progression --message="Starting a systemd service..." --weight=1
ynh_systemd_action --service_name=$app --action=start --log_path="/var/log/$app/$app.log"
#=================================================
# RESTORE THE LOGROTATE CONFIGURATION
#=================================================
ynh_restore_file --origin_path="/etc/logrotate.d/$app"
#=================================================
# GENERIC FINALIZATION
#=================================================

View file

@ -108,12 +108,14 @@ ynh_system_user_create --username=$app
#=================================================
# UPGRADE NODEJS
#=================================================
ynh_script_progression --message="Upgrading dependencies..." --weight=8
ynh_exec_warn_less ynh_install_nodejs --nodejs_version=$nodejs_version
#=================================================
# UPGRADE NPM MODULES
#=================================================
ynh_script_progression --message="Installing $app..." --weight=8
pushd "$final_path"
ynh_use_nodejs
@ -149,6 +151,7 @@ ynh_replace_string --match_string="https://ajax.googleapis.com/ajax/libs/jquery/
#=================================================
# UPGRADE HASTE BINARY
#=================================================
ynh_script_progression --message="Updating a configuration file..." --weight=1
haste_url="${domain}${path_url}"
ynh_add_config --template="../conf/haste.sh" --destination="/usr/bin/$app"
@ -167,6 +170,7 @@ 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"