1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/z-push_ynh.git synced 2024-09-03 18:05:58 +02:00

Implement Nextcloud configuration (#5)

* Add nextcloud

* Reorder config file

* switch variable names

* fix variables

* Fix nextcloud config
This commit is contained in:
yalh76 2019-04-08 21:45:53 +02:00 committed by GitHub
parent 5cf5429590
commit 98549674bf
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 58 additions and 24 deletions

View file

@ -33,16 +33,16 @@
define('CALDAV_PROTOCOL', 'https');
// Server name
define('CALDAV_SERVER', '__BAIKALDOMAIN__');
define('CALDAV_SERVER', '__CALDAV_SERVER__');
// Server port
define('CALDAV_PORT', '443');
// Path
define('CALDAV_PATH', '__BAIKALPATH__/cal.php/calendars/%u/');
define('CALDAV_PATH', '__CALDAV_PATH__');
// Default CalDAV folder (calendar folder/principal). This will be marked as the default calendar in the mobile
define('CALDAV_PERSONAL', 'default');
define('CALDAV_PERSONAL', '__CALDAV_PERSONAL__');
// If the CalDAV server supports the sync-collection operation
// DAViCal, SOGo and SabreDav support it

View file

@ -31,7 +31,7 @@
define('CARDDAV_PROTOCOL', 'https');
// Server name
define('CARDDAV_SERVER', '__BAIKALDOMAIN__');
define('CARDDAV_SERVER', '__CARDDAV_SERVER__');
// Server port
define('CARDDAV_PORT', '443');
@ -45,7 +45,7 @@ define('CARDDAV_PORT', '443');
// %u: replaced with the username
// %d: replaced with the domain
// Add the trailing /
define('CARDDAV_PATH', '__BAIKALPATH__/card.php/addressbooks/%u/');
define('CARDDAV_PATH', '__CARDDAV_PATH__');
// Server path to the default addressbook
@ -53,7 +53,7 @@ define('CARDDAV_PATH', '__BAIKALPATH__/card.php/addressbooks/%u/');
// %u: replaced with the username
// %d: replaced with the domain
// Add the trailing /
define('CARDDAV_DEFAULT_PATH', '__BAIKALPATH__/card.php/addressbooks/%u/default');
define('CARDDAV_DEFAULT_PATH', '__CARDDAV_DEFAULT_PATH__');
// Server path to the GAL addressbook. This addressbook is readonly and searchable by the user, but it will NOT be synced.
// If you don't want GAL, comment it

View file

@ -203,7 +203,7 @@ global $imap_smtp_params;
// IMPORTANT: To use SSL you must use PHP 5.1 or later, install openssl libs and use ssl:// within the host variable
// IMPORTANT: To use SSL with PHP 5.6 you should set verify_peer, verify_peer_name and allow_self_signed
//$imap_smtp_params = array('host' => 'ssl://localhost', 'port' => 465, 'auth' => true, 'username' => 'imap_username', 'password' => 'imap_password');
$imap_smtp_params = array('host' => 'tcp://__DOMAINTOCHANGE__', 'port' => 587, 'auth' => true, 'username' => 'imap_username', 'password' => 'imap_password', 'localhost' => '__DOMAINTOCHANGE__', 'verify_peer' => false, 'verify_peer_name' => false, 'allow_self_signed' => true);
$imap_smtp_params = array('host' => 'tcp://__IMAP_SERVER__', 'port' => 587, 'auth' => true, 'username' => 'imap_username', 'password' => 'imap_password', 'localhost' => '__IMAP_SERVER__', 'verify_peer' => false, 'verify_peer_name' => false, 'allow_self_signed' => true);

View file

@ -120,42 +120,76 @@ ynh_replace_string __STATEDIR__ $statedir ../conf/config.php
# Enable caldav carddav support
if yunohost app list --installed -f baikal | grep -q id ; then
echo "Detected Baikal"
caldavdomain=$(ynh_app_setting_get baikal domain)
caldavpath=$(ynh_app_setting_get baikal path)
caldavpath=${caldavpath%/}
bailkaldomain=$(ynh_app_setting_get baikal domain)
bailkalpath=$(ynh_app_setting_get baikal path)
bailkalpath=${bailkalpath%/}
# Configuration of backend
ynh_replace_string __BACKEND__ BackendCombined ../conf/config.php
ynh_replace_string __BACKEND__ BackendCombined ../conf/backend/config-autodiscover.php
# Configuration baikal
ynh_replace_string __BAIKALDOMAIN__ $caldavdomain ../conf/backend/config-caldav.php
ynh_replace_string __BAIKALDOMAIN__ $caldavdomain ../conf/backend/config-carddav.php
ynh_replace_string __BAIKALPATH__ $caldavpath ../conf/backend/config-caldav.php
ynh_replace_string __BAIKALPATH__ $caldavpath ../conf/backend/config-carddav.php
ynh_replace_string __DOMAINTOCHANGE__ $domain ../conf/backend/config-imap.php
ynh_replace_string __CALDAV_SERVER__ "${bailkaldomain}" ../conf/backend/config-caldav.php
ynh_replace_string __CALDAV_PATH__ "${bailkalpath}/cal.php/calendars/%u/" ../conf/backend/config-caldav.php
ynh_replace_string __CALDAV_PERSONAL__ "default" ../conf/backend/config-caldav.php
ynh_replace_string __CARDDAV_SERVER__ "${bailkaldomain}" ../conf/backend/config-carddav.php
ynh_replace_string __CARDDAV_PATH__ "${bailkalpath}/card.php/addressbooks/%u/" ../conf/backend/config-carddav.php
ynh_replace_string __CARDDAV_DEFAULT_PATH__ "${bailkalpath}/card.php/addressbooks/%u/default" ../conf/backend/config-carddav.php
ynh_replace_string __IMAP_SERVER__ "${domain}" ../conf/backend/config-imap.php
ynh_replace_string __FLAGTOCHANGE__ true ../conf/backend/config-imap.php
# Copy config
cp ../conf/config.php $final_path/config.php
cp ../conf/backend/config-imap.php $final_path/backend/imap/config.php
cp ../conf/backend/config-carddav.php $final_path/backend/carddav/config.php
cp ../conf/backend/config-caldav.php $final_path/backend/caldav/config.php
cp ../conf/backend/config-carddav.php $final_path/backend/carddav/config.php
cp ../conf/backend/config-imap.php $final_path/backend/imap/config.php
cp ../conf/backend/config-combined.php $final_path/backend/combined/config.php
elif yunohost app list --installed -f nextcloud | grep -q id ; then
echo "Detected NextCloud"
nextclouddomain=$(ynh_app_setting_get nextcloud domain)
nextcloudpath=$(ynh_app_setting_get nextcloud path)
nextcloudpath=${nextcloudpath%/}
# Configuration of backend
ynh_replace_string __BACKEND__ BackendCombined ../conf/config.php
ynh_replace_string __BACKEND__ BackendCombined ../conf/backend/config-autodiscover.php
# Configuration nextcloud
ynh_replace_string __CALDAV_SERVER__ "${nextclouddomain}" ../conf/backend/config-caldav.php
ynh_replace_string __CALDAV_PATH__ "${nextcloudpath}/remote.php/dav/calendars/%u/" ../conf/backend/config-caldav.php
ynh_replace_string __CALDAV_PERSONAL__ "personal" ../conf/backend/config-caldav.php
ynh_replace_string __CARDDAV_SERVER__ "${nextclouddomain}" ../conf/backend/config-carddav.php
ynh_replace_string __CARDDAV_PATH__ "${nextcloudpath}/remote.php/dav/addressbooks/users/%u/contacts/" ../conf/backend/config-carddav.php
ynh_replace_string __CARDDAV_DEFAULT_PATH__ "${nextcloudpath}/remote.php/dav/addressbooks/users/%u/contacts/" ../conf/backend/config-carddav.php
ynh_replace_string __IMAP_SERVER__ "${domain}" ../conf/backend/config-imap.php
ynh_replace_string __FLAGTOCHANGE__ true ../conf/backend/config-imap.php
# Copy config
cp ../conf/backend/config-caldav.php $final_path/backend/caldav/config.php
cp ../conf/backend/config-carddav.php $final_path/backend/carddav/config.php
cp ../conf/backend/config-imap.php $final_path/backend/imap/config.php
cp ../conf/backend/config-combined.php $final_path/backend/combined/config.php
cp ../conf/backend/config-autodiscover.php $final_path/autodiscover/config.php
else
# Configuration of backend
ynh_replace_string __BACKEND__ BackendIMAP ../conf/config.php
ynh_replace_string __BACKEND__ BackendIMAP ../conf/backend/config-autodiscover.php
# Copy config
cp ../conf/config.php $final_path/config.php
ynh_replace_string __DOMAINTOCHANGE__ $domain ../conf/backend/config-imap.php
# Configuration imap
ynh_replace_string __IMAP_SERVER__ "${domain}" ../conf/backend/config-imap.php
ynh_replace_string __FLAGTOCHANGE__ false ../conf/backend/config-imap.php
# Copy config
cp ../conf/backend/config-imap.php $final_path/backend/imap/config.php
cp ../conf/backend/config-autodiscover.php $final_path/autodiscover/config.php
fi
# Copy config
cp ../conf/config.php $final_path/config.php
cp ../conf/backend/config-autodiscover.php $final_path/autodiscover/config.php
#Copy XMLElement.php
ln -s /usr/share/awl/inc/XML* /var/www/$app/include/