From 4f48e8ac05796ddf3a2a9e32586142091e8feff6 Mon Sep 17 00:00:00 2001 From: Kay0u Date: Sun, 8 Sep 2019 02:08:21 +0200 Subject: [PATCH 01/10] Upgrade to 0.6.0 --- README.md | 2 +- conf/app.src | 4 ++-- conf/config.system.php | 2 +- manifest.json | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index a587c66..b29635e 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ If you don't have YunoHost, please see [here](https://yunohost.org/#/install) to [Baïkal](http://baikal-server.com/) is a CalDAV and CardDAV server, based on sabre/dav, that includes an administration interface for easy management. -**Shipped version:** 0.5.3 +**Shipped version:** 0.6.0 ## Screenshots diff --git a/conf/app.src b/conf/app.src index f07f48a..58ec45d 100644 --- a/conf/app.src +++ b/conf/app.src @@ -1,5 +1,5 @@ -SOURCE_URL=https://github.com/sabre-io/Baikal/releases/download/0.5.3/baikal-0.5.3.zip -SOURCE_SUM=11e6971a3cdc4c0cfc36e82498809162b5a6cfb67545f0dbc5b9d9e0c28c93c0 +SOURCE_URL=https://github.com/sabre-io/Baikal/releases/download/0.6.0/baikal-0.6.0.zip +SOURCE_SUM=eeb5f43edf6b79b08c43274dbe38c29c076eb4a92300be3a20b02929c13088e8 SOURCE_SUM_PRG=sha256sum SOURCE_FORMAT=zip SOURCE_IN_SUBDIR=true diff --git a/conf/config.system.php b/conf/config.system.php index 2399d76..64e7bb2 100644 --- a/conf/config.system.php +++ b/conf/config.system.php @@ -69,4 +69,4 @@ define("PROJECT_DB_MYSQL_PASSWORD", '__DBPASS__'); define("BAIKAL_ENCRYPTION_KEY", '__DESKEY__'); # The currently configured Baïkal version -define("BAIKAL_CONFIGURED_VERSION", '0.5.3'); +define("BAIKAL_CONFIGURED_VERSION", '0.6.0'); diff --git a/manifest.json b/manifest.json index 1e5856c..c4bc55a 100644 --- a/manifest.json +++ b/manifest.json @@ -6,7 +6,7 @@ "en": "Lightweight CalDAV+CardDAV server", "fr": "Serveur CalDAV+CardDAV léger" }, - "version": "0.5.3~ynh1", + "version": "0.6.0~ynh1", "url": "http://baikal-server.com/", "license": "GPL-3.0", "maintainer": { From 8ab06e7bd0af416da2b922a5d360e43c2577bb10 Mon Sep 17 00:00:00 2001 From: Kay0u Date: Wed, 11 Mar 2020 11:35:25 +0100 Subject: [PATCH 02/10] trying to fix ci --- scripts/_common.sh | 8 +++++--- scripts/change_url | 2 +- scripts/install | 2 +- scripts/restore | 2 +- 4 files changed, 8 insertions(+), 6 deletions(-) diff --git a/scripts/_common.sh b/scripts/_common.sh index 93323b9..a10ebe6 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -15,14 +15,16 @@ pkg_dependencies="php-xml php-mbstring php-mysql" # usage: is_url_handled URL is_url_handled() { # Declare an array to define the options of this helper. - declare -Ar args_array=( [u]=url= ) - local url + local legacy_args=dp + declare -Ar args_array=( [d]=domain= [p]=path= ) + local domain + local path # Manage arguments with getopts ynh_handle_getopts_args "$@" # Try to get the url with curl, and keep the http code and an eventual redirection url. local curl_output="$(curl --insecure --silent --output /dev/null \ - --write-out '%{http_code};%{redirect_url}' "$url")" + --write-out '%{http_code};%{redirect_url}' https://127.0.0.1$path --header "Host: $domain")" # Cut the output and keep only the first part to keep the http code local http_code="${curl_output%%;*}" diff --git a/scripts/change_url b/scripts/change_url index 4cb7436..f163eed 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -52,7 +52,7 @@ fi if [ $change_domain -eq 1 ] then # Check if .well-known is available for the new domain. - if is_url_handled "https://$new_domain/.well-known/caldav" || is_url_handled "https://$new_domain/.well-known/carddav" + if is_url_handled "$new_domain" "/.well-known/caldav" || is_url_handled "$new_domain" "/.well-known/carddav" then ynh_die --message="Another app already uses the domain $new_domain to serve a caldav/carddav feature. Please use another domain." fi diff --git a/scripts/install b/scripts/install index 8b145ac..5ed3705 100644 --- a/scripts/install +++ b/scripts/install @@ -38,7 +38,7 @@ test ! -e "$final_path" || ynh_die "This path already contains a folder" ynh_webpath_register --app=$app --domain=$domain --path_url=$path_url # Check if .well-known is available for this domain. -if is_url_handled "https://$domain/.well-known/caldav" || is_url_handled "https://$domain/.well-known/carddav" +if is_url_handled "$domain" "/.well-known/caldav" || is_url_handled "$domain" "/.well-known/carddav" then ynh_die --message="Another app already uses the domain $domain to serve a caldav/carddav feature. Please use another domain." fi diff --git a/scripts/restore b/scripts/restore index 9a07854..c289d06 100644 --- a/scripts/restore +++ b/scripts/restore @@ -39,7 +39,7 @@ test ! -d $final_path \ || ynh_die --message="There is already a directory: $final_path " # Check if .well-known is available for this domain. -if is_url_handled "https://$domain/.well-known/caldav" || is_url_handled "https://$domain/.well-known/carddav" +if is_url_handled "$domain" "/.well-known/caldav" || is_url_handled "$domain" "/.well-known/carddav" then ynh_die --message="Another app already uses the domain $domain to serve a caldav/carddav feature. Please use another domain." fi From 12a2e4ef63ecca51c50b4f493c7b6c1e91c4f33c Mon Sep 17 00:00:00 2001 From: Kay0u Date: Fri, 13 Mar 2020 23:01:26 +0100 Subject: [PATCH 03/10] add resolve parameter --- scripts/_common.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/_common.sh b/scripts/_common.sh index a10ebe6..903e79a 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -24,7 +24,7 @@ is_url_handled() { # Try to get the url with curl, and keep the http code and an eventual redirection url. local curl_output="$(curl --insecure --silent --output /dev/null \ - --write-out '%{http_code};%{redirect_url}' https://127.0.0.1$path --header "Host: $domain")" + --write-out '%{http_code};%{redirect_url}' https://127.0.0.1$path --header "Host: $domain" --resolve $domain:443:127.0.0.1)" # Cut the output and keep only the first part to keep the http code local http_code="${curl_output%%;*}" From 192e9f2439a4b4ae92c415403c0e69c5ca09d209 Mon Sep 17 00:00:00 2001 From: Kay0u Date: Fri, 13 Mar 2020 23:47:28 +0100 Subject: [PATCH 04/10] avoid false modification detecion --- conf/config.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conf/config.php b/conf/config.php index 960773b..06495d5 100644 --- a/conf/config.php +++ b/conf/config.php @@ -59,4 +59,4 @@ define("BAIKAL_DAV_LDAP_DISPLAYNAME_ATTR", 'cn'); define("BAIKAL_DAV_LDAP_EMAIL_ATTR", 'mail'); # Baïkal Web admin password hash; Set via Baïkal Web Admin -define("BAIKAL_ADMIN_PASSWORDHASH", '__PASSWORDHASH__'); +define("BAIKAL_ADMIN_PASSWORDHASH", '__PASSWORDHASH__'); \ No newline at end of file From 42432469ddf8c1b56b4726074a39f95c779988d0 Mon Sep 17 00:00:00 2001 From: Kay0u Date: Fri, 13 Mar 2020 23:48:46 +0100 Subject: [PATCH 05/10] fix encrypt_key --- scripts/upgrade | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/scripts/upgrade b/scripts/upgrade index 2386a0a..559facb 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -141,7 +141,7 @@ then ynh_replace_string --match_string="__TIMEZONE__" --replace_string="$(cat /etc/timezone)" --target_file="$bk_conf" - password_hash=$(ynh_app_setting_get $app password_hash) + password_hash=$(ynh_app_setting_get --app=$app --key=password_hash) # If the password_hash is not in the app's config, recreate it from the password. if [ -z "$password_hash" ]; then password=$(ynh_app_setting_get --app=$app --key=password) @@ -163,10 +163,11 @@ then ynh_replace_string --match_string="__PATH__" --replace_string="$path_url" --target_file="$bk_conf" ynh_replace_string --match_string="__DBNAME__" --replace_string="$db_name" --target_file="$bk_conf" ynh_replace_string --match_string="__DBUSER__" --replace_string="$db_name" --target_file="$bk_conf" - db_pwd=$(ynh_app_setting_get $app mysqlpwd) + db_pwd=$(ynh_app_setting_get --app=$app --key=mysqlpwd) ynh_replace_string --match_string="__DBPASS__" --replace_string="$db_pwd" --target_file="$bk_conf" - deskey=$(ynh_app_setting_get $app deskey) + + deskey=$(ynh_app_setting_get --app=$app --key=encrypt_key) ynh_replace_string --match_string="__DESKEY__" --replace_string="$deskey" --target_file="$bk_conf" # Store the config file checksum into the app settings From 64bd8a117f4b574de614b0c6b6dafb54c0de9909 Mon Sep 17 00:00:00 2001 From: Kay0u Date: Fri, 13 Mar 2020 23:51:18 +0100 Subject: [PATCH 06/10] Keep Specific directory intact --- scripts/upgrade | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/scripts/upgrade b/scripts/upgrade index 559facb..c598971 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -75,8 +75,16 @@ if [ "$upgrade_type" == "UPGRADE_APP" ] then ynh_script_progression --message="Upgrading source files..." --weight=3 + # Keep the Specific folder intact: https://sabre.io/baikal/upgrade/ + temp_folder=$(mktemp -d) + mv "$final_path/Specific" "$temp_folder" # Download, check integrity, uncompress and patch the source from app.src ynh_setup_source --dest_dir="$final_path" + + ynh_secure_remove --file="$final_path/Specific" + + mv "$temp_folder/Specific" "$final_path" + ynh_secure_remove --file="$temp_folder" fi #================================================= From 8daaaaa01c9cd446d5e09bf11ca05fd0f5bf6625 Mon Sep 17 00:00:00 2001 From: Kay0u Date: Fri, 13 Mar 2020 23:52:56 +0100 Subject: [PATCH 07/10] 0.6.1 --- README.md | 2 +- conf/app.src | 4 ++-- conf/config.system.php | 2 +- manifest.json | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index b29635e..11cbf39 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ If you don't have YunoHost, please see [here](https://yunohost.org/#/install) to [Baïkal](http://baikal-server.com/) is a CalDAV and CardDAV server, based on sabre/dav, that includes an administration interface for easy management. -**Shipped version:** 0.6.0 +**Shipped version:** 0.6.1 ## Screenshots diff --git a/conf/app.src b/conf/app.src index 58ec45d..dc0f4b6 100644 --- a/conf/app.src +++ b/conf/app.src @@ -1,5 +1,5 @@ -SOURCE_URL=https://github.com/sabre-io/Baikal/releases/download/0.6.0/baikal-0.6.0.zip -SOURCE_SUM=eeb5f43edf6b79b08c43274dbe38c29c076eb4a92300be3a20b02929c13088e8 +SOURCE_URL=https://github.com/sabre-io/Baikal/releases/download/0.6.1/baikal-0.6.1.zip +SOURCE_SUM=b3a553591a84f4262a6333cf79a1624e5d424d52c4071c77934b7191f714d757 SOURCE_SUM_PRG=sha256sum SOURCE_FORMAT=zip SOURCE_IN_SUBDIR=true diff --git a/conf/config.system.php b/conf/config.system.php index 64e7bb2..b1ca4bb 100644 --- a/conf/config.system.php +++ b/conf/config.system.php @@ -69,4 +69,4 @@ define("PROJECT_DB_MYSQL_PASSWORD", '__DBPASS__'); define("BAIKAL_ENCRYPTION_KEY", '__DESKEY__'); # The currently configured Baïkal version -define("BAIKAL_CONFIGURED_VERSION", '0.6.0'); +define("BAIKAL_CONFIGURED_VERSION", '0.6.1'); diff --git a/manifest.json b/manifest.json index c4bc55a..49f43ef 100644 --- a/manifest.json +++ b/manifest.json @@ -6,7 +6,7 @@ "en": "Lightweight CalDAV+CardDAV server", "fr": "Serveur CalDAV+CardDAV léger" }, - "version": "0.6.0~ynh1", + "version": "0.6.1~ynh1", "url": "http://baikal-server.com/", "license": "GPL-3.0", "maintainer": { From ca6db622eb08be3931b64ff728bafb78faa55a26 Mon Sep 17 00:00:00 2001 From: Kay0u Date: Sat, 14 Mar 2020 00:25:37 +0100 Subject: [PATCH 08/10] use getops --- scripts/change_url | 2 +- scripts/install | 2 +- scripts/restore | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/change_url b/scripts/change_url index f163eed..e80ce8d 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -52,7 +52,7 @@ fi if [ $change_domain -eq 1 ] then # Check if .well-known is available for the new domain. - if is_url_handled "$new_domain" "/.well-known/caldav" || is_url_handled "$new_domain" "/.well-known/carddav" + if is_url_handled --domain="$new_domain" --path="/.well-known/caldav" || is_url_handled --domain="$new_domain" --path="/.well-known/carddav" then ynh_die --message="Another app already uses the domain $new_domain to serve a caldav/carddav feature. Please use another domain." fi diff --git a/scripts/install b/scripts/install index 5ed3705..d428307 100644 --- a/scripts/install +++ b/scripts/install @@ -38,7 +38,7 @@ test ! -e "$final_path" || ynh_die "This path already contains a folder" ynh_webpath_register --app=$app --domain=$domain --path_url=$path_url # Check if .well-known is available for this domain. -if is_url_handled "$domain" "/.well-known/caldav" || is_url_handled "$domain" "/.well-known/carddav" +if is_url_handled --domain="$domain" --path="/.well-known/caldav" || is_url_handled --domain="$domain" --path="/.well-known/carddav" then ynh_die --message="Another app already uses the domain $domain to serve a caldav/carddav feature. Please use another domain." fi diff --git a/scripts/restore b/scripts/restore index c289d06..930c1b4 100644 --- a/scripts/restore +++ b/scripts/restore @@ -39,7 +39,7 @@ test ! -d $final_path \ || ynh_die --message="There is already a directory: $final_path " # Check if .well-known is available for this domain. -if is_url_handled "$domain" "/.well-known/caldav" || is_url_handled "$domain" "/.well-known/carddav" +if is_url_handled --domain="$domain" --path="/.well-known/caldav" || is_url_handled --domain="$domain" --path="/.well-known/carddav" then ynh_die --message="Another app already uses the domain $domain to serve a caldav/carddav feature. Please use another domain." fi From 61e002ad775469fe953ab3a18557f828fe32c4bb Mon Sep 17 00:00:00 2001 From: Kay0u Date: Sat, 14 Mar 2020 00:31:36 +0100 Subject: [PATCH 09/10] update comments --- scripts/_common.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/_common.sh b/scripts/_common.sh index 903e79a..dfc713b 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -12,7 +12,7 @@ pkg_dependencies="php-xml php-mbstring php-mysql" #================================================= # Check if an URL is already handled -# usage: is_url_handled URL +# usage: is_url_handled --domain=DOMAIN --path=PATH_URI is_url_handled() { # Declare an array to define the options of this helper. local legacy_args=dp From 9a83a6ae1f6f7865582adaed394bb0233f161dcb Mon Sep 17 00:00:00 2001 From: Maniack Crudelis Date: Sun, 29 Mar 2020 13:40:41 +0200 Subject: [PATCH 10/10] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 11cbf39..3aa6d9f 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Baïkal for YunoHost -[![Integration level](https://dash.yunohost.org/integration/baikal.svg)](https://dash.yunohost.org/appci/app/baikal) +[![Integration level](https://dash.yunohost.org/integration/baikal.svg)](https://dash.yunohost.org/appci/app/baikal) ![](https://ci-apps.yunohost.org/ci/badges/baikal.status.svg) ![](https://ci-apps.yunohost.org/ci/badges/baikal.maintain.svg) [![Install Baïkal with YunoHost](https://install-app.yunohost.org/install-with-yunohost.png)](https://install-app.yunohost.org/?app=baikal) > *This package allow you to install Baïkal quickly and simply on a YunoHost server.