Skip to content

Commit

Permalink
Domain controller (#127)
Browse files Browse the repository at this point in the history
* SimpleDomainController

* tried to add NT-DC to MSI

* Hotfix for broken Jinja2 import in MSI installer

See marcelotduarte/cx_Freeze#418

* Add pywin32 to MSI installer

* Move dir_browser from addons to own package

* Move some modules around
  • Loading branch information
mar10 committed Sep 2, 2018
1 parent 296092a commit 4c5b425
Show file tree
Hide file tree
Showing 83 changed files with 411 additions and 886 deletions.
10 changes: 6 additions & 4 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,17 +23,19 @@ This release contains **BREAKING CHANGES!**
- Refactor code base:
- **Rename methods** according to PEP 8, e.g.
`provider.getResourceInst()` => `provider.get_resource_inst()`.
- **TODO:** **Rename methods arguments** according to PEP 8, e.g.
- **Rename methods arguments** according to PEP 8, e.g.
`provider.set_last_modified(self, destPath, timeStamp, dryRun)`
=> `provider.set_last_modified(self, dest_path, time_stamp, dry_run)`
- Enforce [Black code style](https://github.com/ambv/black)
- Use utf-8 directive in source files (-*- coding: utf-8 -*-)
- Refactor WsgiDirBrowser:
- Use Jinja2 and load static assets through own WsgiDAV provider
- Move to `addons.dir_browser` package
- Move to `wsgidav.dir_browser` package
- Option 'dir_browser.ms_sharepoint_support' replaces ms_sharepoint_plugin and ms_sharepoint_urls
- Automated [Docker builds](https://hub.docker.com/r/mar10/wsgidav/)
- Option 'dir_browser.ms_sharepoint_support' replaces ms_sharepoint_plugin and ms_sharepoint_urls
- MSI setup uses Cheroot/6.4 Python 3.6
- MSI installer
- uses Cheroot/6.4 Python 3.6
- Includes NTDomainController
- #112: Added limited support for Microsoft's Win32LastModified property.
- Fix #123: HEAD request on DirBrowser folder

Expand Down
5 changes: 3 additions & 2 deletions Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ verify_ssl = true
name = "pypi"

[dev-packages]
black = "*"
black = "18.6b4"
Cheroot = "~=6.2"
flake8 = "~=3.5"
flake8-bugbear = "~=18.2"
Expand All @@ -17,7 +17,8 @@ pytest-cov = "~=1.8"
recommonmark = "*"
requests = "*"
rope = "*"
setuptools = "~=38.6"
setuptools = "~=40.2"
# setuptools = "~=38.6"
Sphinx = "~=1.6"
sphinx_rtd_theme = "*"
tox = "~=3.2"
Expand Down
592 changes: 0 additions & 592 deletions Pipfile.lock

This file was deleted.

18 changes: 9 additions & 9 deletions doc/annotated_wsgidav.conf
Original file line number Diff line number Diff line change
Expand Up @@ -162,29 +162,29 @@ dir_browser = {
#
# Uncomment this lines to specify your own property manager.
# Default: no support for dead properties
# Also available: wsgidav.property_manager.PropertyManager
# wsgidav.property_manager.ShelvePropertyManager
# Also available: wsgidav.prop_man.property_manager.PropertyManager
# wsgidav.prop_man.property_manager.ShelvePropertyManager
#
# Check the documentation on how to develop custom property managers.
# Note that the default PropertyManager works in-memory, and thus is NOT
# persistent.

### Use in-memory property manager (NOT persistent)
# (this is the same as passing 'property_manager = True')
#from wsgidav.property_manager import PropertyManager
#from wsgidav.prop_man.property_manager import PropertyManager
#property_manager = PropertyManager()

### Use persistent shelve based property manager
#from wsgidav.property_manager import ShelvePropertyManager
#from wsgidav.prop_man.property_manager import ShelvePropertyManager
#property_manager = ShelvePropertyManager("wsgidav-props.shelve")

### Use persistent MongoDB based property manager
#from wsgidav.addons.mongo_property_manager import MongoPropertyManager
#from wsgidav.prop_man.mongo_property_manager import MongoPropertyManager
#prop_man_opts = {}
#property_manager = MongoPropertyManager(prop_man_opts)

### Use persistent CouchDB based property manager
#from wsgidav.addons.couch_property_manager import CouchPropertyManager
#from wsgidav.prop_man.couch_property_manager import CouchPropertyManager
#prop_man_opts = {}
#property_manager = CouchPropertyManager(prop_man_opts)

Expand Down Expand Up @@ -274,7 +274,7 @@ addShare("dav", r"C:\temp")


### Publish an MySQL 'world' database as share '/world-db'
#from wsgidav.addons.mysql_dav_provider import MySQLBrowserProvider
#from wsgidav.samples.mysql_dav_provider import MySQLBrowserProvider
#addShare("world-db", MySQLBrowserProvider("localhost", "root", "test", "world"))


Expand All @@ -284,7 +284,7 @@ addShare("dav", r"C:\temp")


### Publish a Mercurial repository
#from wsgidav.addons.hg_dav_provider import HgResourceProvider
#from wsgidav.samples.hg_dav_provider import HgResourceProvider
#addShare("hg", HgResourceProvider("PATH_OR_URL"))


Expand Down Expand Up @@ -320,7 +320,7 @@ http_authenticator = {
# Note: NTDomainController requires basic authentication:
# Set accept_basic=True, accept_digest=False, default_to_digest=False

#from wsgidav.addons.nt_domain_controller import NTDomainController
#from wsgidav.dc.nt_domain_controller import NTDomainController
#domain_controller = NTDomainController(presetdomain=None, presetserver=None)
#accept_basic = True
#accept_digest = False
Expand Down
18 changes: 9 additions & 9 deletions doc/sample_wsgidav.conf
Original file line number Diff line number Diff line change
Expand Up @@ -163,29 +163,29 @@ dir_browser = {
#
# Uncomment this lines to specify your own property manager.
# Default: no support for dead properties
# Also available: wsgidav.property_manager.PropertyManager
# wsgidav.property_manager.ShelvePropertyManager
# Also available: wsgidav.prop_man.property_manager.PropertyManager
# wsgidav.prop_man.property_manager.ShelvePropertyManager
#
# Check the documentation on how to develop custom property managers.
# Note that the default PropertyManager works in-memory, and thus is NOT
# persistent.

### Use in-memory property manager (NOT persistent)
# (this is the same as passing 'property_manager = True')
#from wsgidav.property_manager import PropertyManager
#from wsgidav.prop_man.property_manager import PropertyManager
#property_manager = PropertyManager()

### Use persistent shelve based property manager
#from wsgidav.property_manager import ShelvePropertyManager
#from wsgidav.prop_man.property_manager import ShelvePropertyManager
#property_manager = ShelvePropertyManager("wsgidav-props.shelve")

### Use persistent MongoDB based property manager
#from wsgidav.addons.mongo_property_manager import MongoPropertyManager
#from wsgidav.prop_man.mongo_property_manager import MongoPropertyManager
#prop_man_opts = {}
#property_manager = MongoPropertyManager(prop_man_opts)

### Use persistent CouchDB based property manager
#from wsgidav.addons.couch_property_manager import CouchPropertyManager
#from wsgidav.prop_man.couch_property_manager import CouchPropertyManager
#prop_man_opts = {}
#property_manager = CouchPropertyManager(prop_man_opts)

Expand Down Expand Up @@ -276,7 +276,7 @@ addShare("dav", r"C:\temp")


### Publish an MySQL 'world' database as share '/world-db'
#from wsgidav.addons.mysql_dav_provider import MySQLBrowserProvider
#from wsgidav.samples.mysql_dav_provider import MySQLBrowserProvider
#addShare("world-db", MySQLBrowserProvider("localhost", "root", "test", "world"))


Expand All @@ -286,7 +286,7 @@ addShare("dav", r"C:\temp")


### Publish a Mercurial repository
#from wsgidav.addons.hg_dav_provider import HgResourceProvider
#from wsgidav.samples.hg_dav_provider import HgResourceProvider
#addShare("hg", HgResourceProvider("PATH_OR_URL"))


Expand Down Expand Up @@ -322,7 +322,7 @@ http_authenticator = {
# Note: NTDomainController requires basic authentication:
# Set accept_basic=True, accept_digest=False, default_to_digest=False

#from wsgidav.addons.nt_domain_controller import NTDomainController
#from wsgidav.dc.nt_domain_controller import NTDomainController
#domain_controller = NTDomainController(presetdomain=None, presetserver=None)
#accept_basic = True
#accept_digest = False
Expand Down
4 changes: 2 additions & 2 deletions doc/sample_wsgidav.conf_OLD
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ dir_browser = {
# Property Manager

# Example: Use PERSISTENT shelve based property manager
#from wsgidav.property_manager import ShelvePropertyManager
#from wsgidav.prop_man.property_manager import ShelvePropertyManager
#property_manager = ShelvePropertyManager("wsgidav-props.shelve")

### Use in-memory property manager (NOT persistent)
Expand Down Expand Up @@ -172,7 +172,7 @@ trusted_auth_header = None
# Note: NTDomainController requires basic authentication:
# Set accept_basic=True, accept_digest=False, default_to_digest=False

# from wsgidav.addons.nt_domain_controller import NTDomainController
# from wsgidav.dc.nt_domain_controller import NTDomainController
# domain_controller = NTDomainController(presetdomain=None, presetserver=None)
# accept_basic = True
# accept_digest = False
Expand Down
2 changes: 1 addition & 1 deletion doc/sphinx/addons-couch-propman.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ CouchDB property manager

Module Description
------------------
.. automodule:: wsgidav.addons.couch_property_manager
.. automodule:: wsgidav.prop_man.couch_property_manager
30 changes: 15 additions & 15 deletions doc/sphinx/addons-mercurial.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,25 +3,25 @@ Mercurial WebDAV provider

Examples
--------
This screenshot shows how a Mercurial repository appears in Microsoft Windows
This screenshot shows how a Mercurial repository appears in Microsoft Windows
File Explorer:

.. image:: _static/img/Explorer_Mercurial.png

Some new live properties are available:

.. image:: _static/img/DAVExplorer_Mercurial.png


Usage
-----
.. note:: This is **not** production code.

To publish a Mercurial repository by the share name 'hg', simply add thes lines
To publish a Mercurial repository by the share name 'hg', simply add thes lines
to the configuration file::

# Publish a Mercurial repository
from wsgidav.addons.hg_dav_provider import HgResourceProvider
from wsgidav.samples.hg_dav_provider import HgResourceProvider
addShare("hg", HgResourceProvider("REPO_PATH_OR_URL"))


Expand All @@ -42,10 +42,10 @@ released:
This folder is read-only.
archive:
Contains the last 10 revisions as sub-folders.
This folder is read-only.
This folder is read-only.

Sample layout::

/<share>/
edit/
server/
Expand All @@ -66,10 +66,10 @@ Supported features:
result in a ``hg commit``.
Note that the destination path is ignored, instead the source path is used.
So a user can drag a file or folder from somewhere under the ``edit/..``
directory and drop it directly on the ``released`` directory to commit
changes.
#. To commit all changes, simply drag'n'drop the ``/edit`` folder on the
``/released`` folder.
directory and drop it directly on the ``released`` directory to commit
changes.
#. To commit all changes, simply drag'n'drop the ``/edit`` folder on the
``/released`` folder.
#. Creating new collections results in creation of a file called ``.directory``,
which is then ``hg add`` ed since Mercurial doesn't track directories.
#. Some attributes are published as live properties, such as ``{hg:}date``.
Expand All @@ -80,13 +80,13 @@ Known limitations:
#. This 'commit by drag-and-drop' only works, if the WebDAV clients produces
MOVE or COPY requests. Alas, some clients will send PUT, MKCOL, ... sequences
instead.
#. Adding and then removing a file without committing after the 'add' will
#. Adding and then removing a file without committing after the 'add' will
leave this file on disk (untracked)
This happens for example whit lock files that Open Office Write and other
applications will create.
This happens for example whit lock files that Open Office Write and other
applications will create.
#. Dragging the 'edit' folder onto 'released' with Windows File Explorer will
remove the folder in the explorer view, although WsgiDAV did not delete it.
This seems to be done by the client.
This seems to be done by the client.


See:
Expand Down
2 changes: 1 addition & 1 deletion doc/sphinx/addons-mongo-propman.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ MongoDB property manager

Module description
------------------
.. automodule:: wsgidav.addons.mongo_property_manager
.. automodule:: wsgidav.prop_man.mongo_property_manager
10 changes: 5 additions & 5 deletions doc/sphinx/addons-mysql.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ database is published as a collection.
All table rows are rendered as non-collections (text files) that contain the
CSV formatted columns.

An additional virtual text file *_ENTIRE_CONTENTS* is created, that contains
An additional virtual text file *_ENTIRE_CONTENTS* is created, that contains
th whole CSV formatted table content.

.. image:: _static/img/Browser_MySQL.gif

The table's columns are mad accessible as live properties:
Expand All @@ -22,11 +22,11 @@ Usage
-----
To publish an MySQL database, simply add thes lines to the configuration file::

### Publish an MySQL 'world' database as share '/world-db'
from wsgidav.addons.mysql_dav_provider import MySQLBrowserProvider
### Publish an MySQL 'world' database as share '/world-db'
from wsgidav.samples.mysql_dav_provider import MySQLBrowserProvider
addShare("world-db", MySQLBrowserProvider("localhost", "root", "test", "world"))


Module description
------------------
.. automodule:: wsgidav.addons.mysql_dav_provider
.. automodule:: wsgidav.samples.mysql_dav_provider
2 changes: 1 addition & 1 deletion doc/sphinx/addons-ntdc.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ TODO

Module description
------------------
.. automodule:: wsgidav.addons.nt_domain_controller
.. automodule:: wsgidav.dc.nt_domain_controller
23 changes: 15 additions & 8 deletions doc/sphinx/api-doc.rst
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,12 @@ Package ``wsgidav``
wsgidav.dav_provider
wsgidav.debug_filter
wsgidav.dir_browser
wsgidav.domain_controller
wsgidav.error_printer
wsgidav.fs_dav_provider
wsgidav.http_authenticator
wsgidav.lock_manager
wsgidav.lock_storage
wsgidav.middleware
wsgidav.property_manager
wsgidav.request_resolver
wsgidav.request_server
wsgidav.rw_lock
Expand All @@ -46,16 +44,23 @@ Package ``wsgidav``
wsgidav.xml_tools


Package ``wsgidav.addons``
Package ``wsgidav.dc``
--------------------------
.. autosummary::
:toctree: _autosummary

wsgidav.addons.couch_property_manager
wsgidav.addons.hg_dav_provider
wsgidav.addons.mongo_property_manager
wsgidav.addons.mysql_dav_provider
wsgidav.addons.nt_domain_controller
wsgidav.dc.domain_controller
wsgidav.dc.nt_domain_controller


Package ``wsgidav.prop_man``
--------------------------
.. autosummary::
:toctree: _autosummary

wsgidav.prop_man.property_manager
wsgidav.prop_man.couch_property_manager
wsgidav.prop_man.mongo_property_manager


Package ``wsgidav.samples``
Expand All @@ -64,7 +69,9 @@ Package ``wsgidav.samples``
:toctree: _autosummary

wsgidav.samples.dav_provider_tools
wsgidav.samples.hg_dav_provider
wsgidav.samples.mongo_dav_provider
wsgidav.samples.mysql_dav_provider
wsgidav.samples.virtual_dav_provider


Expand Down
2 changes: 1 addition & 1 deletion doc/sphinx/development.rst
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ Hack, Hack, Hack

- Run ``$ tox -e check`` frequently and before you commit.

- Don't forget to run ``$ tox`` to run the hole test suite before
- Don't forget to run ``$ tox`` to run the whole test suite before
you commit.


Expand Down
Loading

0 comments on commit 4c5b425

Please sign in to comment.