From 499e51c9e46a87b74890e8901829c7e29b6f8031 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Sat, 27 Nov 2021 09:12:05 +0100 Subject: [PATCH] 4.3 --- conf/nginx.conf | 4 ---- manifest.json | 9 ++------- scripts/backup | 1 - scripts/install | 4 ++++ scripts/restore | 5 +---- 5 files changed, 7 insertions(+), 16 deletions(-) diff --git a/conf/nginx.conf b/conf/nginx.conf index 64fc3fe..18183c5 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -4,10 +4,6 @@ location __PATH__/ { # Path to source alias __FINALPATH__/ ; - if ($scheme = http) { - rewrite ^ https://$server_name$request_uri? permanent; - } - index index.php; try_files $uri $uri/ /owntracks/index.php?$args; diff --git a/manifest.json b/manifest.json index eac443c..a569fa3 100644 --- a/manifest.json +++ b/manifest.json @@ -20,7 +20,7 @@ "url": "https://github.com/tituspijean/owntracks_ynh" }, "requirements": { - "yunohost": ">= 4.2.0" + "yunohost": ">= 4.3.0" }, "multi_instance": true, "services": [ @@ -31,8 +31,7 @@ "arguments": { "install": [{ "name": "domain", - "type": "domain", - "example": "example.com" + "type": "domain" }, { "name": "path", @@ -43,10 +42,6 @@ { "name": "user", "type": "user", - "ask": { - "en": "Choose an user for Owntracks", - "fr": "Choisissez un utilisateur pour Owntracks" - }, "help": { "en": "Mandatory if the app is set to public. This user's traces will be displayed to visitors.", "fr": "Obligatoire si l'app est publique. Les traces de cet utilisateur seront montrées aux visiteurs." diff --git a/scripts/backup b/scripts/backup index d57362f..90b4ef5 100644 --- a/scripts/backup +++ b/scripts/backup @@ -40,7 +40,6 @@ ynh_print_info --message="Declaring files to be backed up..." ynh_backup --src_path="$final_path" - #================================================= # BACKUP THE NGINX CONFIGURATION #================================================= diff --git a/scripts/install b/scripts/install index add99f3..8a715fa 100644 --- a/scripts/install +++ b/scripts/install @@ -113,9 +113,13 @@ ynh_mysql_connect_as $app $db_pwd $db_name < "$final_path/sql/schema.sql" #================================================= # MODIFY A CONFIG FILE #================================================= +ynh_script_progression --message="Adding a configuration file..." ynh_add_config --template="../conf/config.inc.php" --destination="$final_path/config.inc.php" +chmod 400 "$final_path/config.inc.php" +chown $app:$app "$final_path/config.inc.php" + #================================================= # SETUP PERMISSIONS #================================================= diff --git a/scripts/restore b/scripts/restore index 59eb08f..e79c666 100644 --- a/scripts/restore +++ b/scripts/restore @@ -36,10 +36,7 @@ phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) #================================================= ynh_script_progression --message="Validating restoration parameters..." -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 " +test ! -d $final_path || ynh_die --message="There is already a directory: $final_path " #================================================= # STANDARD RESTORATION STEPS