-
Notifications
You must be signed in to change notification settings - Fork 14
/
config.dist.php
225 lines (199 loc) · 6.34 KB
/
config.dist.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
<?php
namespace KaraDAV;
/**
* 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.
*/
/**
* Default quota for new users (in MB)
*/
const DEFAULT_QUOTA = 200;
/**
* 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)
*/
const DEFAULT_TRASHBIN_DELAY = 60*60*24*30; // 30 days
/**
* Users file storage path
* %s is replaced by the login name of the user
*/
const STORAGE_PATH = __DIR__ . '/data/%s';
/**
* SQLite3 database file
* This is where the users, app sessions and stuff will be stored
*/
const DB_FILE = __DIR__ . '/data/db.sqlite';
/**
* WWW_URL is the complete URL of the root of this server
*
* 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:
*
* const WWW_URL = 'https://dav.website.example/';
*/
#const WWW_URL = 'http://karadav.localhost/';
/**
* 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;
/**
* 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;
/**
* Path to a log file (eg. __DIR__ . '/debug.log')
* This will log all HTTP requests and responses received by the server
*/
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;
/**
* 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;
/**
* 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'];
//const AUTH_CALLBACK = 'KaraDAV\my_login';
//function my_login(string $user, string $password) {
// return ($user == 'me' && $password == 'secret');
//}
/**
* LDAP server configuration
*
* To use a LDAP server for login, fill those details.
* All LDAP constants MUST be filled, if any constant is NULL, then LDAP support is disabled.
*
* 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
*/
const LDAP_HOST = null;
//const LDAP_HOST = '127.0.0.1';
/**
* LDAP server port
* @var integer
*/
const LDAP_PORT = 389;
/**
* LDAP security
* Set to TRUE if using LDAPS
* @var bool
*/
const LDAP_SECURE = false;
/**
* LDAP user DN
* This is used in bind. Use %s for user login string.
* @var string
*/
const LDAP_LOGIN = null;
//const LDAP_LOGIN = 'uid=%s,ou=users,dc=yunohost,dc=org';
/**
* LDAP base DN
* @var string
*/
const LDAP_BASE = null;
//const LDAP_BASE = 'dc=yunohost,dc=org';
/**
* LDAP display name attribute
* @var string
*/
const LDAP_DISPLAY_NAME = null;
//const LDAP_DISPLAY_NAME = 'displayname';
/**
* 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
*/
const LDAP_FIND_USER = null;
//const LDAP_FIND_USER = '(&(|(objectclass=posixAccount))(uid=%s)(permission=cn=karadav.main,ou=permission,dc=yunohost,dc=org))';
/**
* 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
*/
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))';
/**
* 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.
*
* 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.
* Default: ROOT/data/error.log
*
* @var string
*/
const ERRORS_LOG = __DIR__ . '/data/error.log';
/**
* Send errors reports to this errbit/airbrake compatible API endpoint
* Default: NULL
* Example: 'https://user:password@domain.tld/errors'
*
* @var string|null
* @see https://errbit.com/images/error_summary.png
* @see https://airbrake.io/docs/api/#create-notice-v3
*/
const ERRORS_REPORT_URL = null;
/**
* 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';