Improved Nextcloud integration for #96

This commit is contained in:
the-djmaze 2022-10-13 10:24:35 +02:00
parent dc241ded1b
commit 5c597c4c1d
10 changed files with 123 additions and 35 deletions

View file

@ -0,0 +1,44 @@
<?php
// Name this file as "include.php" to enable it.
//header('Strict-Transport-Security: max-age=31536000');
/**
* Uncomment to use gzip compressed output
*/
//define('USE_GZIP', 1);
/**
* Uncomment to use brotli compressed output
*/
//define('USE_BROTLI', 1);
/**
* Uncomment to enable multiple domain installation.
*/
//define('MULTIDOMAIN', 1);
/**
* Uncomment to disable APCU.
*/
//define('APP_USE_APCU_CACHE', false);
/**
* Custom 'data' folder path
*/
if (!empty($_ENV['SNAPPYMAIL_NEXTCLOUD'])) {
define('APP_DATA_FOLDER_PATH', \rtrim(\trim(\OC::$server->getSystemConfig()->getValue('datadirectory', '')), '\\/').'/appdata_snappymail/');
} else {
http_response_code(400);
header($_SERVER['SERVER_PROTOCOL'].' 400 Bad Request', true, 400);
error_log("SnappyMail outside Nextcloud {$_SERVER['REQUEST_URI']}");
exit('Not inside Nextcloud');
// define('APP_DATA_FOLDER_PATH', dirname(__DIR__) . '/snappymail-data/');
// define('APP_DATA_FOLDER_PATH', '/var/external-snappymail-data-folder/');
}
/**
* Additional configuration file name
*/
//define('APP_CONFIGURATION_NAME', $_SERVER['HTTP_HOST'].'.ini');