From ea99def5022274fa909bb8eb4f09dbe5033d3154 Mon Sep 17 00:00:00 2001 From: Maycon Santos Date: Sat, 31 Jul 2021 12:33:04 +0200 Subject: [PATCH] Update mgmt binary name and config doc (#75) * using wiretrustee-mgmt for binary name * using wiretrustee-mgmt * updated documentation and compose files to use config.json --- .goreleaser.yaml | 2 +- infrastructure_files/config.json | 24 ++++++++++++++++++++++++ infrastructure_files/docker-compose.yml | 1 + management/Dockerfile | 4 ++-- management/Dockerfile.debug | 4 ++-- management/README.md | 6 +++++- management/cmd/root.go | 2 +- 7 files changed, 36 insertions(+), 7 deletions(-) create mode 100644 infrastructure_files/config.json diff --git a/.goreleaser.yaml b/.goreleaser.yaml index 27f389d33..c4826539a 100644 --- a/.goreleaser.yaml +++ b/.goreleaser.yaml @@ -24,7 +24,7 @@ builds: - id: wiretrustee-mgmt dir: management env: [CGO_ENABLED=0] - + binary: wiretrustee-mgmt goos: - linux goarch: diff --git a/infrastructure_files/config.json b/infrastructure_files/config.json new file mode 100644 index 000000000..473bc8d54 --- /dev/null +++ b/infrastructure_files/config.json @@ -0,0 +1,24 @@ +{ + "Stuns": [ + { + "Proto": "udp", + "URI": "stun:stun.wiretrustee.com:3468", + "Username": "", + "Password": null + } + ], + "Turns": [ + { + "Proto": "udp", + "URI": "turn:stun.wiretrustee.com:3468", + "Username": "some_turn_user", + "Password": "some_turn_passwd" + } + ], + "Signal": { + "Proto": "http", + "URI": "signal.wiretrustee.com:10000", + "Username": "", + "Password": null + } +} \ No newline at end of file diff --git a/infrastructure_files/docker-compose.yml b/infrastructure_files/docker-compose.yml index 6edfffbeb..2ac50105e 100644 --- a/infrastructure_files/docker-compose.yml +++ b/infrastructure_files/docker-compose.yml @@ -12,6 +12,7 @@ services: restart: unless-stopped volumes: - wiretrustee-mgmt:/var/lib/wiretrustee + - ./config.json:/etc/wiretrustee/config.json ports: - 33073:33073 # # port and command for Let's Encrypt validation diff --git a/management/Dockerfile b/management/Dockerfile index 9f25173e0..49020e8ae 100644 --- a/management/Dockerfile +++ b/management/Dockerfile @@ -1,3 +1,3 @@ FROM gcr.io/distroless/base -ENTRYPOINT [ "/go/bin/wiretrustee","management"] -COPY wiretrustee /go/bin/wiretrustee \ No newline at end of file +ENTRYPOINT [ "/go/bin/wiretrustee-mgmt","management"] +COPY wiretrustee-mgmt /go/bin/wiretrustee-mgmt \ No newline at end of file diff --git a/management/Dockerfile.debug b/management/Dockerfile.debug index c67820a2e..6bac95534 100644 --- a/management/Dockerfile.debug +++ b/management/Dockerfile.debug @@ -1,3 +1,3 @@ FROM gcr.io/distroless/base:debug -ENTRYPOINT [ "/go/bin/wiretrustee","management","--log-level","debug"] -COPY wiretrustee /go/bin/wiretrustee \ No newline at end of file +ENTRYPOINT [ "/go/bin/wiretrustee-mgmt","management","--log-level","debug"] +COPY wiretrustee-mgmt /go/bin/wiretrustee-mgmt \ No newline at end of file diff --git a/management/README.md b/management/README.md index 023368111..4edba5292 100644 --- a/management/README.md +++ b/management/README.md @@ -7,7 +7,7 @@ The CLI accepts the command **management** with the following options: start Wiretrustee Management Server Usage: - wiretrustee management [flags] + wiretrustee-mgmt management [flags] Flags: --datadir string server data directory location (default "/var/lib/wiretrustee/") @@ -39,9 +39,11 @@ docker run -d --name wiretrustee-management \ -p 33073:33073 \ -p 443:443 \ -v wiretrustee-mgmt:/var/lib/wiretrustee \ +-v ./config.json:/etc/wiretrustee/config.json \ wiretrustee/management:latest \ --letsencrypt-domain ``` +> An example of config.json can be found here [config.json](../infrastructure_files/config.json) Trigger Let's encrypt certificate generation: ```bash @@ -76,6 +78,7 @@ docker volume create wiretrustee-mgmt docker run -d --name wiretrustee-management \ -p 33073:33073 \ -v wiretrustee-mgmt:/var/lib/wiretrustee \ +-v ./config.json:/etc/wiretrustee/config.json \ wiretrustee/management:latest ``` ### Debug tag @@ -84,6 +87,7 @@ We also publish a docker image with the debug tag which has the log-level set to shell $ docker run -d --name wiretrustee-management-debug \ -p 33073:33073 \ -v wiretrustee-mgmt:/var/lib/wiretrustee \ +-v ./config.json:/etc/wiretrustee/config.json \ wiretrustee/management:debug-latest shell $ docker exec -ti wiretrustee-management-debug /bin/sh diff --git a/management/cmd/root.go b/management/cmd/root.go index ef7a64c2d..122ce0ea3 100644 --- a/management/cmd/root.go +++ b/management/cmd/root.go @@ -21,7 +21,7 @@ var ( logLevel string rootCmd = &cobra.Command{ - Use: "wiretrustee", + Use: "wiretrustee-mgmt", Short: "", Long: "", }