| |
1 # WsgiDAV configuration file |
| |
2 # |
| |
3 # 1. Rename this file to `wsgidav.yaml`. |
| |
4 # 2. Adjust settings as appropriate. |
| |
5 # 3. Run `wsgidav` from the same directory or pass file path with `--config` option. |
| |
6 # |
| |
7 # See https://wsgidav.readthedocs.io/en/latest/user_guide_configure.html |
| |
8 # |
| |
9 # ============================================================================ |
| |
10 # SERVER OPTIONS |
| |
11 |
| |
12 #: Run WsgiDAV inside this WSGI server. |
| |
13 #: Supported servers: |
| |
14 #: cheroot, ext-wsgiutils, gevent, gunicorn, paste, uvicorn, wsgiref |
| |
15 #: 'wsgiref' and 'ext_wsgiutils' are simple builtin servers that should *not* be |
| |
16 #: used in production. |
| |
17 #: All other servers must have been installed before, e.g. `pip install cheroot`. |
| |
18 #: (The binary MSI distribution already includes 'cheroot'.) |
| |
19 #: NOTE: Using 'gunicorn' with more than 1 worker can cause problems with the |
| |
20 #: in-memory and shelve-based lock storage as both are not safe for concurrent |
| |
21 #: access. (see issue #332) Instead, you can use 'gunicorn' with multiple `threads` |
| |
22 #: or try the 'redis' based lock storage (#186). |
| |
23 #: Default: 'cheroot', use the `--server` command line option to change this. |
| |
24 |
| |
25 server: cheroot |
| |
26 |
| |
27 #: Server specific arguments, passed to the server. For example cheroot: |
| |
28 #: https://cheroot.cherrypy.dev/en/latest/pkg/cheroot.wsgi.html#cheroot.wsgi.Server |
| |
29 # server_args: |
| |
30 # max: -1 |
| |
31 # numthreads: 10 |
| |
32 # request_queue_size: 5 |
| |
33 # shutdown_timeout: 5 |
| |
34 # timeout: 10 |
| |
35 |
| |
36 # Server hostname (default: localhost, use --host on command line) |
| |
37 host: 127.0.0.1 |
| |
38 |
| |
39 # Server port (default: 8080, use --port on command line) |
| |
40 port: 8182 |
| |
41 |
| |
42 # Transfer block size in bytes |
| |
43 block_size: 8192 |
| |
44 |
| |
45 #: Add the MS-Author-Via Response Header to OPTIONS command to allow editing |
| |
46 #: with Microsoft Office (default: true) |
| |
47 add_header_MS_Author_Via: true |
| |
48 |
| |
49 hotfixes: |
| |
50 #: Handle Microsoft's Win32LastModifiedTime property. |
| |
51 #: This is useful only in the case when you copy files from a Windows |
| |
52 #: client into a WebDAV share. Windows sends the "last modified" time of |
| |
53 #: the file in a Microsoft extended property called "Win32LastModifiedTime" |
| |
54 #: instead of the standard WebDAV property "getlastmodified". So without |
| |
55 #: this config option set to "True", the "last modified" time of the copied |
| |
56 #: file will be "now" instead of its original value. |
| |
57 #: The proper solution for dealing with the Windows WebDAV client is to use |
| |
58 #: a persistent property manager. This setting is merely a work-around. |
| |
59 #: NOTE: Works with Win10, can't work with Win7. Other versions untested. |
| |
60 emulate_win32_lastmod: false |
| |
61 #: Re-encode PATH_INFO using UTF-8 (falling back to ISO-8859-1). |
| |
62 #: This seems to be wrong, since per PEP 3333 PATH_INFO is always ISO-8859-1 |
| |
63 #: encoded (see https://www.python.org/dev/peps/pep-3333/#unicode-issues). |
| |
64 #: However it also seems to resolve errors when accessing resources with |
| |
65 #: Chinese characters, for example (see issue #73). |
| |
66 re_encode_path_info: true |
| |
67 #: Force unquoting of PATH_INFO. This should already be done by the WSGI |
| |
68 #: Framework, so this setting should only be used to fix unexpected problems |
| |
69 #: there (false fixes issue #8, true fixes issue #228). |
| |
70 unquote_path_info: false |
| |
71 #: Hotfix for WinXP / Vista: accept 'OPTIONS /' for a 'OPTIONS *' |
| |
72 #: (default: false) |
| |
73 treat_root_options_as_asterisk: false |
| |
74 |
| |
75 |
| |
76 # ---------------------------------------------------------------------------- |
| |
77 # SSL Support |
| |
78 |
| |
79 #: The certificate should match the servers hostname, so the bogus certs will |
| |
80 #: not work in all scenarios. |
| |
81 #: (Paths can be absolute or relative to this config file.) |
| |
82 |
| |
83 # ssl_certificate: 'wsgidav/server/sample_bogo_server.crt' |
| |
84 # ssl_private_key: 'wsgidav/server/sample_bogo_server.key' |
| |
85 # ssl_certificate_chain: null |
| |
86 |
| |
87 #: Cheroot server supports 'builtin' and 'pyopenssl' (default: 'builtin') |
| |
88 # ssl_adapter: 'pyopenssl' |
| |
89 |
| |
90 # ---------------------------------------------------------------------------- |
| |
91 |
| |
92 #: Modify to customize the WSGI application stack. |
| |
93 #: See here for an example how to add custom middlewares: |
| |
94 #: https://wsgidav.readthedocs.io/en/latest/user_guide_configure.html#middleware-stack |
| |
95 middleware_stack: |
| |
96 - wsgidav.mw.cors.Cors |
| |
97 # - wsgidav.mw.debug_filter.WsgiDavDebugFilter |
| |
98 - wsgidav.error_printer.ErrorPrinter |
| |
99 - wsgidav.http_authenticator.HTTPAuthenticator |
| |
100 # - wsgidav.mw.impersonator.Impersonator |
| |
101 - wsgidav.dir_browser.WsgiDavDirBrowser |
| |
102 - wsgidav.request_resolver.RequestResolver # this must be the last middleware item |
| |
103 |
| |
104 # ============================================================================== |
| |
105 # SHARES |
| |
106 |
| |
107 #: Application root, applied before provider mapping shares, e.g. |
| |
108 #: <mount_path>/<share_name>/<res_path> |
| |
109 #: Set this to the mount point (aka location) when WsgiDAV is running behind a |
| |
110 #: reverse proxy. |
| |
111 #: If set, the mount path must have a leading (but not trailing) slash. |
| |
112 mount_path: null |
| |
113 |
| |
114 #: Route share paths to DAVProvider instances |
| |
115 #: By default a writable `FilesystemProvider` is assumed, but can be forced |
| |
116 #: to read-only. |
| |
117 #: Note that a DomainController may still restrict access completely or prevent |
| |
118 #: editing depending on authentication. |
| |
119 #: |
| |
120 #: The following syntax variants are supported to use FilesystemProvider: |
| |
121 #: <share_path>: <folder_path> |
| |
122 #: or |
| |
123 #: <share_path>: { 'root': <folder_path>, 'readonly': <bool> } |
| |
124 #: |
| |
125 #: or instantiate an arbitrary custom class: |
| |
126 #: |
| |
127 #: <share_path>: { 'class': <class_path>, args: [<arg>, ...], kwargs: {<arg>: <val>, ...} } |
| |
128 |
| |
129 provider_mapping: |
| |
130 '/': 'testrepo' |
| |
131 |
| |
132 #: Additional configuration passed to `FilesystemProvider(..., fs_opts)` |
| |
133 fs_dav_provider: |
| |
134 #: Mapping from request URL to physical file location, e.g. |
| |
135 #: make sure that a `/favicon.ico` URL is resolved, even if a `*.html` |
| |
136 #: or `*.txt` resource file was opened using the DirBrowser |
| |
137 # shadow_map: |
| |
138 # '/favicon.ico': 'file_path/to/favicon.ico' |
| |
139 |
| |
140 #: Serve symbolic link files and folders (default: false) |
| |
141 follow_symlinks: false |
| |
142 |
| |
143 # ============================================================================== |
| |
144 # AUTHENTICATION |
| |
145 http_authenticator: |
| |
146 #: Allow basic authentication |
| |
147 accept_basic: true |
| |
148 #: Allow digest authentication |
| |
149 accept_digest: true |
| |
150 #: true (default digest) or false (default basic) |
| |
151 default_to_digest: true |
| |
152 #: Header field that will be accepted as authorized user. |
| |
153 #: Including quotes, for example: trusted_auth_header = 'REMOTE_USER' |
| |
154 trusted_auth_header: null |
| |
155 #: Domain controller that is used to resolve realms and authorization. |
| |
156 #: Default null: which uses SimpleDomainController and the |
| |
157 #: `simple_dc.user_mapping` option below. |
| |
158 #: (See http://wsgidav.readthedocs.io/en/latest/user_guide_configure.html |
| |
159 #: for details.) |
| |
160 domain_controller: null |
| |
161 # domain_controller: wsgidav.dc.simple_dc.SimpleDomainController |
| |
162 # domain_controller: wsgidav.dc.pam_dc.PAMDomainController |
| |
163 # domain_controller: wsgidav.dc.nt_dc.NTDomainController |
| |
164 |
| |
165 |
| |
166 # Additional options for SimpleDomainController only: |
| |
167 simple_dc: |
| |
168 # Access control per share. |
| |
169 # These routes must match the provider mapping. |
| |
170 # NOTE: Provider routes without a matching entry here, are inaccessible. |
| |
171 user_mapping: |
| |
172 '*': # default (used for all shares that are not explicitly listed) |
| |
173 'dav': |
| |
174 password: 'testdavutils' |
| |
175 # Optional: passed to downstream middleware as environ["wsgidav.auth.roles"] |
| |
176 # roles: ['editor'] |
| |
177 |
| |
178 # Additional options for NTDomainController only: |
| |
179 nt_dc: |
| |
180 preset_domain: null |
| |
181 preset_server: null |
| |
182 |
| |
183 # Additional options for PAMDomainController only: |
| |
184 pam_dc: |
| |
185 service: 'login' |
| |
186 encoding: 'utf-8' |
| |
187 resetcreds: true |
| |
188 |
| |
189 |
| |
190 # ---------------------------------------------------------------------------- |
| |
191 # User/Group Impersonating |
| |
192 # (Requires `wsgidav.mw.impersonator.Impersonator`, which is disabled by default.) |
| |
193 impersonator: |
| |
194 # enabling impersonating |
| |
195 enable: false |
| |
196 |
| |
197 # custom map WebDAV (HTTP) usernames to Unix usernames |
| |
198 # custom_user_mapping: |
| |
199 # leonlee: leo |
| |
200 # jenifer: jenny |
| |
201 |
| |
202 # or, use WebDAV (HTTP) usernames as is |
| |
203 custom_user_mapping: null |
| |
204 |
| |
205 |
| |
206 # ---------------------------------------------------------------------------- |
| |
207 # CORS |
| |
208 # (Requires `wsgidav.mw.cors.Cors`, which is enabled by default.) |
| |
209 cors: |
| |
210 #: List of allowed Origins or '*' |
| |
211 #: Default: false, i.e. prevent CORS |
| |
212 allow_origin: null |
| |
213 # allow_origin: '*' |
| |
214 # allow_origin: |
| |
215 # - 'https://example.com' |
| |
216 # - 'https://localhost:8081' |
| |
217 |
| |
218 #: List or comma-separated string of allowed methods (returned as |
| |
219 #: response to preflight request) |
| |
220 allow_methods: |
| |
221 # allow_methods: POST,HEAD |
| |
222 #: List or comma-separated string of allowed header names (returned as |
| |
223 #: response to preflight request) |
| |
224 allow_headers: |
| |
225 # - X-PINGOTHER |
| |
226 #: List or comma-separated string of allowed headers that JavaScript in |
| |
227 #: browsers is allowed to access. |
| |
228 expose_headers: |
| |
229 #: Set to true to allow responses on requests with credentials flag set |
| |
230 allow_credentials: false |
| |
231 #: Time in seconds for how long the response to the preflight request can |
| |
232 #: be cached (default: 5) |
| |
233 max_age: 600 |
| |
234 #: Add custom response headers (dict of header-name -> header-value items) |
| |
235 #: (This is not related to CORS or required to implement CORS functionality) |
| |
236 add_always: |
| |
237 # 'X-Foo-Header: 'qux' |
| |
238 |
| |
239 # ---------------------------------------------------------------------------- |
| |
240 # Property Manager |
| |
241 # null: (default) no support for dead properties |
| |
242 # true: Use wsgidav.prop_man.property_manager.PropertyManager |
| |
243 # which is an in-memory property manager (NOT persistent) |
| |
244 # |
| |
245 # Example: Use persistent shelve based property manager |
| |
246 # property_manager: |
| |
247 # class: wsgidav.prop_man.property_manager.ShelvePropertyManager |
| |
248 # kwargs: |
| |
249 # storage_path: 'wsgidav-props.shelve' |
| |
250 |
| |
251 property_manager: null |
| |
252 |
| |
253 #: Optional additional live property modification |
| |
254 #: Note: by default live properties like file size and last-modified time are |
| |
255 #: read-only, but that can be overridden here if the underlying DAV provider |
| |
256 #: supports it. For now only the FileSystemProvider supports it and only namely |
| |
257 #: changes to the last-modified timestamp. Enable it with the mutable_live_props |
| |
258 #: list as below to allow clients to use the utime system call or e.g. the |
| |
259 #: touch or cp / rsync commands with the preserve-timestamp flags on a mounted |
| |
260 #: DAV share. |
| |
261 #: Please note that the timestamp is set on the actual file or directory, so it |
| |
262 #: is persistent even for in-memory property managers. It should also be noted |
| |
263 #: that mutable last-modified may not be compliant with the RFC 4918. |
| |
264 mutable_live_props: |
| |
265 # Enable to allow clients to use e.g. the touch or cp / rsync commands with the |
| |
266 # preserve-timestamp flags in a mounted DAV share (may be RFC4918 incompliant) |
| |
267 - '{DAV:}getlastmodified' |
| |
268 |
| |
269 |
| |
270 # ---------------------------------------------------------------------------- |
| |
271 # Lock Manager Storage |
| |
272 # |
| |
273 # null: No lock support |
| |
274 # true: (default) shortcut for |
| |
275 # lock_storage: wsgidav.lock_man.lock_storage.LockStorageDict |
| |
276 # |
| |
277 # Note that the default LockStorageDict works in-memory, so it is |
| |
278 # NOT persistent. |
| |
279 # |
| |
280 # Example: Use persistent shelve based lock storage: |
| |
281 # lock_storage: |
| |
282 # class: wsgidav.lock_man.lock_storage.LockStorageShelve |
| |
283 # kwargs: |
| |
284 # storage_path: /path/to/wsgidav_locks.shelve |
| |
285 # |
| |
286 # Check the documentation on how to develop custom lock storage. |
| |
287 |
| |
288 lock_storage: true |
| |
289 |
| |
290 |
| |
291 # ============================================================================== |
| |
292 # DEBUGGING |
| |
293 |
| |
294 #: Set verbosity level (can be overridden by -v or -q arguments) |
| |
295 verbose: 3 |
| |
296 |
| |
297 #: Suppress version info in HTTP response headers and error responses |
| |
298 suppress_version_info: false |
| |
299 |
| |
300 logging: |
| |
301 #: Enable logging when using wsgidav in library mode (always on, when running as CLI) |
| |
302 enable: null |
| |
303 #: Set logging output format |
| |
304 #: (see https://docs.python.org/3/library/logging.html#logging.Formatter) |
| |
305 logger_date_format: '%H:%M:%S' |
| |
306 logger_format: '%(asctime)s.%(msecs)03d - %(levelname)-8s: %(message)s' |
| |
307 # Example: Add date,thread id, and logger name: |
| |
308 # logger_date_format: '%Y-%m-%d %H:%M:%S' |
| |
309 # logger_format: '%(asctime)s.%(msecs)03d - <%(thread)05d> %(name)-27s %(levelname)-8s: %(message)s' |
| |
310 |
| |
311 #: Enable specific module loggers |
| |
312 #: E.g. ['lock_manager', 'property_manager', 'http_authenticator', ...] |
| |
313 # enable_loggers: ['http_authenticator', ] |
| |
314 |
| |
315 # Enable max. logging for certain http methods |
| |
316 # E.g. ['COPY', 'DELETE', 'GET', 'HEAD', 'LOCK', 'MOVE', 'OPTIONS', 'PROPFIND', 'PROPPATCH', 'PUT', 'UNLOCK'] |
| |
317 debug_methods: [] |
| |
318 |
| |
319 # Enable max. logging during litmus suite tests that contain certain strings |
| |
320 # E.g. ['lock_excl', 'notowner_modify', 'fail_cond_put_unlocked', ...] |
| |
321 debug_litmus: [] |
| |
322 |
| |
323 |
| |
324 # ---------------------------------------------------------------------------- |
| |
325 # WsgiDavDirBrowser |
| |
326 |
| |
327 dir_browser: |
| |
328 enable: true |
| |
329 #: List of fnmatch patterns that will be hidden in the directory listing |
| |
330 ignore: |
| |
331 - '.DS_Store' # macOS folder meta data |
| |
332 - 'Thumbs.db' # Windows image previews |
| |
333 - '._*' # macOS hidden data files |
| |
334 #: Add a trailing slash to directory URLs (by generating a 301 redirect) |
| |
335 directory_slash: true |
| |
336 #: Display WsgiDAV icon in header |
| |
337 icon: true |
| |
338 #: Raw HTML code, appended as footer (true: use a default trailer) |
| |
339 response_trailer: true |
| |
340 #: Display the name and realm of the authenticated user (or 'anomymous') |
| |
341 show_user: true |
| |
342 show_logout: true |
| |
343 #: Send <dm:mount> response if request URL contains '?davmount' |
| |
344 #: (See https://tools.ietf.org/html/rfc4709) |
| |
345 davmount: true |
| |
346 #: Add a 'Mount' link at the top of the listing |
| |
347 davmount_links: false |
| |
348 #: Invoke MS Office documents for editing using WebDAV by adding a JavaScript |
| |
349 #: click handler. |
| |
350 #: - For IE 11 and below invokes the SharePoint ActiveXObject("SharePoint.OpenDocuments") |
| |
351 #: - If the custom legacy Firefox plugin is available, it will be used |
| |
352 #: https://docs.microsoft.com/en-us/previous-versions/office/developer/sharepoint-2010/ff407576(v%3Doffice.14) |
| |
353 #: - Otherwise the Office URL prefix is used (e.g. 'ms-word:ofe|u|http://server/path/file.docx') |
| |
354 ms_sharepoint_support: true |
| |
355 #: Invoke Libre Office documents for editing using WebDAV |
| |
356 libre_office_support: true |
| |
357 #: The path to the directory that contains template.html and associated |
| |
358 #: assets. |
| |
359 #: The default is the htdocs directory within the dir_browser directory. |
| |
360 htdocs_path: null |