1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/roundcube_ynh.git synced 2024-09-03 20:16:28 +02:00

[add] install Enigma plugin or not

This commit is contained in:
magikcypress 2017-07-03 15:05:22 +02:00
parent 62da88086a
commit aa7733a9ac
No known key found for this signature in database
GPG key ID: 3B3C7CD61957AC9A
6 changed files with 36 additions and 0 deletions

View file

@ -4,6 +4,7 @@
domain="domain.tld" (DOMAIN)
path="/path" (PATH)
with_carddav=1
with_enigma=1
; Checks
pkg_linter=1
setup_sub_dir=1

View file

@ -51,6 +51,15 @@
"fr": "Installer le plugin de synchronisation CardDAV ?"
},
"default": false
},
{
"name": "with_enigma",
"type": "boolean",
"ask": {
"en": "Install Enigma encrypt message plugin?",
"fr": "Installer le plugin de chiffrement des messages Enigma ?"
},
"default": false
}
]
}

View file

@ -13,6 +13,7 @@ app=$YNH_APP_INSTANCE_NAME
domain=$(ynh_app_setting_get "$app" domain)
path=$(ynh_app_setting_get "$app" path)
with_carddav=$(ynh_app_setting_get "$app" with_carddav)
with_enigma=$(ynh_app_setting_get "$app" with_enigma)
dbpass=$(ynh_app_setting_get "$app" mysqlpwd)
dbname=$app
dbuser=$app

View file

@ -29,6 +29,7 @@ dbpass=$(ynh_string_random)
ynh_app_setting_set $app domain $domain
ynh_app_setting_set $app path $path
ynh_app_setting_set $app with_carddav $with_carddav
ynh_app_setting_set $app with_enigma $with_enigma
# Check destination directory
final_path=/var/www/$app
@ -81,6 +82,13 @@ if [[ $with_carddav -eq 1 ]]; then
|| echo "Unable to install CardDAV plugin" >&2
fi
# Install Enigma plugin
if [[ $with_enigma -eq 1 ]]; then
sudo cp -a "$final_path/plugins/enigma/config.inc.php.dist" "$final_path/plugins/enigma/config.inc.php" \
&& installed_plugins+=" 'enigma'," \
|| echo "Unable to install Enigma plugin" >&2
fi
# Update Roundcube configuration
sudo sed -i "s#^\s*// installed plugins#&\n ${installed_plugins}#" \
"${final_path}/config/config.inc.php"

View file

@ -19,6 +19,7 @@ app=$YNH_APP_INSTANCE_NAME
domain=$(ynh_app_setting_get "$app" domain)
path=$(ynh_app_setting_get "$app" path)
with_carddav=$(ynh_app_setting_get "$app" with_carddav)
with_enigma=$(ynh_app_setting_get "$app" with_enigma)
dbpass=$(ynh_app_setting_get "$app" mysqlpwd)
dbname=$app
dbuser=$app

View file

@ -21,6 +21,7 @@ path=$(ynh_app_setting_get "$app" path)
path=${path%/}
dbpass=$(ynh_app_setting_get "$app" mysqlpwd)
with_carddav=$(ynh_app_setting_get "$app" with_carddav)
with_enigma=$(ynh_app_setting_get "$app" with_enigma)
dbname=$app
dbuser=$app
@ -97,6 +98,21 @@ if [[ $with_carddav -eq 1 ]]; then
|| echo "Unable to install CardDAV plugin" >&2
fi
# Guess with_enigma value if empty
if [[ -z "${with_enigma:-}" ]]; then
[[ -f "${final_path}/plugins/enigma/config.inc.php" ]] \
&& with_enigma=1 \
|| with_enigma=0
ynh_app_setting_set "$app" with_enigma "$with_enigma"
fi
# Install Enigma plugin
if [[ $with_enigma -eq 1 ]]; then
sudo cp -a "$final_path/plugins/enigma/config.inc.php.dist" "$final_path/plugins/enigma/config.inc.php" \
&& installed_plugins+=" 'enigma'," \
|| echo "Unable to install Enigma plugin" >&2
fi
# Update Roundcube configuration
sudo sed -i "s#^\s*// installed plugins#&\n ${installed_plugins}#" \
"$rc_conf"