added stats page and password reset

This commit is contained in:
ston1th 2019-11-24 12:25:19 +01:00
commit cabc3e94b4
55 changed files with 8094 additions and 4362 deletions

View file

@ -0,0 +1,59 @@
# authdav - a x/net/webdav wrapper
Wrappers:
* HTTP Basic Auth wrapper for `webdav.Handler`
* write only once FileSystem wrapper for `webdav.FileSystem`
## Usage
### HTTP Basic Auth
```
package main
import (
"git.giftfish.de/ston1th/authdav"
"golang.org/x/net/webdav"
"log"
"net/http"
)
type exampleAuthenticator struct {}
func (exampleAuthenticator) BasicAuth(user, password string) bool {
if user == "user" && password == "password" {
return true
}
return false
}
func main() {
auth := exampleAuthenticator{}
handler := authdav.NewWebdavBasicAuth("", webdav.Dir("."), nil, nil, auth, "webdav with basic auth")
log.Fatal(http.ListenAndServe(":8080", handler))
}
```
### Write Only
```
package main
import (
"git.giftfish.de/ston1th/authdav"
"golang.org/x/net/webdav"
"log"
"net/http"
)
func main() {
fs := authdav.NewWriteOnlyOnceFileSystem(webdav.Dir("."))
handler := &webdav.Handler{
Prefix: "",
FileSystem: fs,
LockSystem: webdav.NewMemLS(),
Logger: nil,
}
log.Fatal(http.ListenAndServe(":8080", handler))
}
```