diff --git a/README.md b/README.md index ad4f742..b4751ed 100755 --- a/README.md +++ b/README.md @@ -87,8 +87,10 @@ Setup DNS Records point to machine which runs `GoDoxy`, e.g. - change username and password for WebUI authentication ```shell - sed -i "s|API_USERNAME=.*|API_USERNAME=admin|g" .env - sed -i "s|API_PASSWORD=.*|API_PASSWORD=some-strong-password|g" .env + USERNAME=admin + PASSWORD=some-password + sed -i "s|API_USERNAME=.*|API_USERNAME=${USERNAME}|g" .env + sed -i "s|API_PASSWORD=.*|API_PASSWORD=${PASSWORD}|g" .env ``` 4. _(Optional)_ setup `docker-socket-proxy` other docker nodes (see [Multi docker nodes setup](https://github.com/yusing/go-proxy/wiki/Configurations#multi-docker-nodes-setup)) then add them inside `config.yml` diff --git a/README_CHT.md b/README_CHT.md index 9673dd5..702e7e0 100644 --- a/README_CHT.md +++ b/README_CHT.md @@ -87,8 +87,10 @@ _加入我們的 [Discord](https://discord.gg/umReR62nRd) 獲取幫助和討論_ - 更改網頁介面認證的使用者名稱和密碼 ```shell - sed -i "s|API_USERNAME=.*|API_USERNAME=admin|g" .env - sed -i "s|API_PASSWORD=.*|API_PASSWORD=some-strong-password|g" .env + USERNAME=admin + PASSWORD=some-password + sed -i "s|API_USERNAME=.*|API_USERNAME=${USERNAME}|g" .env + sed -i "s|API_PASSWORD=.*|API_PASSWORD=${PASSWORD}|g" .env ``` 4. _(可選)_ 設置其他 Docker 節點的 `docker-socket-proxy`(參見 [多 Docker 節點設置](https://github.com/yusing/go-proxy/wiki/Configurations#multi-docker-nodes-setup)),然後在 `config.yml` 中添加它們 diff --git a/next-release.md b/next-release.md new file mode 100644 index 0000000..222fc3b --- /dev/null +++ b/next-release.md @@ -0,0 +1,95 @@ +GoDoxy v0.8.2 expected changes + +- **Thanks [polds](https://github.com/polds)** + Optionally allow a user to specify a “warm-up” endpoint to start the container, returning a 403 if the endpoint isn’t hit and the container has been stopped. + + This can help prevent bots from starting random containers, or allow health check systems to run some probes. Or potentially lock the start endpoints behind a different authentication mechanism, etc. + + Sample service showing this: + + ```yaml + hello-world: + image: nginxdemos/hello + container_name: hello-world + restart: "no" + ports: + - "9100:80" + labels: + proxy.aliases: hello-world + proxy.#1.port: 9100 + proxy.idle_timeout: 45s + proxy.wake_timeout: 30s + proxy.stop_method: stop + proxy.stop_timeout: 10s + proxy.stop_signal: SIGTERM + proxy.start_endpoint: "/start" + ``` + + Hitting `/` on this service when the container is down: + + ```curl + $ curl -sv -X GET -H "Host: hello-world.godoxy.local" http://localhost/ + * Host localhost:80 was resolved. + * IPv6: ::1 + * IPv4: 127.0.0.1 + * Trying [::1]:80... + * Connected to localhost (::1) port 80 + > GET / HTTP/1.1 + > Host: hello-world.godoxy.local + > User-Agent: curl/8.7.1 + > Accept: */* + > + * Request completely sent off + < HTTP/1.1 403 Forbidden + < Content-Type: text/plain; charset=utf-8 + < X-Content-Type-Options: nosniff + < Date: Wed, 08 Jan 2025 02:04:51 GMT + < Content-Length: 71 + < + Forbidden: Container can only be started via configured start endpoint + * Connection #0 to host localhost left intact + ``` + + Hitting `/start` when the container is down: + + ```curl + curl -sv -X GET -H "Host: hello-world.godoxy.local" -H "X-Goproxy-Check-Redirect: skip" http://localhost/start + * Host localhost:80 was resolved. + * IPv6: ::1 + * IPv4: 127.0.0.1 + * Trying [::1]:80... + * Connected to localhost (::1) port 80 + > GET /start HTTP/1.1 + > Host: hello-world.godoxy.local + > User-Agent: curl/8.7.1 + > Accept: */* + > X-Goproxy-Check-Redirect: skip + > + * Request completely sent off + < HTTP/1.1 200 OK + < Date: Wed, 08 Jan 2025 02:13:39 GMT + < Content-Length: 0 + < + * Connection #0 to host localhost left intact + ``` + +- Caddyfile like rules + ```yaml + proxy.goaccess.rules: | + - name: default + do: | + rewrite / /index.html + serve /var/www/goaccess + - name: ws + on: | + header Connection Upgrade + header Upgrade websocket + do: bypass # do nothing, pass to reverse proxy + + proxy.app.rules: | + - name: default + do: bypass # do nothing, pass to reverse proxy + - name: block POST and PUT + on: method POST | method PUT + do: error 403 Forbidden +``` \ No newline at end of file