Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/mar10/wsgidav
Browse files Browse the repository at this point in the history
  • Loading branch information
mar10 committed Jun 2, 2018
1 parent 967175c commit bd01fc1
Show file tree
Hide file tree
Showing 10 changed files with 55 additions and 52 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ This release contains **BREAKING CHANGES!**
- MSI setup uses Python 3.6


## 2.4.0 / Unreleased
## 2.4.0 / 2018-05-30

- Improve configuration files:
- YAML is now the preferred configuration file format.
Expand Down
11 changes: 5 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# ![logo](doc/logo.png?raw=true) WsgiDAV
# ![logo](https://raw.githubusercontent.com/mar10/wsgidav/master/doc/logo.png) WsgiDAV
[![Build Status](https://travis-ci.org/mar10/wsgidav.svg?branch=master)](https://travis-ci.org/mar10/wsgidav)
[![Latest Version](https://img.shields.io/pypi/v/wsgidav.svg)](https://pypi.python.org/pypi/WsgiDAV/)
[![License](https://img.shields.io/pypi/l/wsgidav.svg)](https://github.com/mar10/wsgidav/blob/master/LICENSE.txt)
[![License](https://img.shields.io/pypi/l/wsgidav.svg)](https://github.com/mar10/wsgidav/blob/master/LICENSE)
[![Documentation Status](https://readthedocs.org/projects/wsgidav/badge/?version=latest)](http://wsgidav.readthedocs.io/)

A generic and extendable [WebDAV](http://www.ietf.org/rfc/rfc4918.txt) server
Expand Down Expand Up @@ -37,11 +37,10 @@ Main features:
## Status
[![Latest Version](https://img.shields.io/pypi/v/wsgidav.svg)](https://pypi.python.org/pypi/WsgiDAV/)
See the ([change log](CHANGELOG.md)) for details.
**Note 2016-10-08:** Release 2.0.1 includes a security patch that prevents certain XML
attacks (thanks Tom Viner). We highly recommend to update!
See the ([change log](https://github.com/mar10/wsgidav/blob/master/CHANGELOG.md)) for details.
**Note:** Release 3.0 is pretty new and introduces some refactorings and breaking changes.<br>
Wimps may prefer using 2.x for a more stable release ;-)
## More info
Expand Down
9 changes: 8 additions & 1 deletion doc/sphinx/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,15 @@
# 'sphinx_automodapi.automodapi',
]

# Included at the beginning of every file:
rst_prolog = """
.. important ::
You are looking at the documentation for the pre-release 3.x with breaking changes. |br|
The current `stable version is 2.x </en/stable/>`_.
"""
# A string of reStructuredText that will be included at the end of every source file that is read.
# This is the right place to add substitutions that should be available in every file. An example:
# This is the right place to add substitutions that should be available in every file:
rst_epilog = """
.. |br| raw:: html
Expand Down
6 changes: 6 additions & 0 deletions doc/sphinx/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,12 @@ Main Features
written by Ho Chun Wei.


.. note::

Release 3.0 is pretty new and introduces some refactorings and breaking changes. |br|
Wimps may prefer using 2.x for a more stable release ;-)


Quickstart
==========

Expand Down
27 changes: 0 additions & 27 deletions readme_pypi.rst

This file was deleted.

6 changes: 4 additions & 2 deletions sample_wsgidav.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ user_mapping:
# Set verbosity level (but will be overridden by -v or -q arguments)
verbose: 3

logger_format: "%(asctime)s.%(msecs)03d - (%(thread)d) %(name)-27s %(levelname)-8s: %(message)s"
logger_format: "%(asctime)s.%(msecs)03d - <%(thread)d)> %(name)-27s %(levelname)-8s: %(message)s"
logger_date_format: "%H:%M:%S"
catch_all: false
Expand All @@ -135,7 +135,9 @@ dir_browser:
- ".DS_Store" # macOS folder meta data
- "Thumbs.db" # Windows image previews
- "._*" # macOS hidden data files
response_trailer: null # Raw HTML code, appended as footer
icon: true # Display WsgiDAV icon in header
response_trailer: true # Raw HTML code, appended as footer
show_user: true
davmount: false # Send <dm:mount> response if request URL contains '?davmount'
ms_mount: false # Invoke MS Offce documents for editing using WebDAV
ms_sharepoint_plugin: true # Invoke MS Offce documents for editing using WebDAV
Expand Down
10 changes: 6 additions & 4 deletions wsgidav/addons/dir_browser/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

_logger = util.get_module_logger(__name__)

ASSET_SHARE = "/_dir_browser"
ASSET_SHARE = "/:dir_browser"

DAVMOUNT_TEMPLATE = """
<dm:mount xmlns:dm="http://purl.org/NET/webdav/mount">
Expand Down Expand Up @@ -125,15 +125,17 @@ def _get_context(self, environ, davres):
"config": dirConfig,
"is_readonly": isReadOnly,
}

trailer = dirConfig.get("response_trailer")
if trailer is True:
trailer = "${version} - ${time}"

if trailer:
trailer = trailer.replace(
"${version}",
"<a href='https://github.com/mar10/wsgidav/'>WsgiDAV/{}</a>".format(__version__))
trailer = trailer.replace("${time}", util.get_rfc1123_time())
else:
trailer = ("<a href='https://github.com/mar10/wsgidav/'>WsgiDAV/{}</a> - {}"
.format(__version__, util.get_rfc1123_time()))

context["trailer"] = trailer

rows = context["rows"]
Expand Down
4 changes: 4 additions & 0 deletions wsgidav/addons/dir_browser/htdocs/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,10 @@ table.dir-listing td:nth-child(3)
a.symlink {
font-style: italic;
}
p.auth-user {
font-size: smaller;
text-align: right;
}
p.trailer {
font-size: smaller;
}
28 changes: 18 additions & 10 deletions wsgidav/addons/dir_browser/htdocs/template.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,22 +13,29 @@
<body onload="onLoad()">

<h1>
<img class="logo" alt="WsgiDAV" src="{{ htdocs }}/logo.png">
{%- if config.icon %}
<img class="logo" alt="WsgiDAV" title="WsgiDAV" src="{{ htdocs }}/logo.png">
{% endif -%}
Index of {{ displaypath }}
</h1>

{% if config.davmount or config.ms_mount %}
<p class="links">
{% if config.davmount %}
{%- if config.davmount %}
<a title="Open this folder in a WebDAV client." href="{{ url }}?davmount">Mount</a>
&#8211;
{% endif %}
{% if config.ms_mount %}
{% endif -%}
{%- if config.ms_mount %}
{% if config.davmount %} &#8211; {% endif %}
<a title="Open as Web Folder (requires Microsoft Internet Explorer)"
href="" folder="{{ url }}">Open as Web Folder</a>
{% endif %}
</p>
{% endif %}

{%- if username and config.show_user %}
<p class="auth-user">Authenticated user: "{{username}}", realm: "{{realm}}".</p>
{% endif -%}

<hr>

<table class="dir-listing" onclick="return onClickTable(event)">
Expand All @@ -39,6 +46,7 @@ <h1>
<col class="right">
<col class="right">
</colgroup>

<thead>
<tr>
<th>Name</th>
Expand All @@ -49,7 +57,7 @@ <h1>
</thead>

<tbody>
{% if parentUrl %}
{%- if parentUrl %}
<tr class="directory">
<td>
<a href="{{ parentUrl }}">..</a>
Expand All @@ -58,7 +66,7 @@ <h1>
<td>-</td>
<td></td>
</tr>
{% endif %}
{% endif -%}

{% for row in rows %}
<tr class="{{ row.class }}">
Expand All @@ -75,9 +83,9 @@ <h1>

<hr>

<p>Authenticated user: "{{username}}", realm: "{{realm}}".</p>

<p class="trailer">{{trailer}}</p>
{% if trailer %}
<p class="trailer">{{ trailer }}</p>
{% endif %}

<object id="winFirefoxPlugin" type="application/x-sharepoint"
width="0" height="0" style="visibility: hidden;"></object>
Expand Down
4 changes: 3 additions & 1 deletion wsgidav/default_conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,9 @@
"._*", # macOS hidden data files
"Thumbs.db", # Windows image previews
],
"response_trailer": "", # Raw HTML code, appended as footer
"icon": True,
"response_trailer": True, # Raw HTML code, appended as footer (True: use a default)
"show_user": True, # Show authenticated user an realm
# Send <dm:mount> response if request URL contains '?davmount'
"davmount": False,
# Add an 'open as webfolder' link (requires Windows clients):
Expand Down

0 comments on commit bd01fc1

Please sign in to comment.