mirror of
https://github.com/YunoHost-Apps/haste_ynh.git
synced 2024-09-03 20:36:28 +02:00
Fix
This commit is contained in:
parent
c99abeec97
commit
f2ce62c8b4
6 changed files with 19 additions and 9 deletions
|
@ -26,6 +26,7 @@ app=$YNH_APP_INSTANCE_NAME
|
|||
|
||||
final_path=$(ynh_app_setting_get --app=$app --key=final_path)
|
||||
domain=$(ynh_app_setting_get --app=$app --key=domain)
|
||||
data_path=$(ynh_app_setting_get --app=$app --key=data_path)
|
||||
|
||||
#=================================================
|
||||
# DECLARE DATA AND CONF FILES TO BACKUP
|
||||
|
@ -54,7 +55,7 @@ ynh_backup --src_path="/etc/logrotate.d/$app"
|
|||
# BACKUP DATADIR DIRECTORY
|
||||
#=================================================
|
||||
|
||||
ynh_backup --src_path="/home/yunohost.app/$app"
|
||||
ynh_backup --src_path="$data_path"
|
||||
|
||||
#=================================================
|
||||
# BACKUP BINARY
|
||||
|
|
|
@ -17,7 +17,7 @@ old_domain=$YNH_APP_OLD_DOMAIN
|
|||
old_path=$YNH_APP_OLD_PATH
|
||||
|
||||
new_domain=$YNH_APP_NEW_DOMAIN
|
||||
new_path=$YNH_APP_NEW_PATH
|
||||
new_path="/"
|
||||
|
||||
app=$YNH_APP_INSTANCE_NAME
|
||||
|
||||
|
|
|
@ -119,6 +119,7 @@ data_path="/home/yunohost.app/${app}"
|
|||
|
||||
# Create app folders
|
||||
mkdir -p "$data_path"
|
||||
ynh_app_setting_set --app=$app --key=data_path --value=$data_path
|
||||
|
||||
#=================================================
|
||||
# CONFIGURE HASTE
|
||||
|
|
|
@ -18,6 +18,7 @@ app=$YNH_APP_INSTANCE_NAME
|
|||
|
||||
domain=$(ynh_app_setting_get --app=$app --key=domain)
|
||||
final_path=$(ynh_app_setting_get --app=$app --key=final_path)
|
||||
data_path=$(ynh_app_setting_get --app=$app --key=data_path)
|
||||
|
||||
#=================================================
|
||||
# STANDARD REMOVE
|
||||
|
@ -75,7 +76,7 @@ ynh_secure_remove --file="/usr/bin/$app"
|
|||
# REMOVE DATADIR DIRECTORY
|
||||
#=================================================
|
||||
|
||||
ynh_secure_remove --file="/home/yunohost.app/$app"
|
||||
ynh_secure_remove --file="$data_path"
|
||||
|
||||
#=================================================
|
||||
# REMOVE NODEJS
|
||||
|
|
|
@ -26,6 +26,7 @@ app=$YNH_APP_INSTANCE_NAME
|
|||
domain=$(ynh_app_setting_get --app=$app --key=domain)
|
||||
path_url=$(ynh_app_setting_get --app=$app --key=path)
|
||||
final_path=$(ynh_app_setting_get --app=$app --key=final_path)
|
||||
data_path=$(ynh_app_setting_get --app=$app --key=data_path)
|
||||
|
||||
#=================================================
|
||||
# CHECK IF THE APP CAN BE RESTORED
|
||||
|
@ -72,7 +73,7 @@ ynh_exec_warn_less ynh_install_nodejs --nodejs_version=$nodejs_version
|
|||
# RESTORE VARIOUS FILES
|
||||
#=================================================
|
||||
|
||||
ynh_restore_file "/home/yunohost.app/$app"
|
||||
ynh_restore_file "$data_path"
|
||||
|
||||
#=================================================
|
||||
# RESTORE BINARY
|
||||
|
@ -87,7 +88,7 @@ ynh_restore_file --origin_path="/usr/bin/$app"
|
|||
chmod 750 "$final_path"
|
||||
chmod -R o-rwx "$final_path"
|
||||
chown -R $app:www-data "$final_path"
|
||||
chown -R $app: "/home/yunohost.app/$app"
|
||||
chown -R $app: "$data_path"
|
||||
chmod +x /usr/bin/$app
|
||||
|
||||
#=================================================
|
||||
|
|
|
@ -19,6 +19,7 @@ domain=$(ynh_app_setting_get --app=$app --key=domain)
|
|||
path_url=$(ynh_app_setting_get --app=$app --key=path_url)
|
||||
final_path=$(ynh_app_setting_get --app=$app --key=final_path)
|
||||
port=$(ynh_app_setting_get --app=$app --key=port)
|
||||
data_path=$(ynh_app_setting_get --app=$app --key=data_path)
|
||||
|
||||
#=================================================
|
||||
# CHECK VERSION
|
||||
|
@ -37,6 +38,13 @@ if [ -z "$final_path" ]; then
|
|||
ynh_app_setting_set --app=$app --key=final_path --value=$final_path
|
||||
fi
|
||||
|
||||
# If data_path doesn't exist, create it
|
||||
if [ -z "$data_path" ]; then
|
||||
data_path="/home/yunohost.app/${app}"
|
||||
mkdir -p "$data_path"
|
||||
ynh_app_setting_set --app=$app --key=data_path --value=$data_path
|
||||
fi
|
||||
|
||||
# Cleaning legacy permissions
|
||||
if ynh_legacy_permissions_exists; then
|
||||
ynh_legacy_permissions_delete_all
|
||||
|
@ -135,7 +143,6 @@ ynh_add_systemd_config
|
|||
#=================================================
|
||||
|
||||
# Define app's data directory
|
||||
data_path="/home/yunohost.app/$app"
|
||||
ynh_add_config --template="../conf/config.js" --destination="$final_path/config.js"
|
||||
|
||||
# Replace ajax.googleapis by local file
|
||||
|
@ -147,9 +154,8 @@ ynh_replace_string --match_string="https://ajax.googleapis.com/ajax/libs/jquery/
|
|||
# UPGRADE HASTE BINARY
|
||||
#=================================================
|
||||
|
||||
ynh_replace_string --match_string="__YNH_HASTE_URL__" --replace_string="${domain}${path_url}" --target_file="../conf/haste.sh"
|
||||
|
||||
cp ../conf/haste.sh /usr/bin/$app
|
||||
haste_url="${domain}${path_url}"
|
||||
ynh_add_config --template="../conf/haste.sh" --destination="/usr/bin/$app"
|
||||
|
||||
#=================================================
|
||||
# GENERIC FINALIZATION
|
||||
|
|
Loading…
Add table
Reference in a new issue