From bd01fc1dbf48aea4fde16e44b3f53f7ee8f28183 Mon Sep 17 00:00:00 2001 From: Martin Wendt Date: Sat, 2 Jun 2018 08:26:47 +0200 Subject: [PATCH] Merge branch 'master' of https://github.com/mar10/wsgidav --- CHANGELOG.md | 2 +- README.md | 11 ++++---- doc/sphinx/conf.py | 9 +++++- doc/sphinx/index.rst | 6 ++++ readme_pypi.rst | 27 ------------------ sample_wsgidav.yaml | 6 ++-- wsgidav/addons/dir_browser/__init__.py | 10 ++++--- wsgidav/addons/dir_browser/htdocs/style.css | 4 +++ .../addons/dir_browser/htdocs/template.html | 28 ++++++++++++------- wsgidav/default_conf.py | 4 ++- 10 files changed, 55 insertions(+), 52 deletions(-) delete mode 100644 readme_pypi.rst diff --git a/CHANGELOG.md b/CHANGELOG.md index 0c26cb38..4d31a7bd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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. diff --git a/README.md b/README.md index 6ed956fa..69b971c1 100644 --- a/README.md +++ b/README.md @@ -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 @@ -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.
+Wimps may prefer using 2.x for a more stable release ;-) ## More info diff --git a/doc/sphinx/conf.py b/doc/sphinx/conf.py index cb8f4d25..227ab613 100644 --- a/doc/sphinx/conf.py +++ b/doc/sphinx/conf.py @@ -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 `_. +""" # 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 diff --git a/doc/sphinx/index.rst b/doc/sphinx/index.rst index b3dbd063..55751f73 100644 --- a/doc/sphinx/index.rst +++ b/doc/sphinx/index.rst @@ -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 ========== diff --git a/readme_pypi.rst b/readme_pypi.rst deleted file mode 100644 index fa09b221..00000000 --- a/readme_pypi.rst +++ /dev/null @@ -1,27 +0,0 @@ -Copyright (c) 2009-2018 Martin Wendt, - -Status ------- -* Production / stable - - -Summary -------- -WsgiDAV is a WebDAV server for sharing files and other resources over the web. - -- It is based on the WSGI interface . -- It comes bundled with a simple WSGI web server. - -*This package is based on PyFileServer (c) 2005 by Ho Chun Wei* - -Project home: https://github.com/mar10/wsgidav/ - -.. note:: - - Windows users may also use the MSI installer that is - `released on GitHub `_. - - -Changes -------- -See `CHANGES.md `_. diff --git a/sample_wsgidav.yaml b/sample_wsgidav.yaml index c84e27fe..02cce8cb 100644 --- a/sample_wsgidav.yaml +++ b/sample_wsgidav.yaml @@ -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 @@ -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 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 diff --git a/wsgidav/addons/dir_browser/__init__.py b/wsgidav/addons/dir_browser/__init__.py index eef9d438..acba023b 100644 --- a/wsgidav/addons/dir_browser/__init__.py +++ b/wsgidav/addons/dir_browser/__init__.py @@ -19,7 +19,7 @@ _logger = util.get_module_logger(__name__) -ASSET_SHARE = "/_dir_browser" +ASSET_SHARE = "/:dir_browser" DAVMOUNT_TEMPLATE = """ @@ -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}", "WsgiDAV/{}".format(__version__)) trailer = trailer.replace("${time}", util.get_rfc1123_time()) - else: - trailer = ("WsgiDAV/{} - {}" - .format(__version__, util.get_rfc1123_time())) + context["trailer"] = trailer rows = context["rows"] diff --git a/wsgidav/addons/dir_browser/htdocs/style.css b/wsgidav/addons/dir_browser/htdocs/style.css index 158428c9..8eea9f37 100644 --- a/wsgidav/addons/dir_browser/htdocs/style.css +++ b/wsgidav/addons/dir_browser/htdocs/style.css @@ -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; } diff --git a/wsgidav/addons/dir_browser/htdocs/template.html b/wsgidav/addons/dir_browser/htdocs/template.html index de3a14fc..890e85c2 100644 --- a/wsgidav/addons/dir_browser/htdocs/template.html +++ b/wsgidav/addons/dir_browser/htdocs/template.html @@ -13,22 +13,29 @@

- + {%- if config.icon %} + + {% endif -%} Index of {{ displaypath }}

{% if config.davmount or config.ms_mount %} {% endif %} + + {%- if username and config.show_user %} +

Authenticated user: "{{username}}", realm: "{{realm}}".

+ {% endif -%} +
@@ -39,6 +46,7 @@

+ @@ -49,7 +57,7 @@

- {% if parentUrl %} + {%- if parentUrl %} - {% endif %} + {% endif -%} {% for row in rows %} @@ -75,9 +83,9 @@


-

Authenticated user: "{{username}}", realm: "{{realm}}".

- -

{{trailer}}

+ {% if trailer %} +

{{ trailer }}

+ {% endif %} diff --git a/wsgidav/default_conf.py b/wsgidav/default_conf.py index cf3b16b3..0ba3db15 100644 --- a/wsgidav/default_conf.py +++ b/wsgidav/default_conf.py @@ -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 response if request URL contains '?davmount' "davmount": False, # Add an 'open as webfolder' link (requires Windows clients):

Name
.. @@ -58,7 +66,7 @@

-