Skip to content

Commit

Permalink
update config example, scheme and release readme
Browse files Browse the repository at this point in the history
  • Loading branch information
yusing committed Jan 4, 2025
1 parent d44ce0e commit 1e97d12
Show file tree
Hide file tree
Showing 3 changed files with 249 additions and 1 deletion.
35 changes: 35 additions & 0 deletions config.example.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,41 @@ entrypoint:
status: 403
message: "Forbidden"
- use: RedirectHTTP
# access_log:
# buffer_size: 1024
# path: /var/log/example.log
# filters:
# status_codes:
# values:
# - 200-299
# - 101
# method:
# values:
# - GET
# host:
# values:
# - example.y.z
# headers:
# negative: true
# values:
# - foo=bar
# - baz
# cidr:
# values:
# - 192.168.10.0/24
# fields:
# headers:
# default: keep
# config:
# foo: redact
# query:
# default: drop
# config:
# foo: keep
# cookies:
# default: redact
# config:
# foo: keep

providers:
# include files are standalone yaml files under `config/` directory
Expand Down
63 changes: 62 additions & 1 deletion next-release.md
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,8 @@

- **New:** Access Logging (entrypoint and per route), i.e.

**mount logs directory before setting this**

```yaml
# config.yml
entrypoint:
Expand Down Expand Up @@ -245,7 +247,64 @@
- 10.0.0.0/16
```

**mount logs directory before setting this**
To integrate with **goaccess**, currently need to use **caddy** as a file web server. Below should work with `combined` log format.

```yaml
# compose.yml
services:
app:
image: reg.6uo.me/yusing/goproxy
...
volumes:
...
- ./logs:/app/logs
caddy:
image: caddy
restart: always
labels:
proxy.goaccess.port: 80
proxy.goaccess.middlewares.request.set_headers.host: goaccess
volumes:
- ./Caddyfile:/etc/caddy/Caddyfile:ro
- ./logs:/var/www/goaccess:ro
depends_on:
- goaccess
goaccess:
image: hectorm/goaccess:latest
restart: always
volumes:
- ./logs:/srv/logs
command: > # for combined format
/srv/logs/access.log
-o /srv/logs/report.html
-j 4 # 4 threads
--real-time-html
--ws-url=<your goaccess url>:443 # i.e. goaccess.my.app:443/ws
--log-format='%v %h %^[%d:%t %^] "%r" %s %b "%R" "%u"'
```

Caddyfile

```caddyfile
{
auto_https off
}
goaccess:80 {
@websockets {
header Connection *Upgrade
header Upgrade websocket
}
handle @websockets {
reverse_proxy goaccess:7890
}
root * /var/www/goaccess
file_server
rewrite / /report.html
}
```

## Fixes

Expand All @@ -255,4 +314,6 @@
- various other small bugs
- `realIP` and `cloudflareRealIP` middlewares
- prometheus metrics gone after a single route reload
- WebUI app links now works when `match_domains` is not set
- WebUI config editor now display validation errors properly
- upgraded dependencies to the latest
152 changes: 152 additions & 0 deletions schema/config.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -445,6 +445,158 @@
}
}
}
},
"access_log": {
"title": "Access log configuration",
"type": "object",
"additionalProperties": false,
"properties": {
"path": {
"title": "Access log path",
"type": "string"
},
"format": {
"title": "Access log format",
"type": "string",
"enum": [
"common",
"combined",
"json"
]
},
"buffer_size": {
"title": "Access log buffer size in bytes",
"type": "integer",
"minimum": 1
},
"filters": {
"title": "Access log filters",
"type": "object",
"additionalProperties": false,
"properties": {
"cidr": {
"title": "CIDR filter",
"type": "object",
"additionalProperties": false,
"properties": {
"negative": {
"type": "boolean"
},
"values": {
"type": "array"
}
}
},
"status_codes": {
"title": "Status code filter",
"type": "object",
"additionalProperties": false,
"properties": {
"negative": {
"type": "boolean"
},
"values": {
"type": "array"
}
}
},
"method": {
"title": "Method filter",
"type": "object",
"additionalProperties": false,
"properties": {
"negative": {
"type": "boolean"
},
"values": {
"type": "array"
}
}
},
"headers": {
"title": "Header filter",
"type": "object",
"additionalProperties": false,
"properties": {
"negative": {
"type": "boolean"
},
"values": {
"type": "array"
}
}
},
"host": {
"title": "Host filter",
"type": "object",
"additionalProperties": false,
"properties": {
"negative": {
"type": "boolean"
},
"values": {
"type": "array"
}
}
}
}
},
"fields": {
"title": "Access log fields",
"type": "object",
"additionalProperties": false,
"properties": {
"headers": {
"type": "object",
"additionalProperties": false,
"properties": {
"default": {
"enum": [
"keep",
"redact",
"drop"
]
},
"config": {
"type": "object"
}
}
},
"query": {
"type": "object",
"additionalProperties": false,
"properties": {
"default": {
"enum": [
"keep",
"redact",
"drop"
]
},
"config": {
"type": "object"
}
}
},
"cookies": {
"type": "object",
"additionalProperties": false,
"properties": {
"default": {
"enum": [
"keep",
"redact",
"drop"
]
},
"config": {
"type": "object"
}
}
}
}
}
}
}
}
},
Expand Down

0 comments on commit 1e97d12

Please sign in to comment.