diff --git a/conf/backend/config-caldav.php b/conf/backend/config-caldav.php index d90ddb5..6499eaf 100644 --- a/conf/backend/config-caldav.php +++ b/conf/backend/config-caldav.php @@ -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 diff --git a/conf/backend/config-carddav.php b/conf/backend/config-carddav.php index b291d2c..3020359 100644 --- a/conf/backend/config-carddav.php +++ b/conf/backend/config-carddav.php @@ -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 diff --git a/conf/backend/config-imap.php b/conf/backend/config-imap.php index 664a172..57a724e 100644 --- a/conf/backend/config-imap.php +++ b/conf/backend/config-imap.php @@ -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); diff --git a/scripts/install b/scripts/install index ee244ab..14f44ce 100755 --- a/scripts/install +++ b/scripts/install @@ -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 - cp ../conf/backend/config-imap.php $final_path/backend/imap/config.php - cp ../conf/backend/config-autodiscover.php $final_path/autodiscover/config.php + + # Copy config + cp ../conf/backend/config-imap.php $final_path/backend/imap/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/