Commit Graph

1677 Commits

Author SHA1 Message Date
yusing
73deb682bd fix(autocert): forceRenewalDoneCh was never closed 2026-01-04 22:02:43 +08:00
yusing
08ce58f031 fix(test): update test expectations 2026-01-04 22:02:43 +08:00
yusing
bf6d7b55f1 fix(autocert): ensure extra certificate registration and renewal scheduling
Extra providers were not being properly initialized during NewProvider(),
causing certificate registration and renewal scheduling to be skipped.

- Add ConfigExtra type with idx field for provider indexing
- Add MergeExtraConfig() for inheriting main provider settings
- Add setupExtraProviders() for recursive extra provider initialization
- Refactor NewProvider to return error and call setupExtraProviders()
- Add provider-scoped logger with "main" or "extra[N]" name
- Add batch operations: ObtainCertIfNotExistsAll(), ObtainCertAll()
- Add ForceExpiryAll() with completion tracking via WaitRenewalDone()
- Add RenewMode (force/ifNeeded) for controlling renewal behavior
- Add PrintCertExpiriesAll() for logging all provider certificate expiries

Summary of staged changes:
- config.go: Added ConfigExtra type, MergeExtraConfig(), recursive validation with path uniqueness checking
- provider.go: Added provider indexing, scoped logger, batch cert operations, force renewal with completion tracking, RenewMode control
- setup.go: New file with setupExtraProviders() for proper extra provider initialization
- setup_test.go: New tests for extra provider setup
- multi_cert_test.go: New tests for multi-certificate functionality
- renew.go: Updated to use new provider API with error handling
- state.go: Updated to handle NewProvider error return
2026-01-04 22:02:42 +08:00
yusing
da8e03258d refactor(state): replace Entrypoint method with ShortLinkMatcher interface
- Cleaned up agent go.mod by removing unused indirect dependencies.
2026-01-04 22:02:42 +08:00
Yuzerion
72e53773b0 feat(autocert): add multi-certificate support (#185)
Multi-certificate, SNI matching with exact map and suffix tree

Add support for multiple TLS certificates with SNI-based selection. The
root provider maintains a single centralized SNI matcher that uses an
exact match map for O(1) lookups, falling back to a suffix tree for
wildcard matching.

Key features:
- Add `Extra []Config` field to autocert.Config for additional certificates
- Each extra entry must specify unique `cert_path` and `key_path`
- Extra certs inherit main config (except `email` and `extra` fields)
- Extra certs participate in ACME obtain/renew cycles independently
- SNI selection precedence: exact match > wildcard match, main > extra
- Single centralized SNI matcher on root provider rebuilt after cert changes

The SNI matcher structure:
- Exact match map: O(1) lookup for exact domain matches
- Suffix tree: Efficient wildcard matching (e.g., *.example.com)

Implementation details:
- Provider.GetCert() now uses SNI from ClientHelloInfo for selection
- Main cert is returned as fallback when no SNI match is found
- Extra providers are created as child providers with merged configs
- SNI matcher is rebuilt after Setup() and after ObtainCert() completes
2026-01-04 22:02:41 +08:00
yusing
7e9e0c4511 refactor(docker): accept unix and ssh scheme for providers 2026-01-04 22:02:41 +08:00
yusing
f1d2b170e2 fix(h2c_test_server): correct listening on message 2026-01-04 22:02:40 +08:00
yusing
c026a0df7c refactor(benchmark): restart bench server after each run 2026-01-04 22:02:40 +08:00
yusing
b51d280b29 refactor(io,reverseproxy): suppress "client disconnected" error; optimize CopyClose method 2026-01-04 22:02:40 +08:00
yusing
ea030ebd19 refactor(route): modernize code with unsafe.Add 2026-01-04 22:02:39 +08:00
yusing
64ba519f03 refactor(http/transport): increase MaxIdleConnsPerHost to 1000 2026-01-04 22:02:39 +08:00
yusing
02d0a910f6 refactor(benchmark): replace whoami service with bench server
- Updated dev.compose.yml to define a new bench service that serves 4096 bytes of random data.
- Modified configurations for Traefik, Caddy, and Nginx to route traffic to the new bench service.
- Added Dockerfile and Go application for the bench server, including necessary Go modules.
- Updated benchmark script to target the new bench service endpoint.
2026-01-04 22:02:38 +08:00
yusing
5a2e327cce refactor(http/reverseproxy): performance improvement
- Replaced req.Clone with req.WithContext and url/header/trailer cloning.
- Added conditional handling for "Expect" headers to manage 1xx responses with appropriate tracing.
2026-01-04 22:02:38 +08:00
yusing
4001e94d5c refactor(http): performance improvement
- Introduced a sync.Pool for ResponseRecorder to optimize memory usage.
- Updated ServeHTTP method to utilize the new GetResponseRecorder and PutResponseRecorder functions.
- Adjusted NewResponseRecorder to leverage the pooling mechanism.
2026-01-04 22:02:37 +08:00
yusing
f8196216ad refactor(benchmark): update whoami service configuration to use FQDN alias 2026-01-04 22:02:37 +08:00
yusing
9bac45ce15 refactor(benchmark): remove unused Docker socket configuration from benchmark service 2026-01-04 22:02:36 +08:00
yusing
5c9ccd9963 refactor(benchmark): benchmark script functionality and fairness 2026-01-04 22:02:36 +08:00
yusing
7702fa6696 feat(benchmark): enhance dev.compose.yml with benchmark services and scripts
- Added benchmark services (whoami, godoxy, traefik, caddy, nginx) to dev.compose.yml.
- Introduced a new benchmark.sh script for load testing using wrk and h2load.
- Updated Makefile to include a benchmark target for easy execution of the new script.
2026-01-04 22:02:36 +08:00
yusing
30eae68a91 fix(idlewatcher): pass context to ProxmoxProvider 2026-01-04 22:02:35 +08:00
yusing
7d404ba32f refactor(config): correct logic in InitFromFile 2026-01-04 22:02:35 +08:00
yusing
72e4f8dd34 feat(websocket): update goutils - deduplicate data to avoid unnecessary traffic 2026-01-04 22:02:34 +08:00
yusing
915c5958fd chore: remove unused utils/deep_equal.go 2026-01-04 22:02:34 +08:00
yusing
ad2bfac275 refactor(api/health): simplify health info type
- Updated health-related functions to return simplified health information.
- Introduced HealthStatusString type for correct swagger and schema generation.
- Refactored HealthJSON structure to utilize the new HealthStatusString type.
2026-01-04 22:02:33 +08:00
yusing
65383c7061 refactor: add context handling in various functions
- Modified functions to accept context.Context as a parameter for better context management.
- Updated Init methods in Proxmox and Config to use the provided context.
- Adjusted UpdatePorts and NewProxmoxProvider to utilize the context for operations.
2026-01-04 22:02:33 +08:00
yusing
23ceeda402 feat(entrypoint): implement short link #177
- Added ShortLinkMatcher to handle short link routing.
- Integrated short link handling in Entrypoint.
- Introduced tests for short link matching and dispatching.
- Configured default domain suffix for subdomain aliases.
2026-01-04 22:02:33 +08:00
yusing
53dc70d15b fix(docker): update scheme validation to include 'tcp' in DockerProviderConfigDetailed 2026-01-04 22:02:32 +08:00
yusing
b8788f68f3 feat(dev): add jotty and postgres-test services to dev.compose.yml 2026-01-04 22:02:32 +08:00
yusing
0a5e8597dd refactor(monitor): include detail in service down notification log 2026-01-04 22:02:31 +08:00
yusing
739bb351bf feat(http/h2c): h2c test server with a Dockerfile
- Implemented a basic HTTP/2 server that responds with "ok" to requests.
- Updated dev.compose.yml to include a service for it
2026-01-04 22:02:31 +08:00
yusing
32dba5f5f6 feat(http): enable HTTP/2 support in server configuration
- Added NextProtos to TLSConfig to prefer HTTP/2 and fallback to HTTP/1.1.
- Configured the server to handle HTTP/2 connections, with error logging for configuration failures.
2026-01-04 22:02:30 +08:00
yusing
0884be240c feat(healthcheck/http): implement h2c health check support and refactor request handling
- Added support for health checks using the h2c scheme.
- Refactored common header setting into a dedicated function.
- Updated CheckHealth method to differentiate between HTTP and h2c checks.
2026-01-04 22:02:30 +08:00
yusing
021c560ff7 chore: update swagger add h2c scheme type 2026-01-04 22:02:29 +08:00
yusing
b6ed9abbb3 feat(http/reverseproxy): h2c support with scheme: h2c 2026-01-04 22:02:29 +08:00
yusing
ac7bf61eb3 fix(agent): improve url handling to not break urls with encoded characters 2026-01-01 10:42:40 +00:00
yusing
c12fca0cbd chore(dependencies): downgrade go-proxmox to v0.2.4 and exclude v0.3.0 2026-01-01 16:53:38 +08:00
yusing
c3f33e7c7e chore: upgrade dependencies 2026-01-01 16:47:44 +08:00
yusing
79b18828d4 feat(metrics): add IsExcluded field to RouteUptimeAggregate for enhanced status tracking
- updated swagger
2026-01-01 16:45:58 +08:00
yusing
3346c91f96 fix(homepage): improve alphabetical sorting by normalizing item names (#181)
- Updated the sorting function to use Title case for item names to ensure consistent alphabetical ordering.
2026-01-01 16:45:58 +08:00
yusing
979f712fbb fix(route): enhance host parsing with port suffix support
- Added logic to strip the trailing :port from the host when searching for routes.
- Updated findRouteByDomains function to ensure consistent host formatting.
- Added related tests
2026-01-01 16:45:57 +08:00
yusing
59648c77d8 chore(goutils): update subproject commit reference to 51a75d68 2026-01-01 16:45:57 +08:00
yusing
92848305d9 fix(route): update health monitor initialization to use implementation instance 2026-01-01 16:45:57 +08:00
yusing
0e7223ef35 fix(tests/metrics): correct syntax error 2026-01-01 16:45:51 +08:00
yusing
769a7ffc7c chore(.gitignore): add dev-data directory to ignore list 2026-01-01 16:45:51 +08:00
yusing
bea75d49c1 feat(route): add CommandRoute for routing requests to specified routes
- Introduced CommandRoute to handle routing requests to other defined routes.
- Added validation to ensure a single argument is provided for the route.
- Implemented command handler to serve the specified route or return a 404 error if not found.
2026-01-01 16:45:50 +08:00
yusing
65b38c06dc refactor(routes): add excluded routes to health check and route list
- Updated route iteration to include all routes, including excluded ones.
- Renamed existing functions for clarity.
- Adjusted health info retrieval to reflect changes in route iteration.
- Improved route management by adding health monitoring capabilities for excluded routes.
2026-01-01 16:45:50 +08:00
yusing
526190d444 refactor(docker): simplify docker host parsing 2026-01-01 16:45:46 +08:00
yusing
f89573e718 fix(oidc): add trailing slash to OIDCAuthBasePath to work with paths like /authorize 2026-01-01 16:44:52 +08:00
yusing
2c22fd6d4e chore(swagger): add installation instruction for swaggo in Makefile 2026-01-01 16:44:51 +08:00
yusing
1c245e61e4 chore(swagger): update swagger regarding new docker config structure 2026-01-01 16:44:51 +08:00
yusing
1687f1d6b9 refactor(docker): update TLS config validation to require both CertFile and KeyFile exists or both empty 2026-01-01 16:44:50 +08:00