From a4cf71c527dccb3e2ba49a8510587e8eab17839a Mon Sep 17 00:00:00 2001 From: Christian Claus Date: Sat, 12 May 2018 22:10:51 +0200 Subject: [PATCH] Rename project to dave --- Readme.md | 29 ++++++++++++---------- app/config.go | 2 +- cmd/daffycli/main.go | 7 ------ cmd/{daffy => dave}/main.go | 2 +- cmd/davecli/main.go | 7 ++++++ cmd/{daffycli => davecli}/subcmd/passwd.go | 0 cmd/{daffycli => davecli}/subcmd/root.go | 2 +- magefile.go | 26 +++++++++---------- 8 files changed, 39 insertions(+), 36 deletions(-) delete mode 100644 cmd/daffycli/main.go rename cmd/{daffy => dave}/main.go (98%) create mode 100644 cmd/davecli/main.go rename cmd/{daffycli => davecli}/subcmd/passwd.go (100%) rename cmd/{daffycli => davecli}/subcmd/root.go (96%) diff --git a/Readme.md b/Readme.md index 0c6c6b3..f73152a 100644 --- a/Readme.md +++ b/Readme.md @@ -1,9 +1,9 @@ -[![Build Status](https://travis-ci.org/micromata/daffy.svg?branch=master)](https://travis-ci.org/micromata/daffy) -[![Go Report](https://goreportcard.com/badge/github.com/micromata/daffy)](https://goreportcard.com/report/github.com/micromata/daffy) +[![Build Status](https://travis-ci.org/micromata/dave.svg?branch=master)](https://travis-ci.org/micromata/dave) +[![Go Report](https://goreportcard.com/badge/github.com/micromata/dave)](https://goreportcard.com/report/github.com/micromata/dave) -# daffy - The simple webdav server +# dave - The simple webdav server -*daffy* is a simple webdav server that provides the following features: +_dave_ is a simple webdav server that provides the following features: - Single binary that runs under Windows, Linux and OSX. - Authentication via HTTP-Basic. @@ -14,6 +14,8 @@ It perfectly fits if you would like to give some people the possibility to upload, download or share files with common tools like the OSX Finder, Windows Explorer or Nautilus under Linux ([or many other tools](https://en.wikipedia.org/wiki/Comparison_of_WebDAV_software#WebDAV_clients)). +The project name _dave_ is an abbreviation for: **D**istributed **A**uthoring and **V**ersioning made **e**asy. + ## Table of Contents - [Configuration](#configuration) @@ -37,7 +39,8 @@ following locations for the presence of a `config.yaml` in the following order: - The directory `./config` -- The directory `$HOME/.daffy` +- The directory `$HOME/.swd` (swd was the initial project name of dave) +- The directory `$HOME/.dave` - The current working directory `.` ### First steps @@ -99,9 +102,9 @@ configuration with `apache2 httpd`'s `mod_proxy`: ### User management -User management in *daffy* is very simple. Each user in the `config.yaml` MUST have a password and CAN have a subdirectory. +User management in _dave_ is very simple. Each user in the `config.yaml` MUST have a password and CAN have a subdirectory. -The password must be in form of a BCrypt hash. You can generate one calling the shipped cli tool `daffycli pasdaffy`. +The password must be in form of a BCrypt hash. You can generate one calling the shipped cli tool `davecli pasdaffy`. If a subdirectory is configured for a user, the user is jailed within it and can't see anything that exists outside of this directory. If no subdirectory is configured for an user, the user can see and modify all files within the base directory. @@ -150,7 +153,7 @@ There is no need to restart the server itself, if you're editing the user or log ### Binary installation -You can check out the [releases page](https://github.com/micromata/daffy/releases) for the latest precompiled binaries. +You can check out the [releases page](https://github.com/micromata/dave/releases) for the latest precompiled binaries. ### Build from sources @@ -166,7 +169,7 @@ mkdir -p $GOPATH/src/github.com/micromata/ && cd $GOPATH/src/github.com/micromat 3. Clone the repository (or your fork) ``` -git clone git@github.com:micromata/daffy.git +git clone git@github.com:micromata/dave.git ``` To build and install from sources you have two major possibilites: @@ -176,7 +179,7 @@ To build and install from sources you have two major possibilites: You can use the plain go toolchain and install the project to your `$GOPATH` via: ``` -cd $GOPATH/src/github.com/micromata/daffy && go install ./... +cd $GOPATH/src/github.com/micromata/dave && go install ./... ``` #### magefile @@ -192,12 +195,12 @@ Please ensure you've got [mage](https://magefile.org) installed. This can be don Now you can call `mage install` to build and install the binaries. If you just call `mage`, you'll get a list of possible targets: Targets: - build Builds daffy and daffycli and moves it to the dist directory - buildReleases Builds daffy and daffycli for different OS and package them to a zip file for each os + build Builds dave and davecli and moves it to the dist directory + buildReleases Builds dave and davecli for different OS and package them to a zip file for each os check Runs golint and go tool vet on each .go file. clean Removes the dist directory fmt Formats the code via gofmt - install Installs daffy and daffycli to your $GOPATH/bin folder + install Installs dave and davecli to your $GOPATH/bin folder installDeps Runs dep ensure and installs additional dependencies. ## Connecting diff --git a/app/config.go b/app/config.go index 1316392..760ffe1 100644 --- a/app/config.go +++ b/app/config.go @@ -50,7 +50,7 @@ func ParseConfig() *Config { viper.SetConfigName("config") viper.AddConfigPath("./config") viper.AddConfigPath("$HOME/.swd") - viper.AddConfigPath("$HOME/.daffy") + viper.AddConfigPath("$HOME/.dave") viper.AddConfigPath(".") err := viper.ReadInConfig() diff --git a/cmd/daffycli/main.go b/cmd/daffycli/main.go deleted file mode 100644 index f970a23..0000000 --- a/cmd/daffycli/main.go +++ /dev/null @@ -1,7 +0,0 @@ -package main - -import "github.com/micromata/daffy/cmd/daffycli/subcmd" - -func main() { - subcmd.Execute() -} diff --git a/cmd/daffy/main.go b/cmd/dave/main.go similarity index 98% rename from cmd/daffy/main.go rename to cmd/dave/main.go index c3d5ef9..98566f9 100644 --- a/cmd/daffy/main.go +++ b/cmd/dave/main.go @@ -3,7 +3,7 @@ package main import ( "errors" "fmt" - "github.com/micromata/daffy/app" + "github.com/micromata/dave/app" log "github.com/sirupsen/logrus" "golang.org/x/net/webdav" syslog "log" diff --git a/cmd/davecli/main.go b/cmd/davecli/main.go new file mode 100644 index 0000000..4d3012f --- /dev/null +++ b/cmd/davecli/main.go @@ -0,0 +1,7 @@ +package main + +import "github.com/micromata/dave/cmd/davecli/subcmd" + +func main() { + subcmd.Execute() +} diff --git a/cmd/daffycli/subcmd/passwd.go b/cmd/davecli/subcmd/passwd.go similarity index 100% rename from cmd/daffycli/subcmd/passwd.go rename to cmd/davecli/subcmd/passwd.go diff --git a/cmd/daffycli/subcmd/root.go b/cmd/davecli/subcmd/root.go similarity index 96% rename from cmd/daffycli/subcmd/root.go rename to cmd/davecli/subcmd/root.go index 8dc7d52..f43621c 100644 --- a/cmd/daffycli/subcmd/root.go +++ b/cmd/davecli/subcmd/root.go @@ -8,7 +8,7 @@ import ( // RootCmd represents the base command when called without any subcommands var RootCmd = &cobra.Command{ - Use: "daffycli", + Use: "davecli", Short: "A cli for the simple webdav server", } diff --git a/magefile.go b/magefile.go index 7347a1f..7599f57 100644 --- a/magefile.go +++ b/magefile.go @@ -28,7 +28,7 @@ type target struct { goarch string } -// Build Builds daffy and daffycli and moves it to the dist directory +// Build Builds dave and davecli and moves it to the dist directory func Build() error { mg.Deps(InstallDeps) mg.Deps(Clean) @@ -47,7 +47,7 @@ func Build() error { return nil } -// BuildReleases Builds daffy and daffycli for different OS and package them to a zip file for each os +// BuildReleases Builds dave and davecli for different OS and package them to a zip file for each os func BuildReleases() error { mg.Deps(Clean) @@ -61,20 +61,20 @@ func BuildReleases() error { for _, t := range targets { fmt.Printf("Building for OS %s and architecture %s\n", t.goos, t.goarch) - daffy, daffyCli, _ := buildSpecific(t) + dave, daveCli, _ := buildSpecific(t) files := []string{ - daffy, - daffyCli, + dave, + daveCli, "Readme.md", filepath.Join("examples", "config-sample.yaml"), } - archiveName := fmt.Sprintf("daffy-%s-%s.zip", t.goos, t.goarch) + archiveName := fmt.Sprintf("dave-%s-%s.zip", t.goos, t.goarch) zipFiles(filepath.Join("dist", archiveName), files) - os.Remove(daffy) - os.Remove(daffyCli) + os.Remove(dave) + os.Remove(daveCli) } return nil @@ -132,7 +132,7 @@ func Check() error { return nil } -// Install Installs daffy and daffycli to your $GOPATH/bin folder +// Install Installs dave and davecli to your $GOPATH/bin folder func Install() error { mg.Deps(InstallDeps) @@ -179,8 +179,8 @@ func buildSpecific(t target) (string, string, error) { env = append(env, fmt.Sprintf("GOARCH=%s", t.goarch)) } - daffySource := filepath.Join("cmd", "daffy", "main.go") - daffyExe := filepath.Join(DIST, "daffy") + daffySource := filepath.Join("cmd", "dave", "main.go") + daffyExe := filepath.Join(DIST, "dave") if t.goos == "windows" { daffyExe += ".exe" } @@ -191,8 +191,8 @@ func buildSpecific(t target) (string, string, error) { return "", "", err } - daffyCliSource := filepath.Join("cmd", "daffycli", "main.go") - daffyCliExe := filepath.Join(DIST, "daffycli") + daffyCliSource := filepath.Join("cmd", "davecli", "main.go") + daffyCliExe := filepath.Join(DIST, "davecli") if t.goos == "windows" { daffyCliExe += ".exe" }