Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
Textgrid Repository WebDAV Server
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
DARIAH-DE
TextGridRep
Textgrid Repository WebDAV Server
Commits
4fca5087
Verified
Commit
4fca5087
authored
3 years ago
by
Stefan Hynek
Browse files
Options
Downloads
Patches
Plain Diff
feat(main.py): initialize and launch the wsgi server process
parent
86859a07
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/main.py
+52
-0
52 additions, 0 deletions
src/main.py
with
52 additions
and
0 deletions
src/main.py
0 → 100644
+
52
−
0
View file @
4fca5087
import
logging
import
os
from
cheroot
import
wsgi
from
wsgidav.wsgidav_app
import
WsgiDAVApp
logging
.
basicConfig
(
level
=
logging
.
DEBUG
,
format
=
'
%(name)s %(levelname)s %(asctime)s %(message)s
'
)
_logger
=
logging
.
getLogger
(
__name__
)
_logger
.
propagate
=
True
# configure the "wsgidav" named logger
tmp_logger
=
logging
.
getLogger
(
"
wsgidav
"
)
tmp_logger
.
propagate
=
True
tmp_logger
.
setLevel
(
logging
.
DEBUG
)
# Configuration of the WsgiDAVApp.
# https://wsgidav.readthedocs.io/en/latest/user_guide_configure.html
config
=
{
"
host
"
:
os
.
getenv
(
"
host
"
),
"
port
"
:
int
(
os
.
getenv
(
"
port
"
)),
"
provider_mapping
"
:
{
"
/
"
:
{
"
provider
"
:
"
repdav.textgrid_dav_provider.TextgridResourceProvider
"
},
},
"
verbose
"
:
1
,
"
simple_dc
"
:
{
"
user_mapping
"
:
{
"
*
"
:
{
"
user
"
:
{
"
password
"
:
"
pass
"
}}
}
},
"
http_authenticator
"
:
{
"
domain_controller
"
:
"
repdav.textgrid_domain_controller.TextgridDC
"
,
"
accept_basic
"
:
True
,
# Allow basic authentication, True or False
"
accept_digest
"
:
False
,
# Allow digest authentication, True or False
# True (default digest) or False (default basic)
"
default_to_digest
"
:
False
,
# Name of a header field that will be accepted as authorized user
"
trusted_auth_header
"
:
None
,
}
}
app
=
WsgiDAVApp
(
config
)
server_args
=
{
"
bind_addr
"
:
(
config
[
"
host
"
],
config
[
"
port
"
]),
"
wsgi_app
"
:
app
,
}
server
=
wsgi
.
Server
(
**
server_args
)
server
.
start
()
This diff is collapsed.
Click to expand it.
Stefan Hynek
@hynek
mentioned in commit
eab3502a
·
3 years ago
mentioned in commit
eab3502a
mentioned in commit eab3502a1317d3865691e0d79c2f72e0ccd8e341
Toggle commit list
Stefan Hynek
@hynek
mentioned in commit
61644a05
·
3 years ago
mentioned in commit
61644a05
mentioned in commit 61644a0511ab3ae6a939d6d3d42107c87ed6072c
Toggle commit list
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment