Commit Graph

1584 Commits

Author SHA1 Message Date
yusing
a54f6942ba feat(idlewatcher): add option to disable loading page 2025-12-17 10:22:09 +08:00
yusing
37e72cda57 fix(idlewatcher): improve container readiness handling in wakeFromHTTP
- Updated the wakeFromHTTP method to send a 100 Continue response to prevent client wait-header timeout.
- Implemented logic for non-HTML requests to wait for the container to become ready, returning an error message if it times out, or redirecting if successful.
- Adjusted the waitForReady method to return true upon receiving a ready notification.
2025-12-17 10:15:31 +08:00
yusing
b783ded2e7 chore(deps): upgrade dependencies 2025-12-10 17:35:27 +08:00
yusing
7d91c3548e fix(http): 'runtime error: comparing uncomparable type httputils.UnwrittenBody' 2025-12-10 17:31:59 +08:00
yusing
fde5a304e8 chore(deps): upgrade dependencies in submodules 2025-12-09 10:51:56 +08:00
yusing
21e26e2a14 fix(http): correct Unwrap method and enhance error handling in Hijack method
- Updated the Hijack method in LazyResponseModifier and ResponseModifier to return a wrapped error for unsupported hijacking.
- Added a nil check in LazyResponseModifier's Unwrap method to ensure safe access to the underlying ResponseWriter.
2025-12-09 10:51:52 +08:00
yusing
06233759d9 fix(middleware): enhance response modification handling in ServeHTTP
- Replaced ResponseModifier with new LazyResponseModifier.
- Added logic to skip modification for non-HTML content.
2025-12-09 10:51:50 +08:00
yusing
9e0c189abe fix(io): limit buffer size to 16KB to avoid high memory usage and improve context propagation 2025-12-09 10:51:48 +08:00
yusing
33180878d9 refactor(route): simplify context handling in RouteContext
- Removed unnecessary requestInternal struct and directly accessed the context field of http.Request.
- Simplified the initialization of ctxFieldOffset.
2025-12-09 10:51:46 +08:00
yusing
074b420848 refactor(config): update config structures to use strutils.Redacted for sensitive fields
- Modified Config structs in various packages to replace string fields with strutils.Redacted to prevent logging sensitive information.
- Updated serialization methods to accommodate new data types.
- Adjusted API token handling in Proxmox configuration.
2025-12-09 10:51:30 +08:00
yusing
5dfdd0c058 chore: go mod tidy 2025-12-05 16:36:18 +08:00
yusing
f2352975f5 chore: go mod tidy 2025-12-05 16:27:05 +08:00
yusing
f0e7c22216 chore(Makefile): add socket-proxy to docker build test and update build command syntax 2025-12-05 16:27:05 +08:00
yusing
e7c87bae77 refactor(http,rules): move SharedData and ResponseModifier to httputils
- implemented dependency injection for rule auth handler
2025-12-05 16:27:04 +08:00
yusing
f8b1c05a35 fix(Dockerfile): exclude goutils in mod caching stage 2025-12-05 16:27:04 +08:00
yusing
f561362530 fix(middleware): skip modify response for websocket and event-stream requests in ServeHTTP 2025-12-05 16:27:03 +08:00
yusing
0420315db6 ci: Add workflow to automatically merge main into compat on tag push 2025-12-05 16:27:00 +08:00
yusing
ecd151d1ea fix(route): nil panic when used as an idlewatcher dependency 2025-12-05 16:26:46 +08:00
yusing
716f0adc95 refactor(healthcheck): agent health check 2025-12-05 16:26:45 +08:00
yusing
4a17245e6e refactor(deps): upgrade go to 1.25.5; isolate dependencies for reverseproxy, websocket and server modules 2025-12-05 16:26:43 +08:00
yusing
682264db13 chore(example): introduce health check configuration defaults in example config 2025-12-05 16:24:44 +08:00
yusing
6e40f53a16 fix(http): handle 0 content length properly in some cases 2025-12-05 16:24:43 +08:00
yusing
714826213f fix(middleware): skip modification for HEAD requests in ModifyHTML middleware 2025-12-05 16:24:43 +08:00
yusing
429b0d9ce8 fix(http): enhance Content-Length handling in ResponseModifier
- Introduced origContentLength and bodyModified fields to track original content length and body modification status.
- Updated ContentLength and ContentLengthStr methods to return accurate content length based on body modification state.
- Adjusted Write and FlushRelease methods to ensure proper handling of Content-Length header.
- Modified middleware to use the new ContentLengthStr method.
2025-12-05 16:24:42 +08:00
yusing
a9adf79551 fix(tests): correct test expectations for middleware bypass and rules 2025-12-05 16:24:42 +08:00
yusing
9bb71ac76e refactor(labels): refine wildcard expansion logic and tests
- Added multiple test cases for the ExpandWildcard function to cover various scenarios including basic wildcards, no wildcards, empty labels, and YAML configurations.
- Improved handling of nested maps and invalid YAML inputs.
- Ensured that explicit labels and reference aliases are correctly processed and expanded.
2025-12-05 16:24:42 +08:00
yusing
65ee6d40bd refactor(healthcheck): streamline health check configuration and defaults
- Moved health check constants from common package alongside type definition.
- Updated health check configuration to use struct directly instead of pointers.
- Introduced global default health check config
2025-12-05 16:24:41 +08:00
yusing
100eac1f3c refactor(routes): simplify route exclusion check and health check defaults 2025-12-05 16:24:41 +08:00
yusing
f2e73af32f chore: update goutils 2025-12-05 16:24:29 +08:00
yusing
894cd4d982 chore(deps): upgrade go version and dependencies 2025-12-05 16:23:55 +08:00
yusing
de15dbf405 refactor: move some utility functions to goutils and update references 2025-12-05 16:21:34 +08:00
yusing
ae5063b705 chore; update goutils 2025-12-05 16:21:33 +08:00
yusing
b8052ef5ba ci: Add workflow to automatically merge main into compat on tag push 2025-11-19 15:29:17 +08:00
yusing
d2c28b12c6 ci: Add GitHub Actions workflow for compat variant 2025-11-19 15:17:53 +08:00
yusing
98eab1fb4f Revert "refactor(docker): migrate from github.com/docker/docker to github.com/moby/moby"
This reverts commit c156173757.
2025-11-19 15:11:54 +08:00
yusing
71177b0b05 Revert "fix(docker): revert to API version negotiation for Docker client"
This reverts commit 1bcaf0dab5.
2025-11-19 15:08:07 +08:00
yusing
cb642d7b32 fix(middleware): correct body mutation behavior in ServeHTTP
Refactor ServeHTTP to properly handle response body mutations by:
- Using ResponseModifier to capture response before modification
- Reading body content and allowing middleware to modify it
- Writing modified body back if changed during modification
- Ensuring proper order: RequestModifier before, ResponseModifier after next()

