|
|
@ -9,6 +9,7 @@ app=$YNH_APP_INSTANCE_NAME |
|
|
domain=$1 |
|
|
domain=$1 |
|
|
path=${2%/} |
|
|
path=${2%/} |
|
|
admin=$3 |
|
|
admin=$3 |
|
|
|
|
|
user_home=$4 |
|
|
|
|
|
|
|
|
# Load common variables |
|
|
# Load common variables |
|
|
. ./_common.sh |
|
|
. ./_common.sh |
|
|
@ -44,7 +45,6 @@ ynh_package_install_from_equivs ../conf/${DEPS_PKG_NAME}.control \ |
|
|
|
|
|
|
|
|
# Generate random password |
|
|
# Generate random password |
|
|
dbpass=$(ynh_string_random) |
|
|
dbpass=$(ynh_string_random) |
|
|
ynh_app_setting_set $app mysqlpwd $dbpass |
|
|
|
|
|
|
|
|
|
|
|
# Initialize database |
|
|
# Initialize database |
|
|
ynh_mysql_create_db $dbname $dbuser $dbpass |
|
|
ynh_mysql_create_db $dbname $dbuser $dbpass |
|
|
@ -66,9 +66,6 @@ sed -i "s@#DOMAIN#@${domain}@g" ../conf/config.json |
|
|
sed -i "s@#DATADIR#@${DATADIR}@g" ../conf/config.json |
|
|
sed -i "s@#DATADIR#@${DATADIR}@g" ../conf/config.json |
|
|
sudo cp ../conf/config.json "$oc_conf" |
|
|
sudo cp ../conf/config.json "$oc_conf" |
|
|
|
|
|
|
|
|
# Copy configuration for external storage plugin |
|
|
|
|
|
sudo cp ../conf/mount.json "$DATADIR" |
|
|
|
|
|
|
|
|
|
|
|
# Copy and set nginx configuration |
|
|
# Copy and set nginx configuration |
|
|
nginx_conf="/etc/nginx/conf.d/${domain}.d/${app}.conf" |
|
|
nginx_conf="/etc/nginx/conf.d/${domain}.d/${app}.conf" |
|
|
sed -i "s@#APP#@${app}@g" ../conf/nginx.conf |
|
|
sed -i "s@#APP#@${app}@g" ../conf/nginx.conf |
|
|
@ -116,10 +113,12 @@ sudo rm -f "$oc_conf" |
|
|
_exec_occ ldap:test-config \'\' \ |
|
|
_exec_occ ldap:test-config \'\' \ |
|
|
|| ynh_die "An error occured during LDAP configuration" |
|
|
|| ynh_die "An error occured during LDAP configuration" |
|
|
|
|
|
|
|
|
# Enable External Storage and create local mount |
|
|
|
|
|
|
|
|
# Enable External Storage and create local mount to home folder |
|
|
|
|
|
if [[ $user_home -eq 1 ]]; then |
|
|
_exec_occ app:enable files_external |
|
|
_exec_occ app:enable files_external |
|
|
_exec_occ files_external:create \ |
|
|
_exec_occ files_external:create \ |
|
|
'Home' 'local' 'null::null' -c 'datadir=/home/$user' |
|
|
'Home' 'local' 'null::null' -c 'datadir=/home/$user' |
|
|
|
|
|
fi |
|
|
|
|
|
|
|
|
# Add dynamic logout URL to the config |
|
|
# Add dynamic logout URL to the config |
|
|
_exec_occ config:system:get logout_url >/dev/null 2>&1 \ |
|
|
_exec_occ config:system:get logout_url >/dev/null 2>&1 \ |
|
|
@ -152,6 +151,10 @@ sudo find ${DATADIR}/ -type d -print0 | sudo xargs -0 chmod 0750 |
|
|
sudo chmod 640 "${DESTDIR}/config/config.php" |
|
|
sudo chmod 640 "${DESTDIR}/config/config.php" |
|
|
sudo chmod 755 /home/yunohost.app |
|
|
sudo chmod 755 /home/yunohost.app |
|
|
|
|
|
|
|
|
|
|
|
# Store app settings |
|
|
|
|
|
ynh_app_setting_set "$app" user_home "$user_home" |
|
|
|
|
|
ynh_app_setting_set "$app" mysqlpwd "$dbpass" |
|
|
|
|
|
|
|
|
# Set SSOwat rules |
|
|
# Set SSOwat rules |
|
|
ynh_app_setting_set "$app" unprotected_uris "/remote.php" |
|
|
ynh_app_setting_set "$app" unprotected_uris "/remote.php" |
|
|
ynh_app_setting_set "$app" skipped_uris "/.well-known" |
|
|
ynh_app_setting_set "$app" skipped_uris "/.well-known" |
|
|
|