diff --git a/README.md b/README.md index a587c66..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. @@ -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.1 ## Screenshots diff --git a/conf/app.src b/conf/app.src index f07f48a..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.5.3/baikal-0.5.3.zip -SOURCE_SUM=11e6971a3cdc4c0cfc36e82498809162b5a6cfb67545f0dbc5b9d9e0c28c93c0 +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.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 diff --git a/conf/config.system.php b/conf/config.system.php index 2399d76..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.5.3'); +define("BAIKAL_CONFIGURED_VERSION", '0.6.1'); diff --git a/manifest.json b/manifest.json index 1e5856c..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.5.3~ynh1", + "version": "0.6.1~ynh1", "url": "http://baikal-server.com/", "license": "GPL-3.0", "maintainer": { diff --git a/scripts/_common.sh b/scripts/_common.sh index 93323b9..dfc713b 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -12,17 +12,19 @@ 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. - 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" --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%%;*}" diff --git a/scripts/change_url b/scripts/change_url index 4cb7436..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 "https://$new_domain/.well-known/caldav" || is_url_handled "https://$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 8b145ac..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 "https://$domain/.well-known/caldav" || is_url_handled "https://$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 9a07854..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 "https://$domain/.well-known/caldav" || is_url_handled "https://$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/upgrade b/scripts/upgrade index 2386a0a..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 #================================================= @@ -141,7 +149,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 +171,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