|
@@ -0,0 +1,184 @@
|
|
1
|
+################################################################################
|
|
2
|
+# Sample WsgiDAV configuration file
|
|
3
|
+#
|
|
4
|
+# 1. Rename this file to `wsgidav.conf`
|
|
5
|
+# 2. Adjust settings as appropriate
|
|
6
|
+# 3. Run `wsgidav` fro, the same directory.
|
|
7
|
+#
|
|
8
|
+# See
|
|
9
|
+# doc/annotated_wsgidav.conf
|
|
10
|
+# for a complete, annotated configuration example.
|
|
11
|
+#
|
|
12
|
+################################################################################
|
|
13
|
+
|
|
14
|
+# HELPERS - Do not modify this section
|
|
15
|
+
|
|
16
|
+provider_mapping = {}
|
|
17
|
+user_mapping = {}
|
|
18
|
+
|
|
19
|
+def addShare(shareName, davProvider):
|
|
20
|
+ provider_mapping[shareName] = davProvider
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+def addUser(realmName, user, password, description, roles=[]):
|
|
24
|
+ realmName = "/" + realmName.strip(r"\/")
|
|
25
|
+ userDict = user_mapping.setdefault(realmName, {}).setdefault(user, {})
|
|
26
|
+ userDict["password"] = password
|
|
27
|
+ userDict["description"] = description
|
|
28
|
+ userDict["roles"] = roles
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+################################################################################
|
|
32
|
+# SERVER OPTIONS
|
|
33
|
+#===============================================================================
|
|
34
|
+
|
|
35
|
+# host = "localhost"
|
|
36
|
+# host = "192.168.0.1"
|
|
37
|
+host = "0.0.0.0"
|
|
38
|
+
|
|
39
|
+port = 8080
|
|
40
|
+
|
|
41
|
+#===============================================================================
|
|
42
|
+# Enable SSL support
|
|
43
|
+# (The certificate should match the servers hostname, so the bogus certs will not
|
|
44
|
+# work in all scenarios.)
|
|
45
|
+
|
|
46
|
+# ssl_certificate = "wsgidav/server/sample_bogo_server.crt"
|
|
47
|
+# ssl_private_key = "wsgidav/server/sample_bogo_server.key"
|
|
48
|
+# ssl_certificate_chain = None
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+# Add the MS-Author-Via Response Header to OPTIONS command to allow editing
|
|
52
|
+# with Microsoft Office (default: True)
|
|
53
|
+add_header_MS_Author_Via = True
|
|
54
|
+
|
|
55
|
+#================================================================================
|
|
56
|
+# Misc. setings
|
|
57
|
+#
|
|
58
|
+
|
|
59
|
+# Block size in bytes
|
|
60
|
+#block_size = 8192
|
|
61
|
+
|
|
62
|
+#===============================================================================
|
|
63
|
+# Middlewares
|
|
64
|
+#
|
|
65
|
+# Use this section to modify the default middleware stack
|
|
66
|
+
|
|
67
|
+#from wsgidav.dir_browser import WsgiDavDirBrowser
|
|
68
|
+#from debug_filter import WsgiDavDebugFilter
|
|
69
|
+#from http_authenticator import HTTPAuthenticator
|
|
70
|
+#from error_printer import ErrorPrinter
|
|
71
|
+#middleware_stack = [ WsgiDavDirBrowser, HTTPAuthenticator, ErrorPrinter, WsgiDavDebugFilter ]
|
|
72
|
+
|
|
73
|
+#===============================================================================
|
|
74
|
+# Debugging
|
|
75
|
+
|
|
76
|
+# verbose = 3
|
|
77
|
+
|
|
78
|
+# Enable specific module loggers
|
|
79
|
+# E.g. ["lock_manager", "property_manager", "http_authenticator", ...]
|
|
80
|
+# enable_loggers = ["http_authenticator", ]
|
|
81
|
+
|
|
82
|
+# Enable max. logging for certain http methods
|
|
83
|
+# E.g. ["COPY", "DELETE", "GET", "HEAD", "LOCK", "MOVE", "OPTIONS", "PROPFIND", "PROPPATCH", "PUT", "UNLOCK"]
|
|
84
|
+debug_methods = []
|
|
85
|
+
|
|
86
|
+# Enable max. logging during litmus suite tests that contain certain strings
|
|
87
|
+# E.g. ["lock_excl", "notowner_modify", "fail_cond_put_unlocked", ...]
|
|
88
|
+debug_litmus = []
|
|
89
|
+
|
|
90
|
+
|
|
91
|
+################################################################################
|
|
92
|
+# WsgiDavDirBrowser
|
|
93
|
+
|
|
94
|
+dir_browser = {
|
|
95
|
+ "enable": True, # Render HTML listing for GET requests on collections
|
|
96
|
+ "response_trailer": "", # Raw HTML code, appended as footer
|
|
97
|
+ "davmount": True, # Send <dm:mount> response if request URL contains '?davmount'
|
|
98
|
+ "ms_mount": True, # Add an 'open as webfolder' link (requires Windows)
|
|
99
|
+ "ms_sharepoint_plugin": True, # Invoke MS Offce documents for editing using WebDAV
|
|
100
|
+ "ms_sharepoint_urls": False, # Prepend 'ms-word:ofe|u|' to URL for MS Offce documents
|
|
101
|
+}
|
|
102
|
+
|
|
103
|
+
|
|
104
|
+################################################################################
|
|
105
|
+# DAV Provider
|
|
106
|
+
|
|
107
|
+#===============================================================================
|
|
108
|
+# Property Manager
|
|
109
|
+
|
|
110
|
+# Example: Use PERSISTENT shelve based property manager
|
|
111
|
+#from wsgidav.property_manager import ShelvePropertyManager
|
|
112
|
+#propsmanager = ShelvePropertyManager("wsgidav-props.shelve")
|
|
113
|
+
|
|
114
|
+### Use in-memory property manager (NOT persistent)
|
|
115
|
+propsmanager = True
|
|
116
|
+
|
|
117
|
+
|
|
118
|
+### Optional additional live property modification
|
|
119
|
+# Enable to allow clients to use e.g. the touch or cp / rsync commands with the
|
|
120
|
+# preserve-timestamp flags in a mounted DAV share (may be RFC4918 incompliant)
|
|
121
|
+#mutable_live_props = ["{DAV:}getlastmodified"]
|
|
122
|
+
|
|
123
|
+
|
|
124
|
+#===============================================================================
|
|
125
|
+# Lock Manager
|
|
126
|
+#
|
|
127
|
+# Example: Use PERSISTENT shelve based lock manager
|
|
128
|
+#from wsgidav.lock_storage import LockStorageShelve
|
|
129
|
+#locksmanager = LockStorageShelve("wsgidav-locks.shelve")
|
|
130
|
+
|
|
131
|
+
|
|
132
|
+#===============================================================================
|
|
133
|
+# SHARES
|
|
134
|
+
|
|
135
|
+addShare("", r"~/davshare")
|
|
136
|
+
|
|
137
|
+
|
|
138
|
+################################################################################
|
|
139
|
+# AUTHENTICATION
|
|
140
|
+#===============================================================================
|
|
141
|
+# HTTP Authentication Options
|
|
142
|
+
|
|
143
|
+acceptbasic = True # Allow basic authentication, True or False
|
|
144
|
+acceptdigest = True # Allow digest authentication, True or False
|
|
145
|
+defaultdigest = True # True (default digest) or False (default basic)
|
|
146
|
+
|
|
147
|
+
|
|
148
|
+#domaincontroller = # Uncomment this line to specify your own domain controller
|
|
149
|
+ # Default: wsgidav.domain_controller, which uses the USERS
|
|
150
|
+ # section below
|
|
151
|
+
|
|
152
|
+
|
|
153
|
+# Example: use a domain controller that allows users to authenticate against
|
|
154
|
+# a Windows NT domain or a local computer.
|
|
155
|
+# Note: NTDomainController requires basic authentication:
|
|
156
|
+# Set acceptbasic=True, acceptdigest=False, defaultdigest=False
|
|
157
|
+
|
|
158
|
+# from wsgidav.addons.nt_domain_controller import NTDomainController
|
|
159
|
+# domaincontroller = NTDomainController(presetdomain=None, presetserver=None)
|
|
160
|
+# acceptbasic = True
|
|
161
|
+# acceptdigest = False
|
|
162
|
+# defaultdigest = False
|
|
163
|
+
|
|
164
|
+
|
|
165
|
+#===============================================================================
|
|
166
|
+# USERS
|
|
167
|
+#
|
|
168
|
+# This section is ONLY used by the DEFAULT Domain Controller.
|
|
169
|
+#
|
|
170
|
+# Users are defined per realm:
|
|
171
|
+# addUser(<realm>, <user>, <password>, <description>)
|
|
172
|
+#
|
|
173
|
+# Note that the default Domain Controller uses the share name as realm name.
|
|
174
|
+#
|
|
175
|
+# If no users are specified for a realm, no authentication is required.
|
|
176
|
+# Thus granting read-write access to anonymous!
|
|
177
|
+#
|
|
178
|
+# Note: If you wish to use Windows WebDAV support (such as Windows XP's My
|
|
179
|
+# Network Places), you need to include the domain of the user as part of the
|
|
180
|
+# username (note the DOUBLE slash), such as:
|
|
181
|
+# addUser("v_root", "domain\\user", "password", "description")
|
|
182
|
+
|
|
183
|
+addUser("", "tester", "secret", "")
|
|
184
|
+#addUser("", "tester2", "secret2", "")
|