mirror of
https://github.com/YunoHost-Apps/baikal_ynh.git
synced 2024-09-03 18:16:11 +02:00
Fix
This commit is contained in:
parent
2c58f5cce8
commit
73228b9f5c
6 changed files with 21 additions and 38 deletions
|
@ -4,7 +4,7 @@
|
|||
[](https://install-app.yunohost.org/?app=baikal)
|
||||
|
||||
> *This package allow you to install Baïkal quickly and simply on a YunoHost server.
|
||||
If you don't have YunoHost, please see [here](https://yunohost.org/#/install) to know how to install and enjoy it.*
|
||||
If you don't have YunoHost, please see [here](https://yunohost.org/install) to know how to install and enjoy it.*
|
||||
|
||||
## Overview
|
||||
[Baïkal](http://baikal-server.com/) is a CalDAV and CardDAV server, based on
|
||||
|
@ -27,7 +27,7 @@ sabre/dav, that includes an administration interface for easy management.
|
|||
## Documentation
|
||||
|
||||
* Official documentation: http://sabre.io/baikal/
|
||||
* YunoHost documentation: https://yunohost.org/#/app_baikal
|
||||
* YunoHost documentation: https://yunohost.org/en/app_baikal
|
||||
|
||||
## YunoHost specific features
|
||||
|
||||
|
@ -39,8 +39,8 @@ In addition to Baïkal core features, the following are made available with this
|
|||
|
||||
#### Supported architectures
|
||||
|
||||
* x86-64 - [](https://ci-apps.yunohost.org/ci/apps/baikal/)
|
||||
* ARMv8-A - [](https://ci-apps-arm.yunohost.org/ci/apps/baikal/)
|
||||
* x86-64 - [](https://ci-apps.yunohost.org/ci/apps/baikal/)
|
||||
* ARMv8-A - [](https://ci-apps-arm.yunohost.org/ci/apps/baikal/)
|
||||
|
||||
## Limitations
|
||||
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
setup_private=0
|
||||
setup_public=0
|
||||
upgrade=1
|
||||
upgrade=1 from_commit=7960d347424cb1cb931c91f2628dd829288184e1
|
||||
upgrade=1 from_commit=099f63413f120982232a77fd4ff5f62530d546ad
|
||||
backup_restore=1
|
||||
multi_instance=0
|
||||
change_url=1
|
||||
|
@ -19,6 +19,6 @@
|
|||
Email=
|
||||
Notification=none
|
||||
;;; Upgrade options
|
||||
; commit=7960d347424cb1cb931c91f2628dd829288184e1
|
||||
name=bump baikal to 0.5.3
|
||||
; commit=099f63413f120982232a77fd4ff5f62530d546ad
|
||||
name=Testing (#57)
|
||||
manifest_arg=domain=DOMAIN&path=PATH&password=mysecret&
|
||||
|
|
|
@ -5,7 +5,7 @@ system:
|
|||
cal_enabled: true
|
||||
invite_from: 'noreply@localhost'
|
||||
dav_auth_type: 'LDAP-UserBind'
|
||||
admin_passwordhash: __PASSWORDHASH__
|
||||
admin_passwordhash: __PASSWORD_HASH__
|
||||
auth_realm: BaikalDAV
|
||||
base_uri: '__PATH__'
|
||||
# Auth Backend LDAP-UserBind; LDAP URI
|
||||
|
@ -24,6 +24,6 @@ database:
|
|||
sqlite_file: "absolute/path/to/Specific/db/db.sqlite"
|
||||
mysql: true
|
||||
mysql_host: 'localhost'
|
||||
mysql_dbname: '__DBNAME__'
|
||||
mysql_username: '__DBUSER__'
|
||||
mysql_password: '__DBPASS__'
|
||||
mysql_dbname: '__DB_NAME__'
|
||||
mysql_username: '__DB_NAME__'
|
||||
mysql_password: '__DB_PWD__'
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
location = /.well-known/carddav {
|
||||
return 301 https://$server_name__PATH__/card.php;
|
||||
}
|
||||
|
||||
location = /.well-known/caldav {
|
||||
return 301 https://$server_name__PATH__/cal.php;
|
||||
}
|
||||
|
|
|
@ -116,25 +116,14 @@ ynh_mysql_connect_as --user=$db_name --password="$db_pwd" --database=$db_name \
|
|||
#=================================================
|
||||
|
||||
bk_conf="${final_path}/config/baikal.yaml"
|
||||
cp ../conf/baikal.yaml "$bk_conf"
|
||||
|
||||
ynh_replace_string --match_string="__TIMEZONE__" --replace_string="$(cat /etc/timezone)" --target_file="$bk_conf"
|
||||
# Create admin password hash
|
||||
timezone=$(cat /etc/timezone)
|
||||
password_hash=$(echo -n admin:BaikalDAV:$password | sha256sum | cut -d ' ' -f 1)
|
||||
ynh_replace_string --match_string="__PASSWORDHASH__" --replace_string="${password_hash}" --target_file="$bk_conf"
|
||||
ynh_app_setting_set --app=$app --key=password_hash --value=$password_hash
|
||||
|
||||
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"
|
||||
ynh_replace_string --match_string="__DBPASS__" --replace_string="$db_pwd" --target_file="$bk_conf"
|
||||
|
||||
path=${path_url%/}
|
||||
deskey=$(ynh_string_random 24)
|
||||
ynh_app_setting_set --app=$app --key=encrypt_key --value="$deskey"
|
||||
ynh_replace_string --match_string="__DESKEY__" --replace_string="$deskey" --target_file="$bk_conf"
|
||||
|
||||
# Store the config file checksum into the app settings
|
||||
ynh_store_file_checksum --file="$bk_conf"
|
||||
ynh_add_config --template="../conf/baikal.yaml" --destination="$bk_conf"
|
||||
|
||||
# Disable installation
|
||||
touch "${final_path}/Specific/INSTALL_DISABLED"
|
||||
|
|
|
@ -22,6 +22,7 @@ final_path=$(ynh_app_setting_get --app=$app --key=final_path)
|
|||
db_name=$(ynh_app_setting_get --app=$app --key=db_name)
|
||||
phpversion=$(ynh_app_setting_get --app=$app --key=phpversion)
|
||||
db_pwd=$(ynh_app_setting_get --app=$app --key=mysqlpwd)
|
||||
password_hash=$(ynh_app_setting_get --app=$app --key=password_hash)
|
||||
|
||||
#=================================================
|
||||
# CHECK VERSION
|
||||
|
@ -142,27 +143,19 @@ then
|
|||
#=================================================
|
||||
ynh_script_progression --message="Upgrading Baïkal configuration..." --weight=2
|
||||
|
||||
bk_conf="${final_path}/config/baikal.yaml"
|
||||
ynh_backup_if_checksum_is_different --file="$bk_conf"
|
||||
cp ../conf/baikal.yaml "$bk_conf"
|
||||
|
||||
ynh_replace_string --match_string="__TIMEZONE__" --replace_string="$(cat /etc/timezone)" --target_file="$bk_conf"
|
||||
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)
|
||||
password_hash=$(echo -n admin:BaikalDAV:$password | md5sum | cut -d ' ' -f 1)
|
||||
ynh_app_setting_set --app=$app --key=password_hash --value=$password_hash
|
||||
fi
|
||||
ynh_replace_string --match_string="__PASSWORDHASH__" --replace_string="${password_hash}" --target_file="$bk_conf"
|
||||
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"
|
||||
ynh_replace_string --match_string="__DBPASS__" --replace_string="$db_pwd" --target_file="$bk_conf"
|
||||
|
||||
bk_conf="${final_path}/config/baikal.yaml"
|
||||
timezone=$(cat /etc/timezone)
|
||||
path=${path_url%/}
|
||||
deskey=$(ynh_app_setting_get --app=$app --key=encrypt_key)
|
||||
ynh_app_setting_set --app=$app --key=encrypt_key --value="$deskey"
|
||||
ynh_replace_string --match_string="__DESKEY__" --replace_string="$deskey" --target_file="$bk_conf"
|
||||
|
||||
ynh_add_config --template="../conf/baikal.yaml" --destination="$bk_conf"
|
||||
|
||||
#=================================================
|
||||
# UPGRADE BAIKAL
|
||||
|
|
Loading…
Add table
Reference in a new issue