mirror of
https://github.com/YunoHost-Apps/baikal_ynh.git
synced 2024-09-03 18:16:11 +02:00
commit
21d64e2a42
10 changed files with 28 additions and 17 deletions
|
@ -1,6 +1,6 @@
|
|||
# Baïkal for YunoHost
|
||||
|
||||
[](https://dash.yunohost.org/appci/app/baikal)
|
||||
[](https://dash.yunohost.org/appci/app/baikal)  
|
||||
[](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
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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__');
|
|
@ -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');
|
||||
|
|
|
@ -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": {
|
||||
|
|
|
@ -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%%;*}"
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue