README and example re-formatting

This commit is contained in:
yusing 2024-12-03 11:51:13 +08:00
parent 5d5c623f09
commit fcfb7a0105
3 changed files with 71 additions and 73 deletions

View file

@ -34,21 +34,21 @@ _Join our [Discord](https://discord.gg/umReR62nRd) for help and discussions_
## Key Features ## Key Features
- Easy to use - Easy to use
- Effortless configuration - Effortless configuration
- Simple multi-node setup - Simple multi-node setup
- Error messages is clear and detailed, easy troubleshooting - Error messages is clear and detailed, easy troubleshooting
- Auto SSL cert management (See [Supported DNS-01 Challenge Providers](https://github.com/yusing/go-proxy/wiki/Supported-DNS%E2%80%9001-Providers)) - Auto SSL cert management (See [Supported DNS-01 Challenge Providers](https://github.com/yusing/go-proxy/wiki/Supported-DNS%E2%80%9001-Providers))
- Auto configuration for docker containers - Auto configuration for docker containers
- Auto hot-reload on container state / config file changes - Auto hot-reload on container state / config file changes
- **idlesleeper**: stop containers on idle, wake it up on traffic _(optional, see [screenshots](#idlesleeper))_ - **idlesleeper**: stop containers on idle, wake it up on traffic _(optional, see [screenshots](#idlesleeper))_
- HTTP(s) reserve proxy - HTTP(s) reserve proxy
- [HTTP middleware support](https://github.com/yusing/go-proxy/wiki/Middlewares) - [HTTP middleware support](https://github.com/yusing/go-proxy/wiki/Middlewares)
- [Custom error pages support](https://github.com/yusing/go-proxy/wiki/Middlewares#custom-error-pages) - [Custom error pages support](https://github.com/yusing/go-proxy/wiki/Middlewares#custom-error-pages)
- TCP and UDP port forwarding - TCP and UDP port forwarding
- **Web UI with App dashboard** - **Web UI with App dashboard**
- Supports linux/amd64, linux/arm64 - Supports linux/amd64, linux/arm64
- Written in **[Go](https://go.dev)** - Written in **[Go](https://go.dev)**
[🔼Back to top](#table-of-content) [🔼Back to top](#table-of-content)
@ -58,44 +58,45 @@ _Join our [Discord](https://discord.gg/umReR62nRd) for help and discussions_
Setup DNS Records point to machine which runs `GoDoxy`, e.g. Setup DNS Records point to machine which runs `GoDoxy`, e.g.
- A Record: `*.y.z` -> `10.0.10.1` - A Record: `*.y.z` -> `10.0.10.1`
- AAAA Record: `*.y.z` -> `::ffff:a00:a01` - AAAA Record: `*.y.z` -> `::ffff:a00:a01`
### Setup ### Setup
1. Pull the latest docker images 1. Pull the latest docker images
```shell ```shell
docker pull ghcr.io/yusing/go-proxy:latest docker pull ghcr.io/yusing/go-proxy:latest
``` ```
2. Create new directory, `cd` into it, then run setup, or [set up manually](#manual-setup) 2. Create new directory, `cd` into it, then run setup, or [set up manually](#manual-setup)
```shell ```shell
docker run --rm -v .:/setup ghcr.io/yusing/go-proxy /app/godoxy setup docker run --rm -v .:/setup ghcr.io/yusing/go-proxy /app/godoxy setup
``` ```
3. _(Optional)_ setup WebUI login 3. _(Optional)_ setup WebUI login
- set random JWT secret - set random JWT secret
```shell
sed -i "s|API_JWT_SECRET=.*|API_JWT_SECRET=$(openssl rand -base64 32)|g" .env ```shell
``` sed -i "s|API_JWT_SECRET=.*|API_JWT_SECRET=$(openssl rand -base64 32)|g" .env
```
- change username and password for WebUI authentication - change username and password for WebUI authentication
```shell ```shell
sed -i "s|API_USERNAME=.*|API_USERNAME=admin|g" .env sed -i "s|API_USERNAME=.*|API_USERNAME=admin|g" .env
sed -i "s|API_PASSWORD=.*|API_PASSWORD=some-strong-password|g" .env sed -i "s|API_PASSWORD=.*|API_PASSWORD=some-strong-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` 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`
5. Start the container `docker compose up -d` 5. Start the container `docker compose up -d`
6. You may now do some extra configuration 6. You may now do some extra configuration
- With text editor (e.g. Visual Studio Code) - With text editor (e.g. Visual Studio Code)
- With Web UI via `http://localhost:3000` or `https://gp.y.z` - With Web UI via `http://localhost:3000` or `https://gp.y.z`
- For more info, [See Wiki]([wiki](https://github.com/yusing/go-proxy/wiki)) - For more info, [See Wiki](<[wiki](https://github.com/yusing/go-proxy/wiki)>)
[🔼Back to top](#table-of-content) [🔼Back to top](#table-of-content)
@ -103,14 +104,14 @@ Setup DNS Records point to machine which runs `GoDoxy`, e.g.
1. Make `config` directory then grab `config.example.yml` into `config/config.yml` 1. Make `config` directory then grab `config.example.yml` into `config/config.yml`
`mkdir -p config && wget https://raw.githubusercontent.com/yusing/go-proxy/v0.7/config.example.yml -O config/config.yml` `mkdir -p config && wget https://raw.githubusercontent.com/yusing/go-proxy/v0.7/config.example.yml -O config/config.yml`
2. Grab `.env.example` into `.env` 2. Grab `.env.example` into `.env`
`wget https://raw.githubusercontent.com/yusing/go-proxy/v0.7/.env.example -O .env` `wget https://raw.githubusercontent.com/yusing/go-proxy/v0.7/.env.example -O .env`
3. Grab `compose.example.yml` into `compose.yml` 3. Grab `compose.example.yml` into `compose.yml`
`wget https://raw.githubusercontent.com/yusing/go-proxy/v0.7/compose.example.yml -O compose.yml` `wget https://raw.githubusercontent.com/yusing/go-proxy/v0.7/compose.example.yml -O compose.yml`
### Folder structrue ### Folder structrue
@ -142,7 +143,6 @@ Copy [`.vscode/settings.example.json`](.vscode/settings.example.json) to `.vscod
![idlesleeper](screenshots/idlesleeper.webp) ![idlesleeper](screenshots/idlesleeper.webp)
[🔼Back to top](#table-of-content) [🔼Back to top](#table-of-content)
## Build it yourself ## Build it yourself

View file

@ -1,42 +1,42 @@
--- ---
services: services:
frontend: frontend:
image: ghcr.io/yusing/go-proxy-frontend:latest image: ghcr.io/yusing/go-proxy-frontend:latest
container_name: godoxy-frontend container_name: godoxy-frontend
restart: unless-stopped restart: unless-stopped
network_mode: host network_mode: host
env_file: .env env_file: .env
depends_on: depends_on:
- app - app
# modify below to fit your needs # modify below to fit your needs
labels: labels:
proxy.aliases: gp proxy.aliases: gp
proxy.#1.port: 3000 proxy.#1.port: 3000
# proxy.#1.middlewares.cidr_whitelist.status: 403 # proxy.#1.middlewares.cidr_whitelist.status: 403
# proxy.#1.middlewares.cidr_whitelist.message: IP not allowed # proxy.#1.middlewares.cidr_whitelist.message: IP not allowed
# proxy.#1.middlewares.cidr_whitelist.allow: | # proxy.#1.middlewares.cidr_whitelist.allow: |
# - 127.0.0.1 # - 127.0.0.1
# - 10.0.0.0/8 # - 10.0.0.0/8
# - 192.168.0.0/16 # - 192.168.0.0/16
# - 172.16.0.0/12 # - 172.16.0.0/12
app: app:
image: ghcr.io/yusing/go-proxy:latest image: ghcr.io/yusing/go-proxy:latest
container_name: godoxy container_name: godoxy
restart: always restart: always
network_mode: host network_mode: host
env_file: .env env_file: .env
volumes: volumes:
- /var/run/docker.sock:/var/run/docker.sock - /var/run/docker.sock:/var/run/docker.sock
- ./config:/app/config - ./config:/app/config
- ./error_pages:/app/error_pages - ./error_pages:/app/error_pages
# (Optional) choose one of below to enable https # (Optional) choose one of below to enable https
# 1. use existing certificate # 1. use existing certificate
# - /path/to/certs/cert.crt:/app/certs/cert.crt # - /path/to/certs/cert.crt:/app/certs/cert.crt
# - /path/to/certs/priv.key:/app/certs/priv.key # - /path/to/certs/priv.key:/app/certs/priv.key
# 2. use autocert, certs will be stored in ./certs # 2. use autocert, certs will be stored in ./certs
# you can also use a docker volume to store it # you can also use a docker volume to store it
# - ./certs:/app/certs # - ./certs:/app/certs

View file

@ -91,7 +91,6 @@ providers:
# - node1.my.app # - node1.my.app
# homepage config # homepage config
#
homepage: homepage:
# use default app categories detected from alias or docker image name # use default app categories detected from alias or docker image name
use_default_categories: true use_default_categories: true
@ -99,5 +98,4 @@ homepage:
# Below are fixed options (non hot-reloadable) # Below are fixed options (non hot-reloadable)
# timeout for shutdown (in seconds) # timeout for shutdown (in seconds)
#
timeout_shutdown: 5 timeout_shutdown: 5