Browse Source

chore(release): 1.1.0

Matthias Ladkau 4 years ago
parent
commit
a9c315dba0
9 changed files with 733 additions and 18 deletions
  1. 15 0
      CHANGELOG.md
  2. 47 0
      Dockerfile
  3. 40 8
      README.md
  4. 1 1
      config/config.go
  5. 4 4
      examples/tutorial/doc/tutorial.md
  6. 2 0
      node/node_test.go
  7. 620 1
      swagger.json
  8. 2 2
      term/defs.go
  9. 2 2
      term/term_test.go

+ 15 - 0
CHANGELOG.md

@@ -0,0 +1,15 @@
+# Changelog
+
+All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
+
+## 1.1.0 (2019-09-07)
+
+
+### Bug Fixes
+
+* Make unit test work in docker environment ([2f7a4a2](https://devt.de///commit/2f7a4a2))
+
+
+### Features
+
+* Initial commit ([ab26b0c](https://devt.de///commit/ab26b0c))

+ 47 - 0
Dockerfile

@@ -0,0 +1,47 @@
+# Start from the latest alpine based golang base image
+FROM golang:alpine as builder
+
+# Install git
+RUN apk update && apk add --no-cache git
+
+# Add maintainer info
+LABEL maintainer="Matthias Ladkau <matthias@ladkau.de>"
+
+# Set the current working directory inside the container
+WORKDIR /app
+
+# Copy go mod and sum files
+COPY go.mod go.sum ./
+
+# Download all dependencies
+RUN go mod download
+
+# Copy the source from the current directory to the working directory inside the container
+COPY . .
+
+# Build rufs and link statically (no CGO)
+# Use ldflags -w -s to omit the symbol table, debug information and the DWARF table
+RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -a -ldflags="-w -s" -o rufs ./cli/...
+RUN sh ./attach_webzip.sh
+
+# Start again from scratch
+FROM scratch
+
+# Copy the rufs binary
+COPY --from=builder /app/rufs /rufs
+
+# Set the working directory to data so all created files (e.g. rufs.config.json)
+# can be mapped to physical files on disk
+WORKDIR /data
+
+# Run eliasdb binary
+ENTRYPOINT ["../rufs"]
+
+# To run the server as the current user, expose port 9020 and preserve 
+# all runtime related files on disk in the local directory run:
+#
+# docker run --rm --user $(id -u):$(id -g) -v $PWD:/data -p 9020:9020 krotik/rufs server
+
+# To run the client CLI as the current user and use the rufs.secret in the local directory run:
+
+# docker run --rm --network="host" -it -v $PWD:/data --user $(id -u):$(id -g) -v $PWD:/data krotik/rufs client

+ 40 - 8
README.md

@@ -12,7 +12,7 @@ Rufs is a remote union filesystem which aims to provide a lightweight and secure
 
 Features
 --------
-- Client-Server model using RPC call over ssl.
+- Client-Server model using RPC call over SSL.
 - Single executable for client and server.
 - Communication is secured via a secret token which is never transferred over the network and certificate pinning once a client has connected successfully.
 - Clients can provide a unified view with files from different locations.
@@ -22,17 +22,34 @@ Features
 
 Getting Started
 ---------------
-You can download a precompiled package for Windows (win64) or Linux (amd64) [here](https://devt.de/build_status.html).
+You can download a precompiled package for Windows (win64) or Linux (amd64) [here](https://void.devt.de/pub/rufs).
 
 The archive contains a single executable which contains the server and client code for Rufs.
 
+You can also pull the latest docker image of Rufs from [Dockerhub](https://hub.docker.com/r/krotik/rufs):
+```
+docker pull krotik/rufs
+```
+
+Create an empty directory, change into it and run the following to start the server:
+```
+docker run --rm --user $(id -u):$(id -g) -v $PWD:/data -p 9020:9020 krotik/rufs server
+```
+This exposes port 9020 from the container on the local machine. All runtime related files are written to the current directory as the current user/group.
+
+Run the client by running:
+```
+docker run --rm --network="host" -it -v $PWD:/data --user $(id -u):$(id -g) -v $PWD:/data krotik/rufs client
+```
+The client will also use the runtime related files from the current directory.
+
 ### Tutorial:
 
-To get an idea of what EliasDB is about have a look at the [tutorial](/examples/local_fileshare/doc/tutorial.md).
+To get an idea of what Rufs is about have a look at the [tutorial](https://devt.de/krotik/rufs/src/master/examples/tutorial/doc/tutorial.md).
 
 ### REST API:
 
-The terminal uses a REST API to communicate with the backend. The REST API can be browsed using a dynamically generated swagger.json definition (https://localhost:9090/fs/swagger.json). You can browse the API of Rufs's latest version [here](http://petstore.swagger.io/?url=https://raw.githubusercontent.com/krotik/rufs/master/doc/swagger.json#/default).
+The terminal uses a REST API to communicate with the backend. The REST API can be browsed using a dynamically generated swagger.json definition (https://localhost:9090/fs/swagger.json). You can browse the API of Rufs's latest version [here](http://petstore.swagger.io/?url=https://devt.de/krotik/rufs/raw/master/swagger.json).
 
 ### Command line options
 The main Rufs executable has two main tools:
@@ -48,7 +65,7 @@ The tools are:
 
 Use ./rufs [tool] --help for more information about a tool.
 ```
-The most important one is server which starts the file server. The server has several options:
+The most important one is `server` which starts the file server. The server has several options:
 ```
 Rufs 1.0.0
 
@@ -107,7 +124,7 @@ should have the following json format:
   ]
 }
 ```
-On the console type 'q' to exit and 'help' to get an overview of available commands:
+On the console type `q` to exit and `help` to get an overview of available commands:
 ```
 Available commands:
 ----
@@ -119,7 +136,7 @@ cp <src file/dir> <dst dir>              : Copy a file or directory
 dir [path] [glob]                        : Show a directory listing
 get <src file> [dst local file]          : Retrieve a file and store it locally (in the current directory)
 help [cmd]                               : Show general or command specific help
-mkdir <dir>                              : Create a new direectory
+mkdir <dir>                              : Create a new directory
 mount [path] [branch name] [ro]          : List all mount points or add a new mount point to the tree
 ping <branch name> [rpc]                 : Ping a remote branch
 put [src local file] [dst file]          : Read a local file and store it
@@ -159,10 +176,25 @@ You can build Rufs's executable with:
 go build -o rufs ./cli/...
 ```
 
-Rufs also has a web interface which should be bundled with the executable. The bundled web interface in `web.zip` can be attached by running (assuming the `rufs` executable is in the same folder as the script):
+Rufs also has a web interface which should be bundled with the executable. The bundled web interface in `web.zip` can be attached by running:
 ```
 ./attach_webzip.sh
 ```
+This assumes that the `rufs` executable is in the same folder as the script.
+
+Building Rufs as Docker image
+--------------------------------
+Rufs can be build as a secure and compact Docker image.
+
+- Create a directory, change into it and run:
+```
+git clone https://devt.de/krotik/rufs/ .
+```
+
+- You can now build the Docker image with:
+```
+docker build --tag krotik/rufs .
+```
 
 License
 -------

+ 1 - 1
config/config.go

@@ -15,7 +15,7 @@ import "fmt"
 /*
 ProductVersion is the current version of Rufs
 */
-const ProductVersion = "0.0.0"
+const ProductVersion = "1.1.0"
 
 /*
 Defaut configuration keys

+ 4 - 4
examples/tutorial/doc/tutorial.md

@@ -1,8 +1,8 @@
 Rufs Tutorial
 =============
-The following text will give you an overview of the main features of Rufs. It shows how to run simple local file share.
+The following tutorial will give you an overview of the main features of Rufs. It shows how to run a simple local file share.
 
-The tutorial assumes you have downloaded Rufs and extracted it. Switch to the directory `examples/tutorial`. This example will demonstrate a simple local fileshare. Run `./start_server.sh` (Linux) or `start_server.bat` (Windows) to start the server. You should startup messages:
+The tutorial assumes you have downloaded Rufs and extracted it. Switch to the directory `examples/tutorial`. This example will demonstrate a simple local fileshare. Run `./start_server.sh` (Linux) or `start_server.bat` (Windows) to start the server. You should see start messages:
 ```
 Rufs 1.0.0
 Using secret from: rufs.secret
@@ -14,7 +14,7 @@ Exporting folder: <absolute path to rufs>/examples/tutorial/run/share
 ```
 The created `run` folder contains all runtime files. The created `rufs.secret` file is the `password` to the server and is never transmitted over the network. The client needs this file in order to communicate with the server.
 
-The next step is to start the client. The simplest client is the Rufs CLI. Run `./start_term_client.sh` (Linux) or `start_term_client.bat` (Windows) to start the command-line client. You should see startup messages and a prompt:
+The next step is to start the client. The simplest client is the Rufs CLI. Run `./start_term_client.sh` (Linux) or `start_term_client.bat` (Windows) to start the command-line client. You should see start messages and a prompt:
 ```
 Rufs 1.0.0
 Using secret from: rufs.secret
@@ -33,7 +33,7 @@ We can see from the `branch` command that only one branch is known in the moment
 >>>mount
 /: local(w)
 ```
-The `mount` command tells us that the branch is mounted as root and allows writing. Branches can be mounted by writing `mount <mount point> <branch name>` (e.g mount / local).
+The `mount` command tells us that the branch is mounted as root and allows writing. Branches can be mounted by writing `mount <mount point> <branch name>` (e.g `mount / local`).
 
 Try mounting the local branch again in the subfolders `foo` and `foo2`:
 ```

+ 2 - 0
node/node_test.go

@@ -423,6 +423,8 @@ func TestNodeErrors(t *testing.T) {
 		return
 	}
 
+	cl.Shutdown()
+
 	n.Shutdown()
 
 	if err := n.Shutdown(); err != nil {

File diff suppressed because it is too large
+ 620 - 1
swagger.json


+ 2 - 2
term/defs.go

@@ -54,8 +54,8 @@ var helpMap = map[string]string{
 	"put [src local file] [dst file]":          "Read a local file and store it",
 	"rm <file>":                                "Delete a file or directory (* all files; ** all files/recursive)",
 	"ren <file> <newfile>":                     "Rename a file or directory",
-	"mkdir <dir>":                              "Create a new direectory",
+	"mkdir <dir>":                              "Create a new directory",
 	"cp <src file/dir> <dst dir>":              "Copy a file or directory",
 	"sync <src dir> <dst dir>":                 "Make sure dst has the same files and directories as src",
-	"refresh":                                  "Refreshes all known branches and reconnect if possible.",
+	"refresh":                                  "Refreshes all known branches and reconnect if possible",
 }

+ 2 - 2
term/term_test.go

@@ -85,11 +85,11 @@ cp <src file/dir> <dst dir>              : Copy a file or directory
 dir [path] [glob]                        : Show a directory listing
 get <src file> [dst local file]          : Retrieve a file and store it locally (in the current directory)
 help [cmd]                               : Show general or command specific help
-mkdir <dir>                              : Create a new direectory
+mkdir <dir>                              : Create a new directory
 mount [path] [branch name] [ro]          : List all mount points or add a new mount point to the tree
 ping <branch name> [rpc]                 : Ping a remote branch
 put [src local file] [dst file]          : Read a local file and store it
-refresh                                  : Refreshes all known branches and reconnect if possible.
+refresh                                  : Refreshes all known branches and reconnect if possible
 ren <file> <newfile>                     : Rename a file or directory
 reset [mounts|brances]                   : Remove all mounts or all mounts and all branches
 rm <file>                                : Delete a file or directory (* all files; ** all files/recursive)