From f9401165e0d91614e1ee1d62adee708bbf31558c Mon Sep 17 00:00:00 2001 From: Kay0u Date: Tue, 16 Jan 2024 22:38:04 +0100 Subject: [PATCH 1/3] fix packaging V2 --- manifest.toml | 2 +- scripts/backup | 2 +- scripts/install | 3 + scripts/remove | 2 + scripts/restore | 5 +- sources/patches/how-to-generate-patch.md | 6 + sources/patches/main-replace_data_dir.patch | 335 ++++++++++++++++++++ 7 files changed, 351 insertions(+), 4 deletions(-) create mode 100644 sources/patches/how-to-generate-patch.md create mode 100644 sources/patches/main-replace_data_dir.patch diff --git a/manifest.toml b/manifest.toml index 0dfff9a..61351c7 100644 --- a/manifest.toml +++ b/manifest.toml @@ -5,7 +5,7 @@ name = "LXD Dashboard" description.en = "Makes it easy for you to take control of your LXD based infrastructure" description.fr = "Vous permet de prendre facilement le contrôle de votre infrastructure basée sur LXD" -version = "3.8.0~ynh1" +version = "3.8.0~ynh2" maintainers = ["yalh76"] diff --git a/scripts/backup b/scripts/backup index 60cea71..1eb5941 100755 --- a/scripts/backup +++ b/scripts/backup @@ -25,7 +25,7 @@ ynh_backup --src_path="$install_dir" # BACKUP THE DATA DIR #================================================= -ynh_backup --src_path="$data_dir" --is_big +ynh_backup --src_path="$data_dir" #================================================= # BACKUP THE NGINX CONFIGURATION diff --git a/scripts/install b/scripts/install index 97f155d..7fcacc6 100755 --- a/scripts/install +++ b/scripts/install @@ -42,6 +42,9 @@ ynh_local_curl "/backend/config/login.php?database_type=mysql&database_host=loca ynh_local_curl "/backend/admin/settings.php?action=createUser" "username=$admin" "password=$password" ynh_local_curl "/backend/admin/settings.php?action=createUser" "email=$(ynh_user_get_info --username=$admin --key=mail)" "first_name=$(ynh_user_get_info --username=$admin --key=firstname)" "last_name=$(ynh_user_get_info --username=$admin --key=lastname)" "password=$password" "username=$admin" +chmod -R o-rwx "$data_dir" +chown -R $app: "$data_dir" + #================================================= # END OF SCRIPT #================================================= diff --git a/scripts/remove b/scripts/remove index 2c04d62..af5f63a 100755 --- a/scripts/remove +++ b/scripts/remove @@ -20,6 +20,8 @@ ynh_remove_nginx_config # Remove the dedicated PHP-FPM config ynh_remove_fpm_config +ynh_secure_remove --file="$data_dir" + #================================================= # END OF SCRIPT #================================================= diff --git a/scripts/restore b/scripts/restore index fd2b8bd..2460e2d 100755 --- a/scripts/restore +++ b/scripts/restore @@ -25,9 +25,10 @@ chown -R $app:www-data "$install_dir" #================================================= ynh_script_progression --message="Restoring the data directory..." -ynh_restore_file --origin_path="$data_dir" --not_mandatory +ynh_restore_file --origin_path="$data_dir" -chown -R $app:www-data "$data_dir" +chmod -R o-rwx "$data_dir" +chown -R $app: "$data_dir" #================================================= # RESTORE THE MYSQL DATABASE diff --git a/sources/patches/how-to-generate-patch.md b/sources/patches/how-to-generate-patch.md new file mode 100644 index 0000000..9c9f673 --- /dev/null +++ b/sources/patches/how-to-generate-patch.md @@ -0,0 +1,6 @@ + +- download and extract sources, navigate to the dir then: +- `git init` +- `git add *` +- `find ./ \( -type d -name .git -prune \) -o -type f -print0 | xargs -0 sed -i 's/\/var\/lxdware/\/home\/yunohost.app\/lxd-dashboard/g'` +- `git diff > main-replace_data_dir.patch` \ No newline at end of file diff --git a/sources/patches/main-replace_data_dir.patch b/sources/patches/main-replace_data_dir.patch new file mode 100644 index 0000000..f1475ea --- /dev/null +++ b/sources/patches/main-replace_data_dir.patch @@ -0,0 +1,335 @@ +diff --git a/lxd-dashboard/backend/config/about.php b/lxd-dashboard/backend/config/about.php +index 268ac7b..6476c11 100644 +--- a/lxd-dashboard/backend/config/about.php ++++ b/lxd-dashboard/backend/config/about.php +@@ -26,7 +26,7 @@ if (!isset($_SESSION)) { + if (isset($_SESSION['username'])) { + + //Include db_config.php file +- include_once('/var/lxdware/data/db_config.php'); ++ include_once('/home/yunohost.app/lxd-dashboard/data/db_config.php'); + + switch (DB_TYPE) { + case "sqlite": +diff --git a/lxd-dashboard/backend/config/cert.php b/lxd-dashboard/backend/config/cert.php +index e2b3799..3c234f3 100644 +--- a/lxd-dashboard/backend/config/cert.php ++++ b/lxd-dashboard/backend/config/cert.php +@@ -24,7 +24,7 @@ if (!isset($_SESSION)) { + + function createCertificate($certificateFilename, $numberofDays = 3650){ + //Only create the certificate if it does not already exist +- if (!file_exists('/var/lxdware/data/lxd/'.$certificateFilename.'.crt')){ ++ if (!file_exists('/home/yunohost.app/lxd-dashboard/data/lxd/'.$certificateFilename.'.crt')){ + $subject = array( + "commonName" => "LXDWARE", + ); +@@ -40,11 +40,11 @@ function createCertificate($certificateFilename, $numberofDays = 3650){ + + //Generate self-signed EC cert + $x509 = openssl_csr_sign($csr, null, $private_key, $numberofDays); +- openssl_x509_export_to_file($x509, '/var/lxdware/data/lxd/'.$certificateFilename.'.crt'); +- openssl_pkey_export_to_file($private_key, '/var/lxdware/data/lxd/'.$certificateFilename.'.key'); ++ openssl_x509_export_to_file($x509, '/home/yunohost.app/lxd-dashboard/data/lxd/'.$certificateFilename.'.crt'); ++ openssl_pkey_export_to_file($private_key, '/home/yunohost.app/lxd-dashboard/data/lxd/'.$certificateFilename.'.key'); + + //Change permissions to lock down private key +- chmod('/var/lxdware/data/lxd/'.$certificateFilename.'.key',0600); ++ chmod('/home/yunohost.app/lxd-dashboard/data/lxd/'.$certificateFilename.'.key',0600); + } + } + +@@ -65,9 +65,9 @@ if (isset($_SESSION['username'])) { + case "createCertificateFiles": + if (validateAuthorization($action)) { + if (!empty($name)){ +- if (!file_exists('/var/lxdware/data/lxd/'.$name.'.crt')){ ++ if (!file_exists('/home/yunohost.app/lxd-dashboard/data/lxd/'.$name.'.crt')){ + createCertificate($name, $days); +- if (file_exists('/var/lxdware/data/lxd/'.$name.'.crt') && file_exists('/var/lxdware/data/lxd/'.$name.'.key')) ++ if (file_exists('/home/yunohost.app/lxd-dashboard/data/lxd/'.$name.'.crt') && file_exists('/home/yunohost.app/lxd-dashboard/data/lxd/'.$name.'.key')) + echo '{"status": "Ok", "status_code": 200, "metadata": {"status": "Certificate files created"}}'; + else + echo '{"status": "Bad Request", "status_code": 400, "metadata": {"error": "Unable to create all certificate files"}}'; +@@ -85,11 +85,11 @@ if (isset($_SESSION['username'])) { + case "deleteCertificateFiles": + if (validateAuthorization($action)) { + if (!empty($name)){ +- unlink('/var/lxdware/data/lxd/'.$name.'.crt'); +- unlink('/var/lxdware/data/lxd/'.$name.'.key'); ++ unlink('/home/yunohost.app/lxd-dashboard/data/lxd/'.$name.'.crt'); ++ unlink('/home/yunohost.app/lxd-dashboard/data/lxd/'.$name.'.key'); + } + +- if (file_exists('/var/lxdware/data/lxd/'.$name.'.crt') || file_exists('/var/lxdware/data/lxd/'.$name.'.key')) ++ if (file_exists('/home/yunohost.app/lxd-dashboard/data/lxd/'.$name.'.crt') || file_exists('/home/yunohost.app/lxd-dashboard/data/lxd/'.$name.'.key')) + echo '{"status": "Bad Request", "status_code": 400, "metadata": {"error": "Unable to remove all certificate files"}}'; + else + echo '{"status": "Ok", "status_code": 200, "metadata": {"status": "Certificate files removed"}}'; +@@ -105,7 +105,7 @@ if (isset($_SESSION['username'])) { + $i = 0; + echo '{ "data": ['; + +- foreach (glob("/var/lxdware/data/lxd/*.crt") as $filename) { ++ foreach (glob("/home/yunohost.app/lxd-dashboard/data/lxd/*.crt") as $filename) { + + $data = openssl_x509_parse(file_get_contents($filename)); + $validFrom = date('Y-m-d H:i:s', $data['validFrom_time_t']); +@@ -138,7 +138,7 @@ if (isset($_SESSION['username'])) { + + case "viewCertificate": + if (validateAuthorization($action)) { +- $results = shell_exec("cat /var/lxdware/data/lxd/client.crt"); ++ $results = shell_exec("cat /home/yunohost.app/lxd-dashboard/data/lxd/client.crt"); + echo htmlentities($results); + } + else { +diff --git a/lxd-dashboard/backend/config/curl.php b/lxd-dashboard/backend/config/curl.php +index 7753f63..9642189 100644 +--- a/lxd-dashboard/backend/config/curl.php ++++ b/lxd-dashboard/backend/config/curl.php +@@ -31,8 +31,8 @@ require_once('../config/db.php'); + + + function sendCurlRequest($request_action, $request_type, $request_url, $request_data = "{}"){ +- $cert = "/var/lxdware/data/lxd/client.crt"; +- $key = "/var/lxdware/data/lxd/client.key"; ++ $cert = "/home/yunohost.app/lxd-dashboard/data/lxd/client.crt"; ++ $key = "/home/yunohost.app/lxd-dashboard/data/lxd/client.key"; + + //Set required variables + $get_connection_timeout = (isset($_SESSION['get_connection_timeout'])) ? $_SESSION['get_connection_timeout'] : 3; +diff --git a/lxd-dashboard/backend/config/db.php b/lxd-dashboard/backend/config/db.php +index e911499..68802eb 100644 +--- a/lxd-dashboard/backend/config/db.php ++++ b/lxd-dashboard/backend/config/db.php +@@ -34,12 +34,12 @@ function in_array_r($needle, $haystacks){ + function establishDatabaseConnection(){ + + //Require db_config.php file +- require_once('/var/lxdware/data/db_config.php'); ++ require_once('/home/yunohost.app/lxd-dashboard/data/db_config.php'); + + switch (DB_TYPE) { + case "sqlite": + $_SESSION['db_type'] = "SQLite"; +- $conn = new PDO('sqlite:/var/lxdware/data/sqlite/lxdware.sqlite'); ++ $conn = new PDO('sqlite:/home/yunohost.app/lxd-dashboard/data/sqlite/lxdware.sqlite'); + $conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); //needed for catch backward compatability with PHP 7 + break; + case "mysql": +diff --git a/lxd-dashboard/backend/config/login.php b/lxd-dashboard/backend/config/login.php +index bb30ef6..4b283b1 100644 +--- a/lxd-dashboard/backend/config/login.php ++++ b/lxd-dashboard/backend/config/login.php +@@ -34,7 +34,7 @@ switch ($action) { + case "loadLoginForm": + $showRegistrationForm = false; + +- if (!file_exists('/var/lxdware/data/db_config.php')){ ++ if (!file_exists('/home/yunohost.app/lxd-dashboard/data/db_config.php')){ + $showRegistrationForm = true; + } + else { +@@ -127,10 +127,10 @@ switch ($action) { + + case "writeDatabaseConfig": + +- if (!file_exists('/var/lxdware/data/db_config.php')){ ++ if (!file_exists('/home/yunohost.app/lxd-dashboard/data/db_config.php')){ + if ($database_type == 'sqlite'){ + try { +- $conn = new PDO('sqlite:/var/lxdware/data/sqlite/lxdware.sqlite'); ++ $conn = new PDO('sqlite:/home/yunohost.app/lxd-dashboard/data/sqlite/lxdware.sqlite'); + $db = null; + } + catch (PDOException $e){ +@@ -138,7 +138,7 @@ switch ($action) { + break; + } + +- $file = fopen("/var/lxdware/data/db_config.php", "w") or die('{"status": "Bad Request", "status_code": 400, "metadata": {"error": "Unable to write database configuration file"}}'); ++ $file = fopen("/home/yunohost.app/lxd-dashboard/data/db_config.php", "w") or die('{"status": "Bad Request", "status_code": 400, "metadata": {"error": "Unable to write database configuration file"}}'); + $txt = ""; + fwrite($file, $txt); + fclose($file); +- chmod('/var/lxdware/data/db_config.php',0600); ++ chmod('/home/yunohost.app/lxd-dashboard/data/db_config.php',0600); + } + + if ($database_type == 'mysql'){ +@@ -162,7 +162,7 @@ switch ($action) { + break; + } + +- $file = fopen("/var/lxdware/data/db_config.php", "w") or die('{"status": "Bad Request", "status_code": 400, "metadata": {"error": "Unable to write database configuration file"}}'); ++ $file = fopen("/home/yunohost.app/lxd-dashboard/data/db_config.php", "w") or die('{"status": "Bad Request", "status_code": 400, "metadata": {"error": "Unable to write database configuration file"}}'); + $txt = ""; + fwrite($file, $txt); + fclose($file); +- chmod('/var/lxdware/data/db_config.php',0600); ++ chmod('/home/yunohost.app/lxd-dashboard/data/db_config.php',0600); + } + + echo '{"status": "Ok", "status_code": 200, "metadata": "{}"}'; + } + else { +- echo '{"status": "Bad Request", "status_code": 400, "metadata": {"error": "Database config file \'/var/lxdware/data/db_config.php\' already exists"}}'; ++ echo '{"status": "Bad Request", "status_code": 400, "metadata": {"error": "Database config file \'/home/yunohost.app/lxd-dashboard/data/db_config.php\' already exists"}}'; + } + + break; +diff --git a/lxd-dashboard/backend/lxd/containers-single.php b/lxd-dashboard/backend/lxd/containers-single.php +index 7cbcc4c..13656b2 100644 +--- a/lxd-dashboard/backend/lxd/containers-single.php ++++ b/lxd-dashboard/backend/lxd/containers-single.php +@@ -704,7 +704,7 @@ if (isset($_SESSION['username'])) { + $instance_only = ($instance_backup['instance_only'])?"true":"false"; + $optimized_storage = ($instance_backup['optimized_storage'])?"true":"false"; + $hostname = retrieveHostName($remote); +- $file = '/var/lxdware/backups/' . $hostname . '/' . $project . '/' . $instance . '/' . $instance_backup['name']; ++ $file = '/home/yunohost.app/lxd-dashboard/backups/' . $hostname . '/' . $project . '/' . $instance . '/' . $instance_backup['name']; + $file_exists = false; + $file_size = ""; + $unit_size = ""; +diff --git a/lxd-dashboard/backend/lxd/containers.php b/lxd-dashboard/backend/lxd/containers.php +index 0ccf4b8..d3ca545 100644 +--- a/lxd-dashboard/backend/lxd/containers.php ++++ b/lxd-dashboard/backend/lxd/containers.php +@@ -398,7 +398,7 @@ if (isset($_SESSION['username'])) { + + case "deleteInstanceBackup": + $hostname = retrieveHostName($remote); +- $file = '/var/lxdware/backups/' . $hostname . '/' . $project . '/' . $instance . '/' . $name; ++ $file = '/home/yunohost.app/lxd-dashboard/backups/' . $hostname . '/' . $project . '/' . $instance . '/' . $name; + unlink($file); + $url = $base_url . "/1.0/containers/" . $instance . "/backups/" . $name . "?project=" . $project; + $results = sendCurlRequest($action, "DELETE", $url); +@@ -477,7 +477,7 @@ if (isset($_SESSION['username'])) { + + case "downloadInstanceExportFile": + $hostname = retrieveHostName($remote); +- $file = '/var/lxdware/backups/' . $hostname . '/' . $project . '/' . $instance . '/' . $name; ++ $file = '/home/yunohost.app/lxd-dashboard/backups/' . $hostname . '/' . $project . '/' . $instance . '/' . $name; + $file_name = basename($file); + $file_size = filesize($file); + +@@ -513,14 +513,14 @@ if (isset($_SESSION['username'])) { + + case "exportInstanceBackup": + if (validateAuthorization($action)) { +- $cert = "/var/lxdware/data/lxd/client.crt"; +- $key = "/var/lxdware/data/lxd/client.key"; ++ $cert = "/home/yunohost.app/lxd-dashboard/data/lxd/client.crt"; ++ $key = "/home/yunohost.app/lxd-dashboard/data/lxd/client.key"; + $hostname = retrieveHostName($remote); +- $file = '/var/lxdware/backups/' . $hostname . '/' . $project . '/' . $instance . '/' . $name; ++ $file = '/home/yunohost.app/lxd-dashboard/backups/' . $hostname . '/' . $project . '/' . $instance . '/' . $name; + if (!file_exists($file)){ + //If there is no directory yet for the host to store backups, create it +- if (!file_exists('/var/lxdware/backups/' . $hostname . '/' . $project . '/' . $instance)){ +- mkdir('/var/lxdware/backups/'.$hostname . '/' . $project . '/' . $instance, 0777, true); ++ if (!file_exists('/home/yunohost.app/lxd-dashboard/backups/' . $hostname . '/' . $project . '/' . $instance)){ ++ mkdir('/home/yunohost.app/lxd-dashboard/backups/'.$hostname . '/' . $project . '/' . $instance, 0777, true); + } + + $url = $base_url . "/1.0/containers/" . $instance . "/backups/" . $name . "/export?project=" . $project; +diff --git a/lxd-dashboard/backend/lxd/virtual-machines-single.php b/lxd-dashboard/backend/lxd/virtual-machines-single.php +index 17d573b..0673d87 100644 +--- a/lxd-dashboard/backend/lxd/virtual-machines-single.php ++++ b/lxd-dashboard/backend/lxd/virtual-machines-single.php +@@ -653,7 +653,7 @@ if (isset($_SESSION['username'])) { + $instance_only = ($instance_backup['instance_only'])?"true":"false"; + $optimized_storage = ($instance_backup['optimized_storage'])?"true":"false"; + $hostname = retrieveHostName($remote); +- $file = '/var/lxdware/backups/' . $hostname . '/' . $project . '/' . $instance . '/' . $instance_backup['name']; ++ $file = '/home/yunohost.app/lxd-dashboard/backups/' . $hostname . '/' . $project . '/' . $instance . '/' . $instance_backup['name']; + $file_exists = false; + $file_size = ""; + $unit_size = ""; +diff --git a/lxd-dashboard/backend/lxd/virtual-machines.php b/lxd-dashboard/backend/lxd/virtual-machines.php +index a01ce7d..df11017 100644 +--- a/lxd-dashboard/backend/lxd/virtual-machines.php ++++ b/lxd-dashboard/backend/lxd/virtual-machines.php +@@ -318,7 +318,7 @@ if (isset($_SESSION['username'])) { + + case "deleteInstanceBackup": + $hostname = retrieveHostName($remote); +- $file = '/var/lxdware/backups/' . $hostname . '/' . $project . '/' . $instance . '/' . $name; ++ $file = '/home/yunohost.app/lxd-dashboard/backups/' . $hostname . '/' . $project . '/' . $instance . '/' . $name; + unlink($file); + $url = $base_url . "/1.0/instances/" . $instance . "/backups/" . $name . "?project=" . $project; + $results = sendCurlRequest($action, "DELETE", $url); +@@ -397,7 +397,7 @@ if (isset($_SESSION['username'])) { + + case "downloadInstanceExportFile": + $hostname = retrieveHostName($remote); +- $file = '/var/lxdware/backups/' . $hostname . '/' . $project . '/' . $instance . '/' . $name; ++ $file = '/home/yunohost.app/lxd-dashboard/backups/' . $hostname . '/' . $project . '/' . $instance . '/' . $name; + $file_name = basename($file); + $file_size = filesize($file); + +@@ -433,14 +433,14 @@ if (isset($_SESSION['username'])) { + + case "exportInstanceBackup": + if (validateAuthorization($action)) { +- $cert = "/var/lxdware/data/lxd/client.crt"; +- $key = "/var/lxdware/data/lxd/client.key"; ++ $cert = "/home/yunohost.app/lxd-dashboard/data/lxd/client.crt"; ++ $key = "/home/yunohost.app/lxd-dashboard/data/lxd/client.key"; + $hostname = retrieveHostName($remote); +- $file = '/var/lxdware/backups/' . $hostname . '/' . $project . '/' . $instance . '/' . $name; ++ $file = '/home/yunohost.app/lxd-dashboard/backups/' . $hostname . '/' . $project . '/' . $instance . '/' . $name; + if (!file_exists($file)){ + //If there is no directory yet for the host to store backups, create it +- if (!file_exists('/var/lxdware/backups/' . $hostname . '/' . $project . '/' . $instance)){ +- mkdir('/var/lxdware/backups/'.$hostname . '/' . $project . '/' . $instance, 0777, true); ++ if (!file_exists('/home/yunohost.app/lxd-dashboard/backups/' . $hostname . '/' . $project . '/' . $instance)){ ++ mkdir('/home/yunohost.app/lxd-dashboard/backups/'.$hostname . '/' . $project . '/' . $instance, 0777, true); + } + + $url = $base_url . "/1.0/instances/" . $instance . "/backups/" . $name . "/export?project=" . $project; +diff --git a/startup.sh b/startup.sh +index 48aa2fe..90f6179 100644 +--- a/startup.sh ++++ b/startup.sh +@@ -1,24 +1,24 @@ + #!/bin/bash + + #Setup LXD data directory +-if [ ! -d /var/lxdware/data/lxd ] ++if [ ! -d /home/yunohost.app/lxd-dashboard/data/lxd ] + then +- mkdir -p /var/lxdware/data/lxd ++ mkdir -p /home/yunohost.app/lxd-dashboard/data/lxd + fi + + #Create backups directory if needed +-if [ ! -d /var/lxdware/backups ] ++if [ ! -d /home/yunohost.app/lxd-dashboard/backups ] + then +- mkdir -p /var/lxdware/backups ++ mkdir -p /home/yunohost.app/lxd-dashboard/backups + fi + + #Create SQLite database directory if needed +-if [ ! -d /var/lxdware/data/sqlite ] ++if [ ! -d /home/yunohost.app/lxd-dashboard/data/sqlite ] + then +- mkdir -p /var/lxdware/data/sqlite ++ mkdir -p /home/yunohost.app/lxd-dashboard/data/sqlite + fi + +-chown -R www-data:www-data /var/lxdware/ ++chown -R www-data:www-data /home/yunohost.app/lxd-dashboard/ + + #Start PHP for NGINX + service php7.4-fpm start \ No newline at end of file From de78f6d859628e88ed1985c93701c2b22ec860cb Mon Sep 17 00:00:00 2001 From: yunohost-bot Date: Tue, 16 Jan 2024 21:39:42 +0000 Subject: [PATCH 2/3] Auto-update README --- README.md | 2 +- README_fr.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 8fd8516..75905f3 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@ If you don't have YunoHost, please consult [the guide](https://yunohost.org/#/in Web-based user interface capable of managing multiple LXD servers from a single location. -**Shipped version:** 3.8.0~ynh1 +**Shipped version:** 3.8.0~ynh2 ## Screenshots diff --git a/README_fr.md b/README_fr.md index 3f6a63a..631215e 100644 --- a/README_fr.md +++ b/README_fr.md @@ -19,7 +19,7 @@ Si vous n’avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) po Web-based user interface capable of managing multiple LXD servers from a single location. -**Version incluse :** 3.8.0~ynh1 +**Version incluse :** 3.8.0~ynh2 ## Captures d’écran From f9fefa5e2a045b4a614f4360dc8af2f0aa49a56c Mon Sep 17 00:00:00 2001 From: Kay0u Date: Tue, 16 Jan 2024 23:09:19 +0100 Subject: [PATCH 3/3] fix data_dir permissions during the upgrade --- scripts/upgrade | 3 +++ 1 file changed, 3 insertions(+) diff --git a/scripts/upgrade b/scripts/upgrade index bf776d5..68d05e1 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -53,6 +53,9 @@ ynh_add_config --template="db_config.php" --destination="$data_dir/data/db_confi chmod 400 "$data_dir/data/db_config.php" chown $app:$app "$data_dir/data/db_config.php" +chmod -R o-rwx "$data_dir" +chown -R $app: "$data_dir" + #================================================= # END OF SCRIPT #=================================================