Previously, httputils.NewModifyResponseWriter did not correctly handle
body mutations. The new implementation captures the full response,
allows modification via modifyResponse, and properly writes back any
changes to the body.

Add BodyReader() and SetBody() methods to ResponseModifier to support
reading and replacing response body content.
v0.20.9
2025-11-17 16:32:58 +08:00
yusing
9285977495 chore(deps): upgrade dependencies 2025-11-17 15:15:06 +08:00
yusing
e00cd8a35b fix(http): add Body field to response ModifyResponseWriter to avoid nil dereference panic 2025-11-17 15:12:13 +08:00
yusing
8ac459c038 fix(rules): ignore unsupported flush errors in ResponseModifier 2025-11-17 10:59:20 +08:00
yusing
1bcaf0dab5 fix(docker): revert to API version negotiation for Docker client 2025-11-15 10:52:03 +08:00
yusing
a291a49a0e fix(swagger): update netip.Addr definition type to string 2025-11-14 22:28:29 +08:00
yusing
28fdf3d2f4 fix(types/route): update HealthCheck JSON tag to be nullable for load-balancer routes 2025-11-14 22:16:30 +08:00
yusing
84b17baf46 refactor(rules): correct json format; remove MarshalJSON from []Rules 2025-11-14 20:53:35 +08:00
yusing
06ddb178f8 fix(proxmox): handle case when no nodes are available in AvailableNodeNames function 2025-11-14 10:59:58 +08:00
yusing
61fa7d2665 chore(debug): add debug logging for bypass rules and remove for route validation 2025-11-14 10:58:55 +08:00
yusing
615521ee1c chore: update submodule goutils 2025-11-14 10:33:11 +08:00
yusing
bbe308e821 ci: add Jenkinsfile for CI pipeline and configure SonarQube analysis 2025-11-13 23:39:23 +08:00
yusing
c156173757 refactor(docker): migrate from github.com/docker/docker to github.com/moby/moby 2025-11-13 23:03:27 +08:00
yusing
b1aae1cacf fix(rule): allow manifest.json in webui rule to make PWA work properly 2025-11-13 20:51:20 +08:00