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

* 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 <yunohost@yunohost.org>

* 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 <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>
Co-authored-by: yalh76 <yalh@yahoo.com>
This commit is contained in:
eric_G 2023-12-10 11:16:54 +01:00 committed by GitHub
parent bcfb07cce5
commit 603244adc4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 57 additions and 142 deletions

View file

@ -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/) 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/ **Demo:** http://hastebin.com/

View file

@ -19,7 +19,7 @@ Si vous navez 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/) 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/ **Démo :** http://hastebin.com/

View file

@ -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&

View file

@ -5,7 +5,7 @@ name = "Haste"
description.en = "Open-source pastebin allowing to upload texts" description.en = "Open-source pastebin allowing to upload texts"
description.fr = "Pastebin open-source permettant de mettre en ligne du texte" 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"] maintainers = ["eric_G"]
@ -20,8 +20,11 @@ code = "https://github.com/seejohnrun/haste-server"
yunohost = ">= 11.2" yunohost = ">= 11.2"
architectures = "all" architectures = "all"
multi_instance = false multi_instance = false
ldap = false ldap = false
sso = true sso = true
disk = "50M" disk = "50M"
ram.build = "50M" ram.build = "50M"
ram.runtime = "50M" ram.runtime = "50M"

View file

@ -9,6 +9,14 @@
source _common.sh source _common.sh
source /usr/share/yunohost/helpers 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 # DOWNLOAD, CHECK AND UNPACK SOURCE
#================================================= #=================================================
@ -25,24 +33,30 @@ ynh_script_progression --message="Configuring NGINX web server..." --weight=2
# Create a dedicated NGINX config # Create a dedicated NGINX config
ynh_add_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" env_path="$PATH"
ynh_add_systemd_config 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 # INSTALL HASTEBIN
#================================================= #=================================================
@ -53,24 +67,12 @@ pushd "$install_dir"
ynh_exec_warn_less $ynh_npm install ynh_exec_warn_less $ynh_npm install
popd 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 # ADD HASTE AS A BINARY FILE
#================================================= #=================================================
haste_url="${domain}${path}" 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 # GENERIC FINALIZATION
@ -83,25 +85,6 @@ chmod -R o-rwx "$install_dir"
chown -R $app:www-data "$install_dir" chown -R $app:www-data "$install_dir"
chmod +x /usr/bin/$app 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 # START SYSTEMD SERVICE
#================================================= #=================================================

View file

@ -22,43 +22,16 @@ then
yunohost service remove $app yunohost service remove $app
fi fi
#=================================================
# STOP AND REMOVE SERVICE
#=================================================
ynh_script_progression --message="Stopping and removing the systemd service..." --weight=1
# Remove the dedicated systemd config # Remove the dedicated systemd config
ynh_remove_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 # Remove the dedicated NGINX config
ynh_remove_nginx_config ynh_remove_nginx_config
#=================================================
# REMOVE LOGROTATE CONFIGURATION
#=================================================
ynh_script_progression --message="Removing logrotate configuration..." --weight=1
ynh_remove_logrotate ynh_remove_logrotate
#=================================================
# SPECIFIC REMOVE
#=================================================
# REMOVE HASTE BINARY
#=================================================
ynh_script_progression --message="Removing various files..." --weight=1
ynh_secure_remove --file="/usr/bin/$app" ynh_secure_remove --file="/usr/bin/$app"
#=================================================
# REMOVE NODEJS
#=================================================
ynh_script_progression --message="Removing dependencies..." --weight=5
ynh_remove_nodejs ynh_remove_nodejs
#================================================= #=================================================

View file

@ -9,6 +9,13 @@
source ../settings/scripts/_common.sh source ../settings/scripts/_common.sh
source /usr/share/yunohost/helpers 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 # RESTORE THE APP MAIN DIR
#================================================= #=================================================
@ -19,15 +26,6 @@ ynh_restore_file --origin_path="$install_dir"
chmod -R o-rwx "$install_dir" chmod -R o-rwx "$install_dir"
chown -R $app:www-data "$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 # RESTORE VARIOUS FILES
#================================================= #=================================================

View file

@ -34,6 +34,13 @@ then
ynh_setup_source --dest_dir="$install_dir" --keep="config.js" ynh_setup_source --dest_dir="$install_dir" --keep="config.js"
fi fi
#=================================================
# UPGRADE NODEJS
#=================================================
ynh_script_progression --message="Upgrading dependencies..." --weight=8
ynh_exec_warn_less ynh_install_nodejs --nodejs_version=$nodejs_version
#================================================= #=================================================
# NGINX CONFIGURATION # NGINX CONFIGURATION
#================================================= #=================================================
@ -42,14 +49,13 @@ ynh_script_progression --message="Upgrading NGINX web server configuration..." -
# Create a dedicated NGINX config # Create a dedicated NGINX config
ynh_add_nginx_config ynh_add_nginx_config
#================================================= # FIXME Currently, the log is only redirected to syslog.
# SPECIFIC UPGRADE ynh_use_logrotate --non-append
#=================================================
# UPGRADE NODEJS
#=================================================
ynh_script_progression --message="Upgrading dependencies..." --weight=8
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 # UPGRADE NPM MODULES
@ -61,22 +67,6 @@ pushd "$install_dir"
ynh_exec_warn_less $ynh_npm install ynh_exec_warn_less $ynh_npm install
popd 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 # 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 ynh_script_progression --message="Updating a configuration file..." --weight=1
haste_url="${domain}${path}" 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 # GENERIC FINALIZATION
@ -105,13 +95,6 @@ chmod -R o-rwx "$install_dir"
chown -R $app:www-data "$install_dir" chown -R $app:www-data "$install_dir"
chmod +x /usr/bin/$app 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 # START SYSTEMD SERVICE
#================================================= #=================================================