1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/haste_ynh.git synced 2024-09-03 20:36:28 +02:00

Fix restore script

This commit is contained in:
ericgaspar 2020-09-06 18:03:25 +02:00
parent 7fbdc13a0f
commit 358c41c489
No known key found for this signature in database
GPG key ID: 574F281483054D44
6 changed files with 18 additions and 28 deletions

View file

@ -1,17 +1,10 @@
{
"host": "127.0.0.1",
"port": __PORT__,
"keyLength": 10,
"maxLength": 400000,
"staticMaxAge": 86400,
"recompressStaticAssets": true,
"logging": [
{
"level": "verbose",
@ -19,11 +12,9 @@
"colorize": true
}
],
"keyGenerator": {
"type": "phonetic"
},
"rateLimits": {
"categories": {
"normal": {
@ -32,14 +23,11 @@
}
}
},
"storage": {
"type": "file",
"path": "__YNH_DATA_PATH__"
},
"documents": {
"about": "./about.md"
}
}

View file

@ -5,7 +5,7 @@ location __PATH__/ {
rewrite ^ https://$server_name$request_uri? permanent;
}
proxy_pass http://localhost:__PORT__;
proxy_pass http://127.0.0.1:__PORT__;
proxy_set_header Host $host;
proxy_buffering off;

View file

@ -46,8 +46,6 @@ ynh_backup --src_path="$final_path"
ynh_backup --src_path="/etc/nginx/conf.d/$domain.d/$app.conf"
#=================================================
# SPECIFIC BACKUP
#=================================================
# BACKUP LOGROTATE
#=================================================

View file

@ -121,9 +121,6 @@ data_path="/home/yunohost.app/${app}"
# Create app folders
mkdir -p "$data_path"
# Give permission to the datadir
chown -R $app:$app "$data_path"
#=================================================
# CONFIGURE HASTE
#=================================================
@ -149,7 +146,6 @@ ynh_replace_string --match_string="__YNH_HASTE_URL__" --replace_string="${domain
ynh_replace_string --match_string="__PORT__" --replace_string="$port" --target_file="../conf/haste.sh"
cp ../conf/haste.sh /usr/bin/$app
chmod +x /usr/bin/$app
#=================================================
# GENERIC FINALIZATION
@ -158,7 +154,9 @@ chmod +x /usr/bin/$app
#=================================================
chown -R root: $final_path
chown -R $app "$final_path/static"
chown -R $app: "$final_path/static"
chown -R $app: "$data_path"
chmod +x /usr/bin/$app
#=================================================
# HANDLE LOG FILES AND SETUP LOGROTATE

View file

@ -85,13 +85,20 @@ systemctl enable $app.service
ynh_restore_file "/home/yunohost.app/$app"
#=================================================
# RESTORE BINARY
#=================================================
ynh_restore_file --origin_path="/usr/bin/$app"
#=================================================
# SECURE FILES AND DIRECTORIES
#=================================================
chown -R root: $final_path
chown -R $app "$final_path/static"
chown -R $app "/home/yunohost.app/$app"
chown -R $app: "$final_path/static"
chown -R $app: "/home/yunohost.app/$app"
chmod +x /usr/bin/$app
#=================================================
# INTEGRATE SERVICE IN YUNOHOST

View file

@ -171,8 +171,6 @@ ynh_replace_string --match_string="__YNH_HASTE_URL__" --replace_string="${domain
cp ../conf/haste.sh /usr/bin/$app
chmod +x /usr/bin/$app
#=================================================
# GENERIC FINALIZATION
#=================================================
@ -180,8 +178,9 @@ chmod +x /usr/bin/$app
#=================================================
chown -R root: $final_path
chown -R $app "$final_path/static"
chown -R $app "$data_path"
chown -R $app: "$final_path/static"
chown -R $app: "$data_path"
chmod +x /usr/bin/$app
#=================================================
# START SYSTEMD SERVICE