2022-08-30 05:01:39 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace KaraDAV;
|
|
|
|
|
2023-09-10 22:24:06 +00:00
|
|
|
/**
|
|
|
|
* This is the configuration file for KaraDAV
|
|
|
|
* *DO NOT* edit the config.dist.php, copy it to config.local.php
|
|
|
|
* and edit it to suit your needs. Changing config.dist.php won't do
|
|
|
|
* anything.
|
|
|
|
*
|
|
|
|
* If config.local.php does not exist, default values will be used.
|
|
|
|
*/
|
|
|
|
|
2022-10-24 22:35:52 +00:00
|
|
|
/**
|
|
|
|
* Default quota for new users (in MB)
|
|
|
|
*/
|
|
|
|
const DEFAULT_QUOTA = 200;
|
|
|
|
|
2023-09-11 14:38:07 +00:00
|
|
|
/**
|
|
|
|
* Default delay after which files should be deleted from the trashbin
|
|
|
|
* (in seconds)
|
|
|
|
* Set to zero (0) to disable the trashbin (files will be deleted directly)
|
|
|
|
*/
|
2023-09-11 19:23:28 +00:00
|
|
|
const DEFAULT_TRASHBIN_DELAY = 60*60*24*30; // 30 days
|
2023-09-11 14:38:07 +00:00
|
|
|
|
2022-08-30 05:01:39 +00:00
|
|
|
/**
|
|
|
|
* Users file storage path
|
|
|
|
* %s is replaced by the login name of the user
|
|
|
|
*/
|
|
|
|
const STORAGE_PATH = __DIR__ . '/data/%s';
|
|
|
|
|
2022-08-31 06:06:27 +00:00
|
|
|
/**
|
|
|
|
* SQLite3 database file
|
|
|
|
* This is where the users, app sessions and stuff will be stored
|
|
|
|
*/
|
|
|
|
const DB_FILE = __DIR__ . '/data/db.sqlite';
|
|
|
|
|
2022-08-30 05:01:39 +00:00
|
|
|
/**
|
|
|
|
* WWW_URL is the complete URL of the root of this server
|
2022-10-24 17:10:59 +00:00
|
|
|
*
|
2022-11-13 17:35:31 +00:00
|
|
|
* If you don't define it, KaraDAV will try to auto-detects it as well as it can.
|
|
|
|
* But you may have to assign something static instead if that fails, for example:
|
2022-10-24 17:10:59 +00:00
|
|
|
*
|
2022-08-30 05:01:39 +00:00
|
|
|
* const WWW_URL = 'https://dav.website.example/';
|
|
|
|
*/
|
2022-11-13 17:35:31 +00:00
|
|
|
#const WWW_URL = 'http://karadav.localhost/';
|
2022-10-15 00:15:39 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* WOPI client discovery URL
|
|
|
|
* eg. http://onlyoffice.domain.tld/hosting/discovery for OnlyOffice
|
|
|
|
* If set to NULL, WOPI support is disabled
|
|
|
|
*/
|
|
|
|
const WOPI_DISCOVERY_URL = null;
|
2022-10-21 16:21:38 +00:00
|
|
|
|
2022-10-28 21:57:47 +00:00
|
|
|
/**
|
|
|
|
* Set this to TRUE if you want 'Access-Control-Allow-Origin' header to be set to '*'
|
|
|
|
* and allow remote JS clients to make WebDAV requests.
|
|
|
|
*/
|
|
|
|
const ACCESS_CONTROL_ALL = false;
|
|
|
|
|
2022-10-21 16:21:38 +00:00
|
|
|
/**
|
|
|
|
* Path to a log file (eg. __DIR__ . '/debug.log')
|
|
|
|
* This will log all HTTP requests and responses received by the server
|
|
|
|
*/
|
2022-10-24 17:10:59 +00:00
|
|
|
const LOG_FILE = null;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Set to TRUE if you have X-SendFile module installed and configured
|
|
|
|
* see https://tn123.org/mod_xsendfile/
|
|
|
|
*/
|
|
|
|
const ENABLE_XSENDFILE = false;
|
2022-10-24 22:35:52 +00:00
|
|
|
|
2023-03-12 14:34:04 +00:00
|
|
|
/**
|
|
|
|
* Set to TRUE if you have a slow filesystem (eg. NFS/BindFS)
|
|
|
|
*
|
|
|
|
* This will disable directory sizes and directory last modification date
|
|
|
|
* (all directories will appear as 0-bytes, and the modification date might
|
|
|
|
* not be accurate). Not a huge impact, but it can appear weird to the user.
|
|
|
|
*
|
|
|
|
* Details: to find out the size taken by a directory, we must do the sum
|
|
|
|
* of all files and sub-directories, which might be slow if you have lots
|
|
|
|
* of files. Same for directory modification date, we need to find out the
|
|
|
|
* last modification of each file in that directory.
|
|
|
|
*
|
|
|
|
* Note that this will not disable slow operations used for quotas, as it
|
|
|
|
* would effectively disable quotas. You must disable each user quota.
|
|
|
|
*/
|
|
|
|
const DISABLE_SLOW_OPERATIONS = false;
|
|
|
|
|
2023-05-10 23:54:43 +00:00
|
|
|
/**
|
|
|
|
* External authentication callback
|
|
|
|
*
|
|
|
|
* Use this to authenticate a user with a third-party service.
|
|
|
|
* Provide a valid PHP callback: either a function name, or a class name and method in an array.
|
|
|
|
*
|
|
|
|
* The callback will be passed the username and password as parameters, and must return
|
|
|
|
* TRUE if auth was successful, or FALSE otherwise.
|
|
|
|
*
|
|
|
|
* If the callback returned TRUE and the user does not exist in the database,
|
|
|
|
* it will be created with the default quota.
|
|
|
|
*
|
|
|
|
* @var string|array
|
|
|
|
*/
|
|
|
|
const AUTH_CALLBACK = null;
|
|
|
|
//const AUTH_CALLBACK = ['MyAuthClass', 'login'];
|
2023-05-12 08:53:58 +00:00
|
|
|
//const AUTH_CALLBACK = 'KaraDAV\my_login';
|
2023-05-10 23:54:43 +00:00
|
|
|
//function my_login(string $user, string $password) {
|
|
|
|
// return ($user == 'me' && $password == 'secret');
|
|
|
|
//}
|
|
|
|
|
2022-10-24 22:35:52 +00:00
|
|
|
/**
|
|
|
|
* LDAP server configuration
|
|
|
|
*
|
|
|
|
* To use a LDAP server for login, fill those details.
|
2024-01-31 13:49:52 +00:00
|
|
|
* All LDAP constants MUST be filled, if any constant is NULL, then LDAP support is disabled.
|
2022-10-24 22:35:52 +00:00
|
|
|
*
|
2024-01-31 13:49:52 +00:00
|
|
|
* All users signing in with success, who don't have an existing account,
|
|
|
|
* will be created locally and have the default quota.
|
|
|
|
*
|
|
|
|
* Example strings are taken from https://yunohost.org/en/packaging_sso_ldap_integration#ldap-integration
|
2022-10-24 22:35:52 +00:00
|
|
|
*/
|
|
|
|
const LDAP_HOST = null;
|
2024-01-31 13:25:35 +00:00
|
|
|
//const LDAP_HOST = '127.0.0.1';
|
|
|
|
|
2024-01-31 13:49:52 +00:00
|
|
|
/**
|
|
|
|
* LDAP server port
|
|
|
|
* @var integer
|
|
|
|
*/
|
2024-01-31 13:25:35 +00:00
|
|
|
const LDAP_PORT = 389;
|
|
|
|
|
2024-01-31 13:49:52 +00:00
|
|
|
/**
|
|
|
|
* LDAP security
|
|
|
|
* Set to TRUE if using LDAPS
|
|
|
|
* @var bool
|
|
|
|
*/
|
2024-01-31 13:25:35 +00:00
|
|
|
const LDAP_SECURE = false;
|
2022-10-24 22:35:52 +00:00
|
|
|
|
2024-01-31 13:49:52 +00:00
|
|
|
/**
|
|
|
|
* LDAP user DN
|
|
|
|
* This is used in bind. Use %s for user login string.
|
|
|
|
* @var string
|
|
|
|
*/
|
2022-10-24 22:35:52 +00:00
|
|
|
const LDAP_LOGIN = null;
|
|
|
|
//const LDAP_LOGIN = 'uid=%s,ou=users,dc=yunohost,dc=org';
|
|
|
|
|
2024-01-31 13:49:52 +00:00
|
|
|
/**
|
|
|
|
* LDAP base DN
|
|
|
|
* @var string
|
|
|
|
*/
|
2022-10-24 22:35:52 +00:00
|
|
|
const LDAP_BASE = null;
|
|
|
|
//const LDAP_BASE = 'dc=yunohost,dc=org';
|
|
|
|
|
2024-01-31 13:49:52 +00:00
|
|
|
/**
|
|
|
|
* LDAP display name attribute
|
|
|
|
* @var string
|
|
|
|
*/
|
2022-10-24 22:35:52 +00:00
|
|
|
const LDAP_DISPLAY_NAME = null;
|
|
|
|
//const LDAP_DISPLAY_NAME = 'displayname';
|
|
|
|
|
2024-01-31 13:49:52 +00:00
|
|
|
/**
|
|
|
|
* LDAP Search filter
|
|
|
|
* This is used to find out if a logged-in user has the permission to access this application.
|
|
|
|
* Use %s for the user login.
|
|
|
|
* @var string
|
|
|
|
*/
|
2022-10-24 22:35:52 +00:00
|
|
|
const LDAP_FIND_USER = null;
|
|
|
|
//const LDAP_FIND_USER = '(&(|(objectclass=posixAccount))(uid=%s)(permission=cn=karadav.main,ou=permission,dc=yunohost,dc=org))';
|
|
|
|
|
2024-01-31 13:49:52 +00:00
|
|
|
/**
|
|
|
|
* LDAP admin filter
|
|
|
|
* This is used to find out if user can manage other users account and change quota etc.
|
|
|
|
* Use %s for the user login
|
|
|
|
* @var string
|
|
|
|
*/
|
2022-10-24 22:35:52 +00:00
|
|
|
const LDAP_FIND_IS_ADMIN = null;
|
|
|
|
//const LDAP_FIND_IS_ADMIN = '(&(|(objectclass=posixAccount))(uid=%s)(permission=cn=karadav.admin.main,ou=permission,dc=yunohost,dc=org))';
|
2022-10-29 23:07:42 +00:00
|
|
|
|
2022-11-21 14:52:31 +00:00
|
|
|
/**
|
2022-11-21 15:13:02 +00:00
|
|
|
* Show PHP errors details to users?
|
|
|
|
* If set to TRUE, full error messages and source code will be displayed to visitors.
|
|
|
|
* If set to FALSE, just a generic "an error happened" message will be displayed.
|
2022-11-21 14:52:31 +00:00
|
|
|
*
|
2022-11-21 15:13:02 +00:00
|
|
|
* It is recommended to set this to FALSE in production.
|
|
|
|
* Default: TRUE
|
|
|
|
*
|
|
|
|
* @var bool
|
|
|
|
*/
|
|
|
|
const ERRORS_SHOW = true;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Send PHP errors to this email address
|
|
|
|
* The email will contain
|
|
|
|
* Default: NULL (errors are not sent by email)
|
|
|
|
*
|
|
|
|
* @var string|null
|
|
|
|
*/
|
|
|
|
const ERRORS_EMAIL = null;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Log PHP errors in this file.
|
2023-09-04 21:05:09 +00:00
|
|
|
* Default: ROOT/data/error.log
|
2022-11-21 15:13:02 +00:00
|
|
|
*
|
|
|
|
* @var string
|
|
|
|
*/
|
2023-09-04 21:05:09 +00:00
|
|
|
const ERRORS_LOG = __DIR__ . '/data/error.log';
|
2022-11-21 15:13:02 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Send errors reports to this errbit/airbrake compatible API endpoint
|
|
|
|
* Default: NULL
|
2024-01-31 13:41:40 +00:00
|
|
|
* Example: 'https://user:password@domain.tld/errors'
|
2022-11-21 15:13:02 +00:00
|
|
|
*
|
|
|
|
* @var string|null
|
|
|
|
* @see https://errbit.com/images/error_summary.png
|
|
|
|
* @see https://airbrake.io/docs/api/#create-notice-v3
|
2022-11-21 14:52:31 +00:00
|
|
|
*/
|
2022-11-21 15:13:02 +00:00
|
|
|
const ERRORS_REPORT_URL = null;
|
2022-10-29 23:07:42 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Randomly generated secret key
|
|
|
|
* Usually you won't need to fill this constant. A random secret key will be generated
|
|
|
|
* and written to this file when the first access is made.
|
|
|
|
* But if you don't allow your web server to write to this file, then please use a true
|
|
|
|
* random bytes generator to create a ~30 bytes random key and put it in this constant :)
|
|
|
|
*/
|
|
|
|
//const SECRET_KEY = 'verySECRETstringHEREplease';
|