mirror of
https://github.com/YunoHost-Apps/lufi_ynh.git
synced 2024-09-03 19:36:28 +02:00
commit
87d6e99887
10 changed files with 65 additions and 5 deletions
|
@ -23,7 +23,7 @@ The administrator of the Lufi instance you use will not be able to see what is i
|
||||||
The encryption key part of the URL is a anchor (Cf. [Fragment Identifier](https://en.wikipedia.org/wiki/Fragment_identifier)), that means this part is only processed client-side and does not reach the server. :-)
|
The encryption key part of the URL is a anchor (Cf. [Fragment Identifier](https://en.wikipedia.org/wiki/Fragment_identifier)), that means this part is only processed client-side and does not reach the server. :-)
|
||||||
|
|
||||||
|
|
||||||
**Shipped version:** 0.05.18~ynh1
|
**Shipped version:** 0.05.18~ynh2
|
||||||
|
|
||||||
**Demo:** https://demo.lufi.io/
|
**Demo:** https://demo.lufi.io/
|
||||||
|
|
||||||
|
|
|
@ -23,7 +23,7 @@ The administrator of the Lufi instance you use will not be able to see what is i
|
||||||
The encryption key part of the URL is a anchor (Cf. [Fragment Identifier](https://en.wikipedia.org/wiki/Fragment_identifier)), that means this part is only processed client-side and does not reach the server. :-)
|
The encryption key part of the URL is a anchor (Cf. [Fragment Identifier](https://en.wikipedia.org/wiki/Fragment_identifier)), that means this part is only processed client-side and does not reach the server. :-)
|
||||||
|
|
||||||
|
|
||||||
**Version incluse :** 0.05.18~ynh1
|
**Version incluse :** 0.05.18~ynh2
|
||||||
|
|
||||||
**Démo :** https://demo.lufi.io/
|
**Démo :** https://demo.lufi.io/
|
||||||
|
|
||||||
|
|
|
@ -110,7 +110,7 @@
|
||||||
# Remember that it has to be in a directory writable by Lufi user
|
# Remember that it has to be in a directory writable by Lufi user
|
||||||
# DO NOT CHANGE THIS IF FILES HAVE BEEN ALREADY UPLOADED: THEY WILL NOT BE DOWNLOADABLE ANYMORE
|
# DO NOT CHANGE THIS IF FILES HAVE BEEN ALREADY UPLOADED: THEY WILL NOT BE DOWNLOADABLE ANYMORE
|
||||||
# optional, default is 'files'
|
# optional, default is 'files'
|
||||||
#upload_dir => 'files',
|
upload_dir => '__DATADIR__/upload',
|
||||||
|
|
||||||
#!!!!!!!!!!!!!!!
|
#!!!!!!!!!!!!!!!
|
||||||
# EXPERIMENTAL !
|
# EXPERIMENTAL !
|
||||||
|
@ -169,7 +169,7 @@
|
||||||
|
|
||||||
# Disable sending mail through the server
|
# Disable sending mail through the server
|
||||||
# optional, default is false
|
# optional, default is false
|
||||||
#disable_mail_sending => 0,
|
disable_mail_sending => 1,
|
||||||
|
|
||||||
#############
|
#############
|
||||||
# DB settings
|
# DB settings
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
"en": "Self hosting files and sharing anonymous application",
|
"en": "Self hosting files and sharing anonymous application",
|
||||||
"fr": "Application d'hébergement et de partage de fichiers anonyme"
|
"fr": "Application d'hébergement et de partage de fichiers anonyme"
|
||||||
},
|
},
|
||||||
"version": "0.05.18~ynh1",
|
"version": "0.05.18~ynh2",
|
||||||
"url": "https://git.framasoft.org/luc/lufi",
|
"url": "https://git.framasoft.org/luc/lufi",
|
||||||
"upstream": {
|
"upstream": {
|
||||||
"license": "AGPL-3.0-or-later",
|
"license": "AGPL-3.0-or-later",
|
||||||
|
|
|
@ -30,6 +30,7 @@ app=$YNH_APP_INSTANCE_NAME
|
||||||
final_path=$(ynh_app_setting_get --app=$app --key=final_path)
|
final_path=$(ynh_app_setting_get --app=$app --key=final_path)
|
||||||
domain=$(ynh_app_setting_get --app=$app --key=domain)
|
domain=$(ynh_app_setting_get --app=$app --key=domain)
|
||||||
db_name=$(ynh_app_setting_get --app=$app --key=db_name)
|
db_name=$(ynh_app_setting_get --app=$app --key=db_name)
|
||||||
|
datadir=$(ynh_app_setting_get --app=$app --key=datadir)
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# DECLARE DATA AND CONF FILES TO BACKUP
|
# DECLARE DATA AND CONF FILES TO BACKUP
|
||||||
|
@ -42,6 +43,12 @@ ynh_print_info --message="Declaring files to be backed up..."
|
||||||
|
|
||||||
ynh_backup --src_path="$final_path"
|
ynh_backup --src_path="$final_path"
|
||||||
|
|
||||||
|
#=================================================
|
||||||
|
# BACKUP THE DATA DIR
|
||||||
|
#=================================================
|
||||||
|
|
||||||
|
ynh_backup --src_path="$datadir" --is_big
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# BACKUP THE NGINX CONFIGURATION
|
# BACKUP THE NGINX CONFIGURATION
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
|
@ -37,6 +37,7 @@ db_pwd=$(ynh_app_setting_get --app=$app --key=psqlpwd)
|
||||||
db_user=$db_name
|
db_user=$db_name
|
||||||
secret=$(ynh_app_setting_get --app=$app --key=secret)
|
secret=$(ynh_app_setting_get --app=$app --key=secret)
|
||||||
max_file_size=$(ynh_app_setting_get --app=$app --key=max_file_size)
|
max_file_size=$(ynh_app_setting_get --app=$app --key=max_file_size)
|
||||||
|
datadir=$(ynh_app_setting_get --app=$app --key=datadir)
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# BACKUP BEFORE CHANGE URL THEN ACTIVE TRAP
|
# BACKUP BEFORE CHANGE URL THEN ACTIVE TRAP
|
||||||
|
|
|
@ -121,6 +121,20 @@ ynh_add_nginx_config
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# SPECIFIC SETUP
|
# SPECIFIC SETUP
|
||||||
|
#=================================================
|
||||||
|
# CREATE DATA DIRECTORY
|
||||||
|
#=================================================
|
||||||
|
ynh_script_progression --message="Creating a data directory..."
|
||||||
|
|
||||||
|
datadir=/home/yunohost.app/$app
|
||||||
|
ynh_app_setting_set --app=$app --key=datadir --value=$datadir
|
||||||
|
|
||||||
|
mkdir -p $datadir/upload
|
||||||
|
|
||||||
|
chmod 750 "$datadir"
|
||||||
|
chmod -R o-rwx "$datadir"
|
||||||
|
chown -R $app:www-data "$datadir"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# CONFIGURE LUFI
|
# CONFIGURE LUFI
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
|
@ -21,6 +21,7 @@ port=$(ynh_app_setting_get --app=$app --key=port)
|
||||||
db_name=$(ynh_app_setting_get --app=$app --key=db_name)
|
db_name=$(ynh_app_setting_get --app=$app --key=db_name)
|
||||||
db_user=$db_name
|
db_user=$db_name
|
||||||
final_path=$(ynh_app_setting_get --app=$app --key=final_path)
|
final_path=$(ynh_app_setting_get --app=$app --key=final_path)
|
||||||
|
datadir=$(ynh_app_setting_get --app=$app --key=datadir)
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# STANDARD REMOVE
|
# STANDARD REMOVE
|
||||||
|
@ -67,6 +68,17 @@ ynh_script_progression --message="Removing app main directory..."
|
||||||
# Remove the app directory securely
|
# Remove the app directory securely
|
||||||
ynh_secure_remove --file="$final_path"
|
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..."
|
||||||
|
ynh_secure_remove --file="$datadir"
|
||||||
|
fi
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# REMOVE NGINX CONFIGURATION
|
# REMOVE NGINX CONFIGURATION
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
|
@ -33,6 +33,7 @@ final_path=$(ynh_app_setting_get --app=$app --key=final_path)
|
||||||
db_name=$(ynh_app_setting_get --app=$app --key=db_name)
|
db_name=$(ynh_app_setting_get --app=$app --key=db_name)
|
||||||
db_user=$db_name
|
db_user=$db_name
|
||||||
db_pwd=$(ynh_app_setting_get --app=$app --key=psqlpwd)
|
db_pwd=$(ynh_app_setting_get --app=$app --key=psqlpwd)
|
||||||
|
datadir=$(ynh_app_setting_get --app=$app --key=datadir)
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# CHECK IF THE APP CAN BE RESTORED
|
# CHECK IF THE APP CAN BE RESTORED
|
||||||
|
@ -63,6 +64,19 @@ chmod 750 "$final_path"
|
||||||
chmod -R o-rwx "$final_path"
|
chmod -R o-rwx "$final_path"
|
||||||
chown -R $app:www-data "$final_path"
|
chown -R $app:www-data "$final_path"
|
||||||
|
|
||||||
|
#=================================================
|
||||||
|
# RESTORE THE DATA DIRECTORY
|
||||||
|
#=================================================
|
||||||
|
ynh_script_progression --message="Restoring the data directory..."
|
||||||
|
|
||||||
|
ynh_restore_file --origin_path="$datadir" --not_mandatory
|
||||||
|
|
||||||
|
mkdir -p $datadir
|
||||||
|
|
||||||
|
chmod 750 "$datadir"
|
||||||
|
chmod -R o-rwx "$datadir"
|
||||||
|
chown -R $app:www-data "$datadir"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# SPECIFIC RESTORATION
|
# SPECIFIC RESTORATION
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
|
@ -26,6 +26,7 @@ db_name=$(ynh_app_setting_get --app=$app --key=db_name)
|
||||||
db_user=$db_name
|
db_user=$db_name
|
||||||
db_pwd=$(ynh_app_setting_get --app=$app --key=psqlpwd)
|
db_pwd=$(ynh_app_setting_get --app=$app --key=psqlpwd)
|
||||||
max_file_size=$(ynh_app_setting_get --app=$app --key=max_file_size)
|
max_file_size=$(ynh_app_setting_get --app=$app --key=max_file_size)
|
||||||
|
datadir=$(ynh_app_setting_get --app=$app --key=datadir)
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# CHECK VERSION
|
# CHECK VERSION
|
||||||
|
@ -113,6 +114,17 @@ if ynh_legacy_permissions_exists; then
|
||||||
ynh_app_setting_delete --app=$app --key=is_public
|
ynh_app_setting_delete --app=$app --key=is_public
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# If datadir doesn't exist, create it
|
||||||
|
if [ -z "$datadir" ]; then
|
||||||
|
datadir=/home/yunohost.app/$app
|
||||||
|
ynh_app_setting_set --app=$app --key=datadir --value=$datadir
|
||||||
|
mkdir -p $datadir
|
||||||
|
mv -f "$final_path/files" "$datadir/upload"
|
||||||
|
chmod 750 "$datadir"
|
||||||
|
chmod -R o-rwx "$datadir"
|
||||||
|
chown -R $app:www-data "$datadir"
|
||||||
|
fi
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# CREATE DEDICATED USER
|
# CREATE DEDICATED USER
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
Loading…
Reference in a new issue