1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/planka_ynh.git synced 2024-09-03 20:06:00 +02:00
This commit is contained in:
Éric Gaspar 2023-12-14 10:57:47 +01:00
parent e86bfcddaa
commit 3d99deb9aa
6 changed files with 1 additions and 17 deletions

View file

@ -9,7 +9,7 @@ Group=__APP__
WorkingDirectory=__INSTALL_DIR__
Environment="__YNH_NODE_LOAD_PATH__"
Environment="NODE_ENV=production"
ExecStart=__YNH_NPM__ start --prod
ExecStart=__YNH_NPM__ __INSTALL_DIR__/app.js --port=__PORT__
# Sandboxing options to harden security
# Depending on specificities of your service/app, you may need to tweak these

View file

@ -6,7 +6,6 @@
# IMPORT GENERIC HELPERS
#=================================================
# Keep this path for calling _common.sh inside the execution's context of backup and restore scripts
source ../settings/scripts/_common.sh
source /usr/share/yunohost/helpers

View file

@ -20,7 +20,6 @@ lastname=$(yunohost user list --fields lastname --output-as json | jq -r .users.
#=================================================
ynh_script_progression --message="Installing dependencies..." --weight=10
# Install Nodejs
ynh_exec_warn_less ynh_install_nodejs --nodejs_version=$nodejs_version
#=================================================
@ -30,7 +29,6 @@ ynh_exec_warn_less ynh_install_nodejs --nodejs_version=$nodejs_version
#=================================================
ynh_script_progression --message="Setting up source files..." --weight=1
# Download, check integrity, uncompress and patch the source from manifest.toml
ynh_setup_source --dest_dir="$install_dir"
chmod -R o-rwx "$install_dir"
@ -41,18 +39,14 @@ chown -R $app:www-data "$install_dir"
#=================================================
ynh_script_progression --message="Adding system configurations related to $app..." --weight=1
# Create a dedicated NGINX config using the conf/nginx.conf template
ynh_add_nginx_config
# Create a dedicated systemd config
ynh_add_systemd_config
yunohost service add $app --description="Realtime kanban board for workgroups" --log="/var/log/$app/$app.log"
# Use logrotate to manage application logfile(s)
ynh_use_logrotate
# Create a dedicated Fail2Ban config
ynh_add_fail2ban_config --logpath="/var/log/nginx/${domain}-error.log" --failregex="^(.*) Invalid (email or username:|password!) (\"(.*)\"!)? ?\(IP: <ADDR>\)$"
#=================================================
@ -85,7 +79,6 @@ popd
#=================================================
ynh_script_progression --message="Starting a systemd service..." --weight=1
# Start a systemd service
ynh_systemd_action --service_name=$app --action="start" --log_path="systemd"
#=================================================

View file

@ -16,9 +16,6 @@ source /usr/share/yunohost/helpers
#=================================================
ynh_script_progression --message="Removing system configurations related to $app..." --weight=1
# This should be a symetric version of what happens in the install script
# Remove the service from the list of services known by YunoHost (added from `yunohost service add`)
if ynh_exec_warn_less yunohost service status $app >/dev/null
then
ynh_script_progression --message="Removing $app service integration..." --weight=1

View file

@ -25,7 +25,6 @@ chown -R $app:www-data "$install_dir"
#=================================================
ynh_script_progression --message="Reinstalling dependencies..." --weight=6
# Install Nodejs
ynh_exec_warn_less ynh_install_nodejs --nodejs_version=$nodejs_version
#=================================================
@ -62,7 +61,6 @@ ynh_systemd_action --action=restart --service_name=fail2ban
#=================================================
ynh_script_progression --message="Reloading NGINX web server and $app's service..." --weight=1
# Typically you only have either $app or php-fpm but not both at the same time...
ynh_systemd_action --service_name=$app --action="start" --log_path="systemd"
ynh_systemd_action --service_name=nginx --action=reload

View file

@ -28,7 +28,6 @@ if [ "$upgrade_type" == "UPGRADE_APP" ]
then
ynh_script_progression --message="Upgrading source files..." --weight=1
# Download, check integrity, uncompress and patch the source from manifest.toml
ynh_setup_source --dest_dir="$install_dir" --keep=".env"
fi
@ -48,10 +47,8 @@ ynh_add_systemd_config
yunohost service add $app --description="Realtime kanban board for workgroups" --log="/var/log/$app/$app.log"
# Use logrotate to manage application logfile(s)
ynh_use_logrotate --non-append
# Create a dedicated Fail2Ban config
ynh_add_fail2ban_config --logpath="/var/log/nginx/${domain}-error.log" --failregex="^(.*) Invalid (email or username:|password!) (\"(.*)\"!)? ?\(IP: <ADDR>\)$"
#=================================================