webdav

package module
v1.1.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 10, 2020 License: MIT Imports: 8 Imported by: 0

README

webdav

⚠️ This plugin is no longer maintained, nor is it compatible with casket 2+. For a casket v2 WebDAV plugin, please check @mholt's webdav plugin.

Build community Go Report Card

casket plugin that implements WebDAV. You can download this plugin with casket on its official download page.

Syntax

webdav [url] {
    scope       path
    modify      [true|false]
    allow       path
    allow_r     regex
    block       path
    block_r     regex
}

All the options are optional.

  • url is the place where you can access the WebDAV interface. Defaults to /.
  • scope is an absolute or relative (to the current working directory of casket) path that indicates the scope of the WebDAV. Defaults to ..
  • modify indicates if the user has permission to edit/modify the files. Defaults to true.
  • allow and block are used to allow or deny access to specific files or directories using their relative path to the scope. You can use the magic word dotfiles to allow or deny the access to every file starting by a dot.
  • allow_r and block_r and variations of the previous options but you are able to use regular expressions with them.

It is highly recommended to use this directive alongside with basicauth to protect the WebDAV interface.

webdav {
    # You set the global configurations here and
    # all the users will inherit them.
    user1:
    # Here you can set specific settings for the 'user1'.
    # They will override the global ones for this specific user.
}

Examples

WebDAV on / for the current working directory:

webdav

WebDAV on /admin for the whole file system:

webdav /admin {
    scope /
}

WebDAV on / for the whole file system, without access to /etc and /dev directories:

webdav {
    scope /
    block /etc
    block /dev
}

WebDAV on / for the whole file system. The user sam can't access /var/www but the others can.

basicauth / sam pass
webdav {
    scope /

    sam:
    block /var/www
}

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type WebDav

type WebDav struct {
	Next    httpserver.Handler
	Configs []*config
}

WebDav is the middleware that contains the configuration for each instance.

func (WebDav) ServeHTTP

func (d WebDav) ServeHTTP(w http.ResponseWriter, r *http.Request) (int, error)

ServeHTTP determines if the request is for this plugin, and if all prerequisites are met.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL