mirror of
https://github.com/YunoHost-Apps/droppy_ynh.git
synced 2024-09-03 18:26:27 +02:00
Fix
This commit is contained in:
parent
a78a536caf
commit
a6396a9014
13 changed files with 61 additions and 74 deletions
|
@ -1,9 +1,9 @@
|
|||
;; Test complet
|
||||
; Manifest
|
||||
domain="domain.tld" (DOMAIN)
|
||||
path="/path" (PATH)
|
||||
admin="john" (USER)
|
||||
is_public=1 (PUBLIC|public=1|private=0)
|
||||
domain="domain.tld"
|
||||
path="/path"
|
||||
admin="john"
|
||||
is_public=1
|
||||
; Checks
|
||||
pkg_linter=1
|
||||
setup_sub_dir=1
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
#sub_path_only rewrite ^__PATH__$ __PATH__/ permanent;
|
||||
location ^~ __PATH__/ {
|
||||
|
||||
proxy_pass http://127.0.0.1:__PORT__/;
|
||||
|
|
1
doc/DESCRIPTION.md
Normal file
1
doc/DESCRIPTION.md
Normal file
|
@ -0,0 +1 @@
|
|||
Droppy is a self-hosted file storage server with a web interface and capabilities to edit files and view media directly in the browser.
|
1
doc/DESCRIPTION_fr.md
Normal file
1
doc/DESCRIPTION_fr.md
Normal file
|
@ -0,0 +1 @@
|
|||
Droppy est un serveur de stockage de fichiers auto-hébergé avec une interface Web et des capacités pour éditer des fichiers et afficher des médias directement dans le navigateur.
|
4
doc/DISCLAIMER.md
Normal file
4
doc/DISCLAIMER.md
Normal file
|
@ -0,0 +1,4 @@
|
|||
## Configuration
|
||||
|
||||
How to configure this app: a JSON configuration file with SSH. `/var/www/droppy/config/config.json`.
|
||||
Shared files are stored in the following directory: `/home/yunohost.app/droppy/files`
|
4
doc/DISCLAIMER_fr.md
Normal file
4
doc/DISCLAIMER_fr.md
Normal file
|
@ -0,0 +1,4 @@
|
|||
## Configuration
|
||||
|
||||
Comment configurer cette application : un fichier de configuration `/var/www/droppy/config/config.json` en SSH.
|
||||
Les fichiers partagés sont stockés dans le répertoire suivant : `/home/yunohost.app/droppy/files/`
|
BIN
doc/screenshots/Ziv79rJ.png
Normal file
BIN
doc/screenshots/Ziv79rJ.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 261 KiB |
|
@ -8,12 +8,20 @@
|
|||
},
|
||||
"version": "12.2.0~ynh6",
|
||||
"url": "https://github.com/silverwind/droppy",
|
||||
"upstream": {
|
||||
"license": "BSD-2-Clause",
|
||||
"website": "https://github.com/silverwind/droppy",
|
||||
"demo": "https://demo.example.com",
|
||||
"admindoc": "https://yunohost.org/packaging_apps",
|
||||
"userdoc": "https://yunohost.org/apps",
|
||||
"code": "https://github.com/silverwind/droppy"
|
||||
},
|
||||
"license": "BSD-2-Clause",
|
||||
"maintainer": {
|
||||
"name": "eric_G"
|
||||
},
|
||||
"requirements": {
|
||||
"yunohost": ">= 4.1.7"
|
||||
"yunohost": ">= 4.2.4"
|
||||
},
|
||||
"multi_instance": false,
|
||||
"services": [
|
||||
|
|
|
@ -28,6 +28,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
|
||||
|
@ -52,7 +53,7 @@ ynh_backup --src_path="/etc/nginx/conf.d/$domain.d/$app.conf"
|
|||
# BACKUP DATADIR DIRECTORY
|
||||
#=================================================
|
||||
|
||||
ynh_backup --src_path="/home/yunohost.app/$app"
|
||||
ynh_backup --src_path="$data_path"
|
||||
|
||||
#=================================================
|
||||
# BACKUP SYSTEMD
|
||||
|
|
|
@ -76,6 +76,10 @@ ynh_app_setting_set --app=$app --key=final_path --value=$final_path
|
|||
# Download, check integrity, uncompress and patch the source from app.src
|
||||
ynh_setup_source --dest_dir=$final_path
|
||||
|
||||
chmod 750 "$final_path"
|
||||
chmod -R o-rwx "$final_path"
|
||||
chown -R $app:www-data "$final_path"
|
||||
|
||||
#=================================================
|
||||
# NGINX CONFIGURATION
|
||||
#=================================================
|
||||
|
@ -99,10 +103,10 @@ ynh_system_user_create --username=$app --home_dir=$final_path
|
|||
#==============================================
|
||||
ynh_script_progression --message="Building $app... (this will take some time and resources!)" --weight=26
|
||||
|
||||
pushd "$final_path" || ynh_die
|
||||
pushd "$final_path"
|
||||
ynh_use_nodejs
|
||||
ynh_exec_warn_less ynh_npm install
|
||||
popd || ynh_die
|
||||
popd
|
||||
|
||||
#=================================================
|
||||
# CREATE DIRECTORY FOR DATA AND CONFIG
|
||||
|
@ -110,16 +114,17 @@ popd || ynh_die
|
|||
ynh_script_progression --message="Creating the data directory..." --weight=1
|
||||
|
||||
# Define app's data directory
|
||||
data_path="/home/yunohost.app/${app}"
|
||||
data_path=/home/yunohost.app/$app
|
||||
ynh_app_setting_set --app=$app --key=data_path --value=$data_path
|
||||
|
||||
# Create datadir folder
|
||||
mkdir -p $data_path
|
||||
|
||||
# Create config folder
|
||||
mkdir -p $final_path/config
|
||||
|
||||
# Give permission to the datadir
|
||||
chown -R $app: "$data_path"
|
||||
chmod 750 "$data_path"
|
||||
chmod -R o-rwx "$data_path"
|
||||
chown -R $app:www-data "$data_path"
|
||||
|
||||
#=================================================
|
||||
# SETUP SYSTEMD
|
||||
|
@ -127,7 +132,6 @@ chown -R $app: "$data_path"
|
|||
ynh_script_progression --message="Configuring a systemd service..." --weight=1
|
||||
|
||||
ynh_replace_string --match_string="__ENV_PATH__" --replace_string="$PATH" --target_file="../conf/systemd.service"
|
||||
ynh_replace_string --match_string="__YNH_NPM__" --replace_string="$ynh_npm" --target_file="../conf/systemd.service"
|
||||
|
||||
ynh_add_systemd_config
|
||||
|
||||
|
@ -137,18 +141,8 @@ ynh_add_systemd_config
|
|||
ynh_script_progression --message="Modifying a config file..." --weight=1
|
||||
|
||||
ynh_add_config --template="../conf/config.json.example" --destination="$final_path/config/config.json"
|
||||
|
||||
#=================================================
|
||||
# GENERIC FINALIZATION
|
||||
#=================================================
|
||||
# SECURE FILES AND DIRECTORIES
|
||||
#=================================================
|
||||
ynh_script_progression --message="Securing files and directories..." --weight=1
|
||||
|
||||
# Set permissions to app files
|
||||
chown -R $app: $final_path
|
||||
chmod 755 $final_path
|
||||
chmod 600 $final_path/config/config.json
|
||||
chown $app:$app $final_path/config/config.json
|
||||
|
||||
#=================================================
|
||||
# INTEGRATE SERVICE IN YUNOHOST
|
||||
|
|
|
@ -19,6 +19,7 @@ app=$YNH_APP_INSTANCE_NAME
|
|||
domain=$(ynh_app_setting_get --app=$app --key=domain)
|
||||
port=$(ynh_app_setting_get --app=$app --key=port)
|
||||
final_path=$(ynh_app_setting_get --app=$app --key=final_path)
|
||||
data_path=$(ynh_app_setting_get --app=$app --key=data_path)
|
||||
|
||||
#=================================================
|
||||
# STANDARD REMOVE
|
||||
|
@ -59,7 +60,7 @@ ynh_secure_remove --file="$final_path"
|
|||
# REMOVE DATADIR DIRECTORY
|
||||
#=================================================
|
||||
|
||||
ynh_secure_remove --file="/home/yunohost.app/$app"
|
||||
ynh_secure_remove --file="$data_path"
|
||||
|
||||
#=================================================
|
||||
# REMOVE NGINX CONFIGURATION
|
||||
|
|
|
@ -29,14 +29,13 @@ 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
|
||||
#=================================================
|
||||
ynh_script_progression --message="Validating restoration parameters..." --weight=2
|
||||
|
||||
ynh_webpath_available --domain=$domain --path_url=$path_url \
|
||||
|| ynh_die --message="Path not available: ${domain}${path_url}"
|
||||
test ! -d $final_path \
|
||||
|| ynh_die --message="There is already a directory: $final_path "
|
||||
|
||||
|
@ -64,14 +63,9 @@ ynh_script_progression --message="Restoring $app main directory..." --weight=20
|
|||
|
||||
ynh_restore_file --origin_path="$final_path"
|
||||
|
||||
#=================================================
|
||||
# RESTORE USER RIGHTS
|
||||
#=================================================
|
||||
ynh_script_progression --message="Restoring user rights..."
|
||||
|
||||
# Restore permissions on app files
|
||||
chown -R $app:$app $final_path
|
||||
chmod 755 $final_path
|
||||
chmod 750 "$final_path"
|
||||
chmod -R o-rwx "$final_path"
|
||||
chown -R $app:www-data "$final_path"
|
||||
|
||||
#=================================================
|
||||
# SPECIFIC RESTORATION
|
||||
|
@ -92,12 +86,15 @@ ynh_restore_file --origin_path="/etc/systemd/system/$app.service"
|
|||
systemctl enable $app.service --quiet
|
||||
|
||||
#=================================================
|
||||
# RESTORE VARIOUS FILES
|
||||
# RESTORE THE DATA DIRECTORY
|
||||
#=================================================
|
||||
ynh_script_progression --message="Restoring the data directory..." --weight=1
|
||||
|
||||
ynh_restore_file "/home/yunohost.app/$app"
|
||||
chown -R $app: "/home/yunohost.app/$app"
|
||||
chmod 600 $final_path/config/config.json
|
||||
ynh_restore_file --origin_path="$data_path" --not_mandatory
|
||||
|
||||
chmod 750 "$data_path"
|
||||
chmod -R o-rwx "$data_path"
|
||||
chown -R $app:www-data "$data_path"
|
||||
|
||||
#=================================================
|
||||
# INTEGRATE SERVICE IN YUNOHOST
|
||||
|
|
|
@ -86,6 +86,10 @@ then
|
|||
ynh_setup_source --dest_dir=$final_path
|
||||
fi
|
||||
|
||||
chmod 750 "$final_path"
|
||||
chmod -R o-rwx "$final_path"
|
||||
chown -R $app:www-data "$final_path"
|
||||
|
||||
#=================================================
|
||||
# NGINX CONFIGURATION
|
||||
#=================================================
|
||||
|
@ -103,43 +107,27 @@ ynh_script_progression --message="Upgrading dependencies..." --weight=2
|
|||
ynh_exec_warn_less ynh_install_nodejs --nodejs_version=$nodejs_version
|
||||
|
||||
#=================================================
|
||||
# SPECIFIC UPGRADE
|
||||
#==============================================
|
||||
# INSTALL DROPPY
|
||||
#==============================================
|
||||
#=================================================
|
||||
|
||||
if [ "$upgrade_type" == "UPGRADE_APP" ]
|
||||
then
|
||||
ynh_script_progression --message="Building $app... (this will take some time and resources!)" --weight=25
|
||||
|
||||
pushd "$final_path" || ynh_die
|
||||
pushd "$final_path"
|
||||
ynh_use_nodejs
|
||||
ynh_exec_warn_less ynh_npm install
|
||||
popd || ynh_die
|
||||
popd
|
||||
fi
|
||||
|
||||
#=================================================
|
||||
# CREATE DIRECTORY FOR DATA AND CONFIG
|
||||
#=================================================
|
||||
ynh_script_progression --message="Creating the data directory..." --weight=1
|
||||
|
||||
# Define app's data directory
|
||||
data_path="/home/yunohost.app/${app}"
|
||||
|
||||
# Create datadir folder
|
||||
mkdir -p $data_path
|
||||
|
||||
# Create config folder
|
||||
mkdir -p $final_path/config
|
||||
|
||||
# Give permission to the datadir
|
||||
chown -R $app:$app "$data_path"
|
||||
|
||||
#=================================================
|
||||
# MODIFY A CONFIG FILE
|
||||
#=================================================
|
||||
ynh_script_progression --message="Modifying a config file..." --weight=2
|
||||
|
||||
ynh_add_config --template="../conf/config.json.example" --destination="$final_path/config/config.json"
|
||||
chmod 600 $final_path/config/config.json
|
||||
chown $app:$app $final_path/config/config.json
|
||||
|
||||
#=================================================
|
||||
# SETUP SYSTEMD
|
||||
|
@ -147,23 +135,10 @@ ynh_add_config --template="../conf/config.json.example" --destination="$final_pa
|
|||
ynh_script_progression --message="Configuring a systemd service..." --weight=2
|
||||
|
||||
ynh_replace_string --match_string="__ENV_PATH__" --replace_string="$PATH" --target_file="../conf/systemd.service"
|
||||
ynh_replace_string --match_string="__YNH_NPM__" --replace_string="$ynh_npm" --target_file="../conf/systemd.service"
|
||||
|
||||
# Create a dedicated systemd config
|
||||
ynh_add_systemd_config
|
||||
|
||||
#=================================================
|
||||
# GENERIC FINALIZATION
|
||||
#=================================================
|
||||
# SECURE FILES AND DIRECTORIES
|
||||
#=================================================
|
||||
ynh_script_progression --message="Securing files and directories..." --weight=2
|
||||
|
||||
# Set permissions on app files
|
||||
chown -R $app:$app $final_path
|
||||
chmod 755 $final_path
|
||||
chmod 600 $final_path/config/config.json
|
||||
|
||||
#=================================================
|
||||
# INTEGRATE SERVICE IN YUNOHOST
|
||||
#=================================================
|
||||
|
|
Loading…
Add table
Reference in a new issue