[PR #945] [MERGED] v0.4 multiprocessing lego & http-01 pre-work #1082

Closed
opened 2026-03-03 01:07:37 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/certimate-go/certimate/pull/945
Author: @fudiwei
Created: 9/1/2025
Status: Merged
Merged: 9/3/2025
Merged by: @fudiwei

Base: nextHead: dev


📝 Commits (10+)

  • 9090742 refactor(ui): clean code
  • d9a46b3 refactor: clean code
  • b8c612e refactor: certapply
  • f98597a chore(deps): upgrade go mod dependencies
  • a5ae2fc feat: redirect lego logging
  • 4ad5ad4 fix(ui): system logs overflow
  • 264205e chore(deps): upgrade npm dependencies
  • e1fc2ba feat: use lego with multi-processing
  • f7aed27 fix(ui): status not realtime changed in WorkflowRunDetail
  • a7cb3dc chore(ui): improve i18n

📊 Changes

206 files changed (+3103 additions, -2422 deletions)

View changed files

cmd/intercmd.go (+93 -0)
📝 go.mod (+34 -33)
📝 go.sum (+77 -180)
internal/applicant/acme_ca.go (+0 -31)
internal/applicant/acme_user.go (+0 -206)
internal/applicant/applicant.go (+0 -279)
internal/applicant/applicant_test.go (+0 -44)
internal/applicant/providers.go (+0 -44)
internal/certapply/account.go (+114 -0)
📝 internal/certapply/applicators/registry.go (+7 -8)
📝 internal/certapply/applicators/sp_acmehttpreq.go (+6 -6)
📝 internal/certapply/applicators/sp_aliyun_dns.go (+4 -4)
📝 internal/certapply/applicators/sp_aliyun_esa.go (+5 -5)
📝 internal/certapply/applicators/sp_aws_route53.go (+6 -6)
📝 internal/certapply/applicators/sp_azure_dns.go (+6 -6)
📝 internal/certapply/applicators/sp_baiducloud_dns.go (+4 -4)
📝 internal/certapply/applicators/sp_bunny.go (+3 -3)
📝 internal/certapply/applicators/sp_cloudflare.go (+4 -4)
📝 internal/certapply/applicators/sp_cloudns.go (+4 -4)
📝 internal/certapply/applicators/sp_cmcccloud_dns.go (+4 -4)

...and 80 more files

📄 Description

该 PR 包含以下内容变更:

  • feat: 多进程执行 lego 相关业务,以便记录 lego 相关日志(见备注)。
  • feat: HTTP-01 质询的准备工作,预留相关后端接口。
  • fix: 修复工作流运行详情 UI 中的运行状态未能实时刷新的问题。

备注

关于多进程

截止此 PR 发起时,lego 只提供了输出到 stderr 简单的日志能力。虽然可通过自定义日志器的方式记录日志,但其本身不区分调用者,对于 certimate 这样需要并发调用 lego 来申请证书的场景,无法满足将日志准确与相应工作流运行相关联的需要。在之前的版本中,用户必须通过命令行终端才能查看 lego 的相关日志。

因此,此 PR 封装了多进程执行指令的能力,将调用 lego 的相关逻辑转移到子进程中执行,这样可以通过重定向子进程 stdout、stderr 的方式来实现上述的日志记录需求。

由于多进程会产生一些额外的系统开销,对于对此敏感的部分用户,仍可以通过指定环境变量 CERTIMATE_WORKFLOW_MULTIPROC=0 来禁用多进程模式。禁用后的 lego 日志记录方式与之前版本保持一致。


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/certimate-go/certimate/pull/945 **Author:** [@fudiwei](https://github.com/fudiwei) **Created:** 9/1/2025 **Status:** ✅ Merged **Merged:** 9/3/2025 **Merged by:** [@fudiwei](https://github.com/fudiwei) **Base:** `next` ← **Head:** `dev` --- ### 📝 Commits (10+) - [`9090742`](https://github.com/certimate-go/certimate/commit/90907427baf062ecba61c568e4447e745b0a9cac) refactor(ui): clean code - [`d9a46b3`](https://github.com/certimate-go/certimate/commit/d9a46b32fb9fc3e92b46d629d9183a222b1e32a2) refactor: clean code - [`b8c612e`](https://github.com/certimate-go/certimate/commit/b8c612eba6caa09c16faacf42b13848142363eda) refactor: certapply - [`f98597a`](https://github.com/certimate-go/certimate/commit/f98597a35f8d9f065e94ea433585be4c4ce9ff05) chore(deps): upgrade go mod dependencies - [`a5ae2fc`](https://github.com/certimate-go/certimate/commit/a5ae2fcdb961e7320930a774f9724992d3b52a73) feat: redirect lego logging - [`4ad5ad4`](https://github.com/certimate-go/certimate/commit/4ad5ad40c27ad9bf736c39318d8548b68ee19da2) fix(ui): system logs overflow - [`264205e`](https://github.com/certimate-go/certimate/commit/264205e5e8faa769b9fc7910cf36d7e4fcc8b706) chore(deps): upgrade npm dependencies - [`e1fc2ba`](https://github.com/certimate-go/certimate/commit/e1fc2ba9c92d5f098817b3e39eeb5b3ee8bda7d9) feat: use lego with multi-processing - [`f7aed27`](https://github.com/certimate-go/certimate/commit/f7aed27cd094fc68d5b890c45ab65e26848d9ed0) fix(ui): status not realtime changed in WorkflowRunDetail - [`a7cb3dc`](https://github.com/certimate-go/certimate/commit/a7cb3dccff1b65ecf70cab531226bb420acd9372) chore(ui): improve i18n ### 📊 Changes **206 files changed** (+3103 additions, -2422 deletions) <details> <summary>View changed files</summary> ➕ `cmd/intercmd.go` (+93 -0) 📝 `go.mod` (+34 -33) 📝 `go.sum` (+77 -180) ➖ `internal/applicant/acme_ca.go` (+0 -31) ➖ `internal/applicant/acme_user.go` (+0 -206) ➖ `internal/applicant/applicant.go` (+0 -279) ➖ `internal/applicant/applicant_test.go` (+0 -44) ➖ `internal/applicant/providers.go` (+0 -44) ➕ `internal/certapply/account.go` (+114 -0) 📝 `internal/certapply/applicators/registry.go` (+7 -8) 📝 `internal/certapply/applicators/sp_acmehttpreq.go` (+6 -6) 📝 `internal/certapply/applicators/sp_aliyun_dns.go` (+4 -4) 📝 `internal/certapply/applicators/sp_aliyun_esa.go` (+5 -5) 📝 `internal/certapply/applicators/sp_aws_route53.go` (+6 -6) 📝 `internal/certapply/applicators/sp_azure_dns.go` (+6 -6) 📝 `internal/certapply/applicators/sp_baiducloud_dns.go` (+4 -4) 📝 `internal/certapply/applicators/sp_bunny.go` (+3 -3) 📝 `internal/certapply/applicators/sp_cloudflare.go` (+4 -4) 📝 `internal/certapply/applicators/sp_cloudns.go` (+4 -4) 📝 `internal/certapply/applicators/sp_cmcccloud_dns.go` (+4 -4) _...and 80 more files_ </details> ### 📄 Description 该 PR 包含以下内容变更: - **feat**: 多进程执行 lego 相关业务,以便记录 lego 相关日志(见备注)。 - **feat**: HTTP-01 质询的准备工作,预留相关后端接口。 - **fix**: 修复工作流运行详情 UI 中的运行状态未能实时刷新的问题。 --- ### 备注 #### 关于多进程 截止此 PR 发起时,lego 只提供了[输出到 stderr 简单的日志能力](https://github.com/go-acme/lego/blob/8737b36c859540bf102df044bbb8e237c6de814f/log/logger.go#L9-L19)。虽然可通过自定义日志器的方式记录日志,但其本身不区分调用者,对于 certimate 这样需要并发调用 lego 来申请证书的场景,无法满足将日志准确与相应工作流运行相关联的需要。在之前的版本中,用户必须通过命令行终端才能查看 lego 的相关日志。 因此,此 PR 封装了多进程执行指令的能力,将调用 lego 的相关逻辑转移到子进程中执行,这样可以通过重定向子进程 stdout、stderr 的方式来实现上述的日志记录需求。 由于多进程会产生一些额外的系统开销,对于对此敏感的部分用户,仍可以通过指定环境变量 `CERTIMATE_WORKFLOW_MULTIPROC=0` 来禁用多进程模式。禁用后的 lego 日志记录方式与之前版本保持一致。 --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-03 01:07:37 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/certimate#1082
No description provided.