Add readme, change description on some of the flags.

This commit is contained in:
Aaron Bieber 2020-05-07 21:54:39 -06:00
parent 7e594abd1a
commit a08c782f38
2 changed files with 26 additions and 3 deletions

23
README.md Normal file
View File

@ -0,0 +1,23 @@
# gavin
Simple utility to serve password protected WebDAV.
## Example usage
`gavin` was built as a simple WebDAV server specifically to run
[organice](https://github.com/200ok-ch/organice). Here is an example showing how
to host organice via WebDAV.
| Flag | Value | Description |
|-----------|---------------------|-----------------------------------------------------------------------------------------|
| `-davdir` | /tmp/org | The directory we have our .org files in. |
| `-htpass` | /tmp/.htpasswd | Standard `htpasswd` file generated with `htpasswd`. Currently only bcrypt is supported. |
| `-static` | /tmp/organice/build | The directory that contains the built organice files. |
```
gavin -davdir /tmp/org -htpass /tmp/.htpasswd -static /tmp/organice/build/
```
Now you can open your browser to
[http://localhost:8080/](http://localhost:8080/), sign in using the credentials
in the `.htpasswd` file, and org away!

View File

@ -29,13 +29,13 @@ func init() {
users = make(map[string]string)
dir, err := filepath.Abs(filepath.Dir(os.Args[0]))
if err != nil {
log.Fatal(err)
log.Fatalln(err);
}
flag.StringVar(&davDir, "davdir", dir, "WebDAV directory to serve.")
flag.StringVar(&davDir, "davdir", dir, "Directory to serve over WebDAV.")
flag.StringVar(&listen, "http", ":8080", "Listen on")
flag.StringVar(&passPath, "htpass", fmt.Sprintf("%s/.htpasswd", dir), "Path to .htpasswd file..")
flag.StringVar(&prefix, "prefix", "/dav/", "Prefix to serve dav things from.")
flag.StringVar(&prefix, "prefix", "/dav/", "Prefix to serve davdir from.")
flag.StringVar(&staticDir, "static", dir, "Directory to serve static resources from.")
flag.Parse()