Skip to content

Commit

Permalink
Merge branch 'main' into improve-action-fe
Browse files Browse the repository at this point in the history
  • Loading branch information
lunny committed Mar 13, 2023
2 parents 14655d8 + a8e13e6 commit 60c0b06
Show file tree
Hide file tree
Showing 98 changed files with 1,625 additions and 630 deletions.
101 changes: 83 additions & 18 deletions .drone.yml
Expand Up @@ -1206,7 +1206,7 @@ steps:
- git fetch --tags --force

- name: publish
image: techknowlogick/drone-docker:latest
image: plugins/docker:latest
pull: always
settings:
auto_tag: true
Expand All @@ -1218,13 +1218,17 @@ steps:
from_secret: docker_password
username:
from_secret: docker_username
environment:
PLUGIN_MIRROR:
from_secret: plugin_mirror
DOCKER_BUILDKIT: 1
when:
event:
exclude:
- pull_request

- name: publish-rootless
image: techknowlogick/drone-docker:latest
image: plugins/docker:latest
settings:
dockerfile: Dockerfile.rootless
auto_tag: true
Expand All @@ -1236,6 +1240,10 @@ steps:
from_secret: docker_password
username:
from_secret: docker_username
environment:
PLUGIN_MIRROR:
from_secret: plugin_mirror
DOCKER_BUILDKIT: 1
when:
event:
exclude:
Expand Down Expand Up @@ -1276,7 +1284,7 @@ steps:
- git fetch --tags --force

