1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/borgwarehouse_ynh.git synced 2024-09-03 18:16:17 +02:00

Merge pull request #23 from Limezy/fix-upgrade

Fix upgrade
This commit is contained in:
Limezy 2024-05-17 11:56:51 +07:00 committed by GitHub
commit fcf70ffc32
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 16 additions and 1 deletions

View file

@ -1 +1 @@
* * * * * root curl --request POST --url 'http://127.0.0.1:__PORT__/api/cronjob/checkStatus' --header 'Authorization: Bearer __CRON_KEY__' ; curl --request POST --url 'http://127.0.0.1:__PORT__/api/cronjob/getStorageUsed' --header 'Authorization: Bearer __CRON_KEY__' 10 * * * * root curl --request POST --url 'http://127.0.0.1:__PORT__/api/cronjob/checkStatus' --header 'Authorization: Bearer __CRON_KEY__' ; curl --request POST --url 'http://127.0.0.1:__PORT__/api/cronjob/getStorageUsed' --header 'Authorization: Bearer __CRON_KEY__'

View file

@ -51,6 +51,11 @@ ynh_add_nginx_config
ynh_add_systemd_config ynh_add_systemd_config
# Update cron in case of changes
ynh_add_config --template="cron" --destination="/etc/cron.d/$app"
chown root: "/etc/cron.d/$app"
chmod 644 "/etc/cron.d/$app"
yunohost service add $app --description="WebUI for BorgBackup" --log="/var/log/$app/$app.log" yunohost service add $app --description="WebUI for BorgBackup" --log="/var/log/$app/$app.log"
#================================================= #=================================================
@ -65,6 +70,16 @@ ynh_add_config --template=".env" --destination="/home/yunohost.app/$app/app/.env
chmod 400 "/home/yunohost.app/$app/app/.env.local" chmod 400 "/home/yunohost.app/$app/app/.env.local"
chown $app:$app "/home/yunohost.app/$app/app/.env.local" chown $app:$app "/home/yunohost.app/$app/app/.env.local"
#=================================================
# INSTALL BORGWARHOUSE
#=================================================
pushd /home/yunohost.app/$app/app
ynh_use_nodejs
ynh_exec_warn_less sudo -u $app env $ynh_node_load_PATH $ynh_npm ci
ynh_exec_warn_less sudo -u $app env $ynh_node_load_PATH NODE_ENV=production $ynh_npm run build
popd
#================================================= #=================================================
# START SYSTEMD SERVICE # START SYSTEMD SERVICE
#================================================= #=================================================