2021-12-03 22:04:09 +00:00
|
|
|
# ezshare
|
|
|
|
|
2021-12-04 10:52:28 +00:00
|
|
|
## Server
|
|
|
|
|
|
|
|
Running a server using docker:
|
|
|
|
|
|
|
|
```text
|
|
|
|
# First, build the image
|
|
|
|
docker build -t ezshare:latest .
|
|
|
|
|
2021-12-08 19:32:10 +00:00
|
|
|
Copy config file to /var/ezshare/ezshare.toml (or see ezshare.minimal.env to see how to set config-values using envvars)
|
2021-12-04 10:52:28 +00:00
|
|
|
# Run the server
|
2021-12-08 19:32:10 +00:00
|
|
|
docker run --rm -d -v /var/ezshare:/data -e EZSHARE_CONFIG=/data/ezshare.toml ezshare:latest
|
2021-12-04 10:52:28 +00:00
|
|
|
```
|
|
|
|
|
|
|
|
## Client
|
|
|
|
|
|
|
|
Compile the client:
|
|
|
|
```text
|
|
|
|
go build -o ezshare cmd/ezshare.go
|
|
|
|
```
|
|
|
|
|
2021-12-08 19:32:10 +00:00
|
|
|
Generate client config, and fetch needed certificates:
|
|
|
|
```
|
|
|
|
./ezshare client login --overwrite "https://ezshare.example.org"
|
|
|
|
username: admin
|
|
|
|
password:
|
|
|
|
```
|
2021-12-04 10:52:28 +00:00
|
|
|
|
|
|
|
```text
|
|
|
|
NAME:
|
|
|
|
ezshare client - Client commands
|
|
|
|
|
|
|
|
USAGE:
|
|
|
|
ezshare client command [command options] [arguments...]
|
|
|
|
|
|
|
|
COMMANDS:
|
|
|
|
get Get file with id
|
|
|
|
upload Upload file(s)
|
|
|
|
delete Delete file with id
|
|
|
|
list List files
|
|
|
|
config-init Initialize default config
|
|
|
|
help, h Shows a list of commands or help for one command
|
|
|
|
|
|
|
|
OPTIONS:
|
|
|
|
--addr value Address of server.
|
|
|
|
--help, -h show help (default: false)
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
## Development
|
|
|
|
|
2021-12-03 22:04:09 +00:00
|
|
|
### Recompile proto-files
|
|
|
|
|
2021-12-04 10:52:28 +00:00
|
|
|
`protoc --go_out=. --go-grpc_out=. --go_opt=module=gitea.benny.dog/torjus/ezshare --go-grpc_opt=module=gitea.benny.dog/torjus/ezshare protos/ezshare.proto`
|