1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/uptime-kuma_ynh.git synced 2024-10-01 13:34:58 +02:00

disable datadir

This commit is contained in:
Hadrien 2021-11-02 12:38:23 +03:00
parent d303c53b1b
commit 912e310192
5 changed files with 38 additions and 38 deletions

View file

@ -32,7 +32,7 @@ final_path=$(ynh_app_setting_get --app=$app --key=final_path)
domain=$(ynh_app_setting_get --app=$app --key=domain)
# db_name=$(ynh_app_setting_get --app=$app --key=db_name)
# phpversion=$(ynh_app_setting_get --app=$app --key=phpversion)
datadir=$(ynh_app_setting_get --app=$app --key=datadir)
# datadir=$(ynh_app_setting_get --app=$app --key=datadir)
#=================================================
# DECLARE DATA AND CONF FILES TO BACKUP
@ -54,7 +54,7 @@ ynh_backup --src_path="$final_path" --is_big
# BACKUP THE DATA DIR
#=================================================
ynh_backup --src_path="$datadir"
# ynh_backup --src_path="$datadir"
#=================================================
# BACKUP THE NGINX CONFIGURATION

View file

@ -118,7 +118,7 @@ ynh_app_setting_set --app=$app --key=port --value=$port
#=================================================
# INSTALL NODEJS
#=================================================
ynh_script_progression --message="Installing NodeJS..." --weight=2
ynh_script_progression --message="Installing nodejs..." --weight=2
ynh_install_nodejs --nodejs_version=$nodejs_version
@ -218,7 +218,7 @@ cd $final_path && ynh_exec_warn_less $ynh_npm install
#=================================================
# CREATE DATA DIRECTORY
#=================================================
ynh_script_progression --message="Creating a data directory..." --weight=1
# ynh_script_progression --message="Creating a data directory..." --weight=1
### Use these lines if you need to create a directory to store "persistent files" for the application.
### Usually this directory is used to store uploaded files or any file that won't be updated during
@ -228,20 +228,20 @@ ynh_script_progression --message="Creating a data directory..." --weight=1
### - Remove the section "RESTORE THE DATA DIRECTORY" in the restore script
### - As well as the section "REMOVE DATA DIR" in the remove script
datadir=/home/yunohost.app/$app/data
ynh_app_setting_set --app=$app --key=datadir --value=$datadir
# datadir=/home/yunohost.app/$app/data
# ynh_app_setting_set --app=$app --key=datadir --value=$datadir
mkdir -p $datadir
# mkdir -p $datadir
# FIXME: this should be managed by the core in the future
# Here, as a packager, you may have to tweak the ownerhsip/permissions
# such that the appropriate users (e.g. maybe www-data) can access
# files in some cases.
# But FOR THE LOVE OF GOD, do not allow r/x for "others" on the entire folder -
# this will be treated as a security issue.
chmod 750 "$datadir"
chmod -R o-rwx "$datadir"
chown -R $app:www-data "$datadir"
# # FIXME: this should be managed by the core in the future
# # Here, as a packager, you may have to tweak the ownerhsip/permissions
# # such that the appropriate users (e.g. maybe www-data) can access
# # files in some cases.
# # But FOR THE LOVE OF GOD, do not allow r/x for "others" on the entire folder -
# # this will be treated as a security issue.
# chmod 750 "$datadir"
# chmod -R o-rwx "$datadir"
# chown -R $app:www-data "$datadir"
#=================================================
# ADD A CONFIGURATION

View file

@ -21,7 +21,7 @@ port=$(ynh_app_setting_get --app=$app --key=port)
# db_name=$(ynh_app_setting_get --app=$app --key=db_name)
# db_user=$db_name
final_path=$(ynh_app_setting_get --app=$app --key=final_path)
datadir=$(ynh_app_setting_get --app=$app --key=datadir)
# datadir=$(ynh_app_setting_get --app=$app --key=datadir)
#=================================================
# STANDARD REMOVE
@ -87,12 +87,12 @@ ynh_secure_remove --file="$final_path"
# REMOVE DATA DIR
#=================================================
# Remove the data directory if --purge option is used
if [ "${YNH_APP_PURGE:-0}" -eq 1 ]
then
ynh_script_progression --message="Removing app data directory..." --time --weight=1
ynh_secure_remove --file="$datadir"
fi
# # Remove the data directory if --purge option is used
# if [ "${YNH_APP_PURGE:-0}" -eq 1 ]
# then
# ynh_script_progression --message="Removing app data directory..." --time --weight=1
# ynh_secure_remove --file="$datadir"
# fi
#=================================================
# REMOVE NGINX CONFIGURATION

View file

@ -34,7 +34,7 @@ final_path=$(ynh_app_setting_get --app=$app --key=final_path)
# db_name=$(ynh_app_setting_get --app=$app --key=db_name)
# db_user=$db_name
# phpversion=$(ynh_app_setting_get --app=$app --key=phpversion)
datadir=$(ynh_app_setting_get --app=$app --key=datadir)
# datadir=$(ynh_app_setting_get --app=$app --key=datadir)
#=================================================
# CHECK IF THE APP CAN BE RESTORED
@ -81,21 +81,21 @@ chown -R $app:www-data "$final_path"
#=================================================
# RESTORE THE DATA DIRECTORY
#=================================================
ynh_script_progression --message="Restoring the data directory..." --weight=1
# ynh_script_progression --message="Restoring the data directory..." --weight=1
ynh_restore_file --origin_path="$datadir" --not_mandatory
# ynh_restore_file --origin_path="$datadir" --not_mandatory
mkdir -p $datadir
# mkdir -p $datadir
# FIXME: this should be managed by the core in the future
# Here, as a packager, you may have to tweak the ownerhsip/permissions
# such that the appropriate users (e.g. maybe www-data) can access
# files in some cases.
# But FOR THE LOVE OF GOD, do not allow r/x for "others" on the entire folder -
# this will be treated as a security issue.
chmod 750 "$datadir"
chmod -R o-rwx "$datadir"
chown -R $app:www-data "$datadir"
# # FIXME: this should be managed by the core in the future
# # Here, as a packager, you may have to tweak the ownerhsip/permissions
# # such that the appropriate users (e.g. maybe www-data) can access
# # files in some cases.
# # But FOR THE LOVE OF GOD, do not allow r/x for "others" on the entire folder -
# # this will be treated as a security issue.
# chmod 750 "$datadir"
# chmod -R o-rwx "$datadir"
# chown -R $app:www-data "$datadir"
#=================================================
# RESTORE FAIL2BAN CONFIGURATION
@ -113,7 +113,7 @@ chown -R $app:www-data "$datadir"
#=================================================
# INSTALL NODEJS
#=================================================
ynh_script_progression --message="Reinstalling NodeJS..." --weight=2
ynh_script_progression --message="Reinstalling nodejs version..." --weight=2
ynh_install_nodejs --nodejs_version=$nodejs_version

View file

@ -118,7 +118,7 @@ chown -R $app:www-data "$final_path"
#=================================================
# INSTALL NODEJS
#=================================================
ynh_script_progression --message="Upgrading NodeJS..." --weight=2
ynh_script_progression --message="Upgrading nodejs..." --weight=2
ynh_install_nodejs --nodejs_version=$nodejs_version