From 094f75ef4661d7b17dae0c44dd8af05195fedf6a Mon Sep 17 00:00:00 2001 From: yusing Date: Sat, 23 Mar 2024 03:29:35 +0000 Subject: [PATCH] readme and dockerfile fix for v0.3 update --- Dockerfile | 2 +- README.md | 35 +++++++++++++++++++++++++++++------ compose.example.yml | 9 ++++----- config.example.yml | 12 ++++++------ 4 files changed, 40 insertions(+), 18 deletions(-) diff --git a/Dockerfile b/Dockerfile index 703ef8ce..48c4b8a0 100644 --- a/Dockerfile +++ b/Dockerfile @@ -6,7 +6,7 @@ RUN apk add --no-cache bash tzdata RUN mkdir /app COPY bin/go-proxy entrypoint.sh /app/ COPY templates/ /app/templates -COPY config.default.yml /app/config.yml +COPY config.example.yml /app/config.yml RUN chmod +x /app/go-proxy /app/entrypoint.sh ENV DOCKER_HOST unix:///var/run/docker.sock diff --git a/README.md b/README.md index 5a874d39..c4ffeab2 100755 --- a/README.md +++ b/README.md @@ -40,6 +40,7 @@ In the examples domain `x.y.z` is used, replace them with your domain - HTTP round robin load balance support (same subdomain and path across different hosts) - Auto hot-reload on container start / die / stop or config changes. - Simple panel to see all reverse proxies and health (visit port [panel port] of go-proxy `https://*.y.z:[panel port]`) + - you can customize it by modifying [templates/panel.html](templates/panel.html) ![panel screenshot](screenshots/panel.png) @@ -56,10 +57,16 @@ In the examples domain `x.y.z` is used, replace them with your domain ### Binary -1. (Optional) Prepare your wildcard (`*.y.z`) SSL cert in `certs/` to enable https. See [Getting SSL Certs](#getting-ssl-certs) +1. (Optional) enabled HTTPS - - cert / chain / fullchain: `./certs/cert.crt` - - private key: `./certs/priv.key` + - Use autocert feature by completing `autocert` in `config.yml` + + - Use existing certificate + + Prepare your wildcard (`*.y.z`) SSL cert in `certs/` + + - cert / chain / fullchain: `./certs/cert.crt` + - private key: `./certs/priv.key` 2. run the binary `bin/go-proxy` @@ -71,10 +78,25 @@ In the examples domain `x.y.z` is used, replace them with your domain 2. Add networks to make sure it is in the same network with other containers, or make sure `proxy..host` is reachable -3. (Optional) Mount your wildcard (`*.y.z`) SSL cert to enable https. See [Getting SSL Certs](#getting-ssl-certs) +3. (Optional) enable HTTPS - - cert / chain / fullchain -> `/app/certs/cert.crt` - - private key -> `/app/certs/priv.key` + - Use autocert feature + + 1. mount `./certs` to `/app/certs` + ```yaml + go-proxy: + ... + volumes: + - ./certs:/app/certs + ``` + 2. complete `autocert` in `config.yml` + + - Use existing certificate + + Mount your wildcard (`*.y.z`) SSL cert to enable https. See [Getting SSL Certs](#getting-ssl-certs) + + - cert / chain / fullchain -> `/app/certs/cert.crt` + - private key -> `/app/certs/priv.key` 4. Start `go-proxy` with `docker compose up -d` or `make up`. @@ -151,6 +173,7 @@ See [providers.example.yml](providers.example.yml) ### Supported cert providers - Cloudflare + ```yaml autocert: ... diff --git a/compose.example.yml b/compose.example.yml index be3284a4..39a3d9cb 100755 --- a/compose.example.yml +++ b/compose.example.yml @@ -19,15 +19,14 @@ services: # - 20000:20100/tcp # - 20000:20100/udp volumes: - # if you want https + # use existing certificate # - /path/to/cert.pem:/app/certs/cert.crt:ro # - /path/to/privkey.pem:/app/certs/priv.key:ro - # path to logs - - ./log:/app/log + # use autocert feature + # - ./certs:/app/certs - # if you use default config, or declared local docker provider - # otherwise comment this line + # if local docker provider is used (by default) - /var/run/docker.sock:/var/run/docker.sock:ro # to use custom config diff --git a/config.example.yml b/config.example.yml index 74ea911b..82d34b37 100644 --- a/config.example.yml +++ b/config.example.yml @@ -11,12 +11,12 @@ providers: kind: docker # for value format, see https://docs.docker.com/reference/cli/dockerd/ value: FROM_ENV - remote1: - kind: docker - value: ssh://user@10.0.1.1 - remote2: - kind: docker - value: tcp://10.0.1.1:2375 + # remote1: + # kind: docker + # value: ssh://user@10.0.1.1 + # remote2: + # kind: docker + # value: tcp://10.0.1.1:2375 # provider1: # kind: file # value: provider1.yml