- name: publish
image: techknowlogick/drone-docker:latest
image: plugins/docker:latest
pull: always
settings:
tags: ${DRONE_TAG##v}-linux-amd64
Expand All @@ -1287,13 +1295,17 @@ steps:
from_secret: docker_password
username:
from_secret: docker_username
environment:
PLUGIN_MIRROR:
from_secret: plugin_mirror
DOCKER_BUILDKIT: 1
when:
event:
exclude:
- pull_request

- name: publish-rootless
image: techknowlogick/drone-docker:latest
image: plugins/docker:latest
settings:
dockerfile: Dockerfile.rootless
tags: ${DRONE_TAG##v}-linux-amd64-rootless
Expand All @@ -1304,6 +1316,10 @@ steps:
from_secret: docker_password
username:
from_secret: docker_username
environment:
PLUGIN_MIRROR:
from_secret: plugin_mirror
DOCKER_BUILDKIT: 1
when:
event:
exclude:
Expand Down Expand Up @@ -1341,7 +1357,7 @@ steps:
- git fetch --tags --force

- name: publish
image: techknowlogick/drone-docker:latest
image: plugins/docker:latest
pull: always
settings:
auto_tag: false
Expand All @@ -1353,13 +1369,17 @@ steps:
from_secret: docker_password
username:
from_secret: docker_username
environment:
PLUGIN_MIRROR:
from_secret: plugin_mirror
DOCKER_BUILDKIT: 1
when:
event:
exclude:
- pull_request

- name: publish-rootless
image: techknowlogick/drone-docker:latest
image: plugins/docker:latest
settings:
dockerfile: Dockerfile.rootless
auto_tag: false
Expand All @@ -1371,6 +1391,10 @@ steps:
from_secret: docker_password
username:
from_secret: docker_username
environment:
PLUGIN_MIRROR:
from_secret: plugin_mirror
DOCKER_BUILDKIT: 1
when:
event:
exclude:
Expand Down Expand Up @@ -1407,7 +1431,7 @@ steps:
- git fetch --tags --force

- name: publish
image: techknowlogick/drone-docker:latest
image: plugins/docker:latest
pull: always
settings:
auto_tag: false
Expand All @@ -1419,13 +1443,17 @@ steps:
from_secret: docker_password
username:
from_secret: docker_username
environment:
PLUGIN_MIRROR:
from_secret: plugin_mirror
DOCKER_BUILDKIT: 1
when:
event:
exclude:
- pull_request

- name: publish-rootless
image: techknowlogick/drone-docker:latest
image: plugins/docker:latest
settings:
dockerfile: Dockerfile.rootless
auto_tag: false
Expand All @@ -1437,6 +1465,10 @@ steps:
from_secret: docker_password
username:
from_secret: docker_username
environment:
PLUGIN_MIRROR:
from_secret: plugin_mirror
DOCKER_BUILDKIT: 1
when:
event:
exclude:
Expand All @@ -1445,7 +1477,7 @@ steps:
---
kind: pipeline
type: docker
name: docker-linux-arm64-dry-run
name: docker-linux-amd64-dry-run

platform:
os: linux
Expand All @@ -1463,7 +1495,7 @@ trigger:

steps:
- name: dryrun
image: techknowlogick/drone-docker:latest
image: plugins/docker:latest
pull: always
settings:
dry_run: true
Expand All @@ -1474,6 +1506,7 @@ steps:
environment:
PLUGIN_MIRROR:
from_secret: plugin_mirror
DOCKER_BUILDKIT: 1
when:
event:
- pull_request
Expand Down Expand Up @@ -1516,7 +1549,7 @@ steps:
- git fetch --tags --force

- name: publish
image: techknowlogick/drone-docker:latest
image: plugins/docker:latest
pull: always
settings:
auto_tag: true
Expand All @@ -1528,13 +1561,17 @@ steps:
from_secret: docker_password
username:
from_secret: docker_username
environment:
PLUGIN_MIRROR:
from_secret: plugin_mirror
DOCKER_BUILDKIT: 1
when:
event:
exclude:
- pull_request

- name: publish-rootless
image: techknowlogick/drone-docker:latest
image: plugins/docker:latest
settings:
dockerfile: Dockerfile.rootless
auto_tag: true
Expand All @@ -1546,6 +1583,10 @@ steps:
from_secret: docker_password
username:
from_secret: docker_username
environment:
PLUGIN_MIRROR:
from_secret: plugin_mirror
DOCKER_BUILDKIT: 1
when:
event:
exclude:
Expand Down Expand Up @@ -1586,7 +1627,7 @@ steps:
- git fetch --tags --force

- name: publish
image: techknowlogick/drone-docker:latest
image: plugins/docker:latest
pull: always
settings:
tags: ${DRONE_TAG##v}-linux-arm64
Expand All @@ -1597,13 +1638,17 @@ steps:
from_secret: docker_password
username:
from_secret: docker_username
environment:
PLUGIN_MIRROR:
from_secret: plugin_mirror
DOCKER_BUILDKIT: 1
when:
event:
exclude:
- pull_request

- name: publish-rootless
image: techknowlogick/drone-docker:latest
image: plugins/docker:latest
settings:
dockerfile: Dockerfile.rootless
tags: ${DRONE_TAG##v}-linux-arm64-rootless
Expand All @@ -1614,6 +1659,10 @@ steps:
from_secret: docker_password
username:
from_secret: docker_username
environment:
PLUGIN_MIRROR:
from_secret: plugin_mirror
DOCKER_BUILDKIT: 1
when:
event:
exclude:
Expand Down Expand Up @@ -1654,7 +1703,7 @@ steps:
- git fetch --tags --force

- name: publish
image: techknowlogick/drone-docker:latest
image: plugins/docker:latest
pull: always
settings:
auto_tag: false
Expand All @@ -1666,13 +1715,17 @@ steps:
from_secret: docker_password
username:
from_secret: docker_username
environment:
PLUGIN_MIRROR:
from_secret: plugin_mirror
DOCKER_BUILDKIT: 1
when:
event:
exclude:
- pull_request

- name: publish-rootless
image: techknowlogick/drone-docker:latest
image: plugins/docker:latest
settings:
dockerfile: Dockerfile.rootless
auto_tag: false
Expand All @@ -1684,6 +1737,10 @@ steps:
from_secret: docker_password
username:
from_secret: docker_username
environment:
PLUGIN_MIRROR:
from_secret: plugin_mirror
DOCKER_BUILDKIT: 1
when:
event:
exclude:
Expand Down Expand Up @@ -1720,7 +1777,7 @@ steps:
- git fetch --tags --force

- name: publish
image: techknowlogick/drone-docker:latest
image: plugins/docker:latest
pull: always
settings:
auto_tag: false
Expand All @@ -1732,13 +1789,17 @@ steps:
from_secret: docker_password
username:
from_secret: docker_username
environment:
PLUGIN_MIRROR:
from_secret: plugin_mirror
DOCKER_BUILDKIT: 1
when:
event:
exclude:
- pull_request

- name: publish-rootless
image: techknowlogick/drone-docker:latest
image: plugins/docker:latest
settings:
dockerfile: Dockerfile.rootless
auto_tag: false
Expand All @@ -1750,6 +1811,10 @@ steps:
from_secret: docker_password
username:
from_secret: docker_username
environment:
PLUGIN_MIRROR:
from_secret: plugin_mirror
DOCKER_BUILDKIT: 1
when:
event:
exclude:
Expand Down
16 changes: 16 additions & 0 deletions custom/conf/app.example.ini
Expand Up @@ -576,6 +576,22 @@ ROUTER = console
;; The routing level will default to that of the system but individual router level can be set in
;; [log.<mode>.router] LEVEL
;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
;; Print request id which parsed from request headers in access log, when access log is enabled.
;; * E.g:
;; * In request Header: X-Request-ID: test-id-123
;; * Configuration in app.ini: REQUEST_ID_HEADERS = X-Request-ID
;; * Print in log: 127.0.0.1:58384 - - [14/Feb/2023:16:33:51 +0800] "test-id-123"
;;
;; If you configure more than one in the .ini file, it will match in the order of configuration,
;; and the first match will be finally printed in the log.
;; * E.g:
;; * In reuqest Header: X-Trace-ID: trace-id-1q2w3e4r
;; * Configuration in app.ini: REQUEST_ID_HEADERS = X-Request-ID, X-Trace-ID, X-Req-ID
;; * Print in log: 127.0.0.1:58384 - - [14/Feb/2023:16:33:51 +0800] "trace-id-1q2w3e4r"
;;
;; REQUEST_ID_HEADERS =

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
Expand Down
6 changes: 6 additions & 0 deletions docs/content/doc/advanced/config-cheat-sheet.en-us.md
Expand Up @@ -881,7 +881,13 @@ Default templates for project boards:
- `Identity`: the SignedUserName or `"-"` if not logged in.
- `Start`: the start time of the request.
- `ResponseWriter`: the responseWriter from the request.
- `RequestID`: the value matching REQUEST_ID_HEADERS(default: `-`, if not matched).
- You must be very careful to ensure that this template does not throw errors or panics as this template runs outside of the panic/recovery script.
- `REQUEST_ID_HEADERS`: **\<empty\>**: You can configure multiple values that are splited by comma here. It will match in the order of configuration, and the first match will be finally printed in the access log.
- e.g.
- In the Request Header: X-Request-ID: **test-id-123**
- Configuration in app.ini: REQUEST_ID_HEADERS = X-Request-ID
- Print in log: 127.0.0.1:58384 - - [14/Feb/2023:16:33:51 +0800] "**test-id-123**" ...

### Log subsections (`log.name`, `log.name.*`)

Expand Down
17 changes: 16 additions & 1 deletion docs/content/doc/advanced/config-cheat-sheet.zh-cn.md
Expand Up @@ -262,7 +262,22 @@ test01.xls: application/vnd.ms-excel; charset=binary

- `ROOT_PATH`: 日志文件根目录。
- `MODE`: 日志记录模式,默认是为 `console`。如果要写到多个通道,用逗号分隔
- `LEVEL`: 日志级别,默认为`Trace`
- `LEVEL`: 日志级别,默认为 `Trace`
- `DISABLE_ROUTER_LOG`: 关闭日志中的路由日志。
- `ENABLE_ACCESS_LOG`: 是否开启 Access Log, 默认为 false。
- `ACCESS_LOG_TEMPLATE`: `access.log` 输出内容的模板,默认模板:**`{{.Ctx.RemoteAddr}} - {{.Identity}} {{.Start.Format "[02/Jan/2006:15:04:05 -0700]" }} "{{.Ctx.Req.Method}} {{.Ctx.Req.URL.RequestURI}} {{.Ctx.Req.Proto}}" {{.ResponseWriter.Status}} {{.ResponseWriter.Size}} "{{.Ctx.Req.Referer}}\" \"{{.Ctx.Req.UserAgent}}"`**
模板支持以下参数:
- `Ctx`: 请求上下文。
- `Identity`: 登录用户名,默认: “`-`”。
- `Start`: 请求开始时间。
- `ResponseWriter`:
- `RequestID`: 从请求头中解析得到的与 `REQUEST_ID_HEADERS` 匹配的值,默认: “`-`”。
- 一定要谨慎配置该模板,否则可能会引起panic.
- `REQUEST_ID_HEADERS`: 从 Request Header 中匹配指定 Key,并将匹配到的值输出到 `access.log` 中(需要在 `ACCESS_LOG_TEMPLATE` 中指定输出位置)。如果在该参数中配置多个 Key, 请用逗号分割,程序将按照配置的顺序进行匹配。
- 示例:
- 请求头: X-Request-ID: **test-id-123**
- 配置文件: REQUEST_ID_HEADERS = X-Request-ID
- 日志输出: 127.0.0.1:58384 - - [14/Feb/2023:16:33:51 +0800] "**test-id-123**" ...

## Cron (`cron`)

Expand Down

0 comments on commit 60c0b06

Please sign in to comment.