From 785329864573683ed41ac54d88958fc9515828ed Mon Sep 17 00:00:00 2001 From: rodinux Date: Mon, 1 Jan 2024 21:54:53 +0100 Subject: [PATCH] back to precedent commit ! --- doc/ADMIN.md | 10 +++++++++- doc/ADMIN_fr.md | 10 +++++++++- scripts/install | 6 +----- scripts/restore | 6 +----- scripts/upgrade | 12 +++++------- 5 files changed, 25 insertions(+), 19 deletions(-) diff --git a/doc/ADMIN.md b/doc/ADMIN.md index e2ea899..2ea8220 100644 --- a/doc/ADMIN.md +++ b/doc/ADMIN.md @@ -1,3 +1,11 @@ -If you wish, you can add custom configurations inside `__INSTALL_DIR__/config.local.php`. +If you wish, you can add custom configurations inside `__DATA_DIR__/data/config.local.user.php`. + +Use the `__DATA-DIR__/data` folder if you want to store documents elsewhere than in the database. Example in `__DATA_DIR__/data/config.local.user.php` file + +``` +const FILE_STORAGE_BACKEND = 'FileSystem'; + +const FILE_STORAGE_CONFIG = DATA_ROOT . /files'; +``` **Important**: for some reason, email does not work when installing on a subpath. You are encouraged to use a full, dedicated for this domain (with path set to /) diff --git a/doc/ADMIN_fr.md b/doc/ADMIN_fr.md index 104f67e..3ff8959 100644 --- a/doc/ADMIN_fr.md +++ b/doc/ADMIN_fr.md @@ -1,4 +1,12 @@ -Vous pouvez si vous le souhaitez ajouter des configurations personnelles en éditant le fichier `__INSTALL_DIR__/config.local.php`. +Vous pouvez si vous le souhaitez ajouter des configurations personnelles en éditant le fichier `__DATA_DIR__/data/config.local.user.php`. + +Privilégiez le dossier `__DATA-DIR__/data` si vous voulez conserver des documents ailleurs que dans la base de données. Example dans le fichier `__DATA_DIR__/data/config.local.user.php` + +``` +const FILE_STORAGE_BACKEND = 'FileSystem'; + +const FILE_STORAGE_CONFIG = DATA_ROOT . '/files'; +``` **Important** : Pour une raison quelconque, le courriel ne fonctionne pas lors de l’installation sur une sous-instance. Nous vous encourageons à utiliser un nom de domaine complet dédié à ce domaine (avec le chemin défini sur /). diff --git a/scripts/install b/scripts/install index e5cc70e..34521fc 100644 --- a/scripts/install +++ b/scripts/install @@ -20,9 +20,8 @@ ynh_script_progression --message="Setting up source files..." --weight=4 # Download, check integrity, uncompress and patch the source from app.src ynh_setup_source --dest_dir="$install_dir" +chmod -R o-rwx "$install_dir" chown -R $app:www-data "$install_dir" -chmod -R u=rX,g=X,o= "$install_dir" -chmod -R u=rX,g=rX,o= "$install_dir/www" #================================================= # SYSTEM CONFIGURATION @@ -52,9 +51,6 @@ ynh_add_config --template="config.local.php" --destination="$install_dir/config. chmod 650 "$install_dir/config.local.php" chown $app:$app "$install_dir/config.local.php" -chown -R $app:www-data "$data_dir/" -chmod -R u=rwX,g=,o= "$data_dir/" - #================================================= # END OF SCRIPT #================================================= diff --git a/scripts/restore b/scripts/restore index e5c1ce7..c778d29 100644 --- a/scripts/restore +++ b/scripts/restore @@ -17,9 +17,8 @@ ynh_script_progression --message="Restoring the app main directory..." --weight= ynh_restore_file --origin_path="$install_dir" +chmod -R o-rwx "$install_dir" chown -R $app:www-data "$install_dir" -chmod -R u=rX,g=X,o= "$install_dir" -chmod -R u=rX,g=rX,o= "$install_dir/www" #================================================= # RESTORE THE DATA DIRECTORY @@ -28,9 +27,6 @@ ynh_script_progression --message="Restoring the data directory..." --weight=1 ynh_restore_file --origin_path="$data_dir" --not_mandatory -chown -R $app:www-data "$data_dir/" -chmod -R u=rwX,g=,o= "$data_dir/" - #================================================= # RESTORE SYSTEM CONFIGURATIONS #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index b5aae11..a6ff68c 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -70,8 +70,8 @@ then ynh_setup_source --dest_dir="$install_dir" --keep="config.local.php data/plugins" fi -chmod 650 "$install_dir/config.local.php" -chown $app:$app "$install_dir/config.local.php" +chmod -R o-rwx "$install_dir" +chown -R $app:www-data "$install_dir" #================================================= # REAPPLY SYSTEM CONFIGURATIONS @@ -103,8 +103,6 @@ chown $app:$app "$install_dir/config.local.php" ynh_replace_string --match_string="//require '$data_dir/data/config.local.user.php';" --replace_string="require '$data_dir/data/config.local.user.php';" --target_file="$install_dir/config.local.php" -chmod -R u=rX,g=X,o= "$install_dir" -chmod -R u=rX,g=rX,o= "$install_dir/www" #================================================= # ADD A CONFIG FILE #================================================= @@ -112,11 +110,11 @@ chmod -R u=rX,g=rX,o= "$install_dir/www" if [ ! -d "$data_dir/data" ]; then ynh_script_progression --message="Adding a configuration directory..." --weight=5 mkdir "$data_dir/data" + chmod 770 "$data_dir/data" chown -R $app:www-data "$data_dir/data" - chmod -R u=rwX,g=,o= "$data_dir/data" else - chown -R $app:www-data "$data_dir/data" - chmod -R u=rwX,g=,o= "$data_dir/data" + chown -R $app:www-data "$data_dir/data/cache" + chown $app:www-data "$data_dir/data/index.html" fi if [ ! -f "$data_dir/data/config.local.user.php" ]; then