refactor(config): preserve explicit flags with FlagsPatch and derive CLI arguments from schema (#2585)

This PR refactors EasyTier's configuration flags system across protobuf definitions, TOML/API persistence, runtime reconciliation, and the CLI.

It introduces a synthesized FlagsPatch protobuf message with optionize and pbjson support to track field presence reliably, replaces manual CLI flag boilerplate with dynamic schema-driven clap argument generation, and
establishes Flags::resolve(patch) as the single source of truth for runtime defaults.

Co-authored-by: Claude Code <noreply@anthropic.com>
This commit is contained in:
Luna YaoandClaude Code authored and GitHub committed 2026-10-10 22:11:08 +08:00
1 parent 018750a785
commit 250c2ad8d6
52 files changed
+1909 -1405

No files matched your search

+4 -2
View File
@@ -11,8 +11,8 @@ if [[ ! -f "${proto_root}/api_instance.proto" ]]; then
exit 1
fi
if [[ "$(protoc --version)" != "libprotoc 35.1" ]]; then
echo "protoc 35.1 is required" >&2
if [[ "$(protoc --version)" != "libprotoc 35.1" && "$(protoc --version)" != "libprotoc 36.1" ]]; then
echo "protoc 35.1 or 36.1 is required" >&2
exit 1
fi
if [[ "$(protoc-gen-go --version)" != "protoc-gen-go v1.36.11" ]]; then
@@ -24,6 +24,7 @@ protoc \
-I "${proto_root}" \
--go_out="${repository_root}" \
--go_opt=module=github.com/easytier/easytier/easytier-go \
--go_opt=Mannotations.proto=github.com/easytier/easytier/easytier-go/proto/easytier \
--go_opt=Mcommon.proto=github.com/easytier/easytier/easytier-go/proto/common \
--go_opt=Merror.proto=github.com/easytier/easytier/easytier-go/proto/error \
--go_opt=Macl.proto=github.com/easytier/easytier/easytier-go/proto/acl \
@@ -32,6 +33,7 @@ protoc \
--go_opt=Mapi_config.proto=github.com/easytier/easytier/easytier-go/proto/api/config \
--go_opt=Mapi_manage.proto=github.com/easytier/easytier/easytier-go/proto/api/manage \
--go_opt=Mweb.proto=github.com/easytier/easytier/easytier-go/proto/web \
"${proto_root}/annotations.proto" \
"${proto_root}/common.proto" \
"${proto_root}/error.proto" \
"${proto_root}/acl.proto" \