Skip to content

Implement live configuration reload#181

Open
duaraghav8 wants to merge 14 commits intomainfrom
codex/add-auto-synced-configuration-directory
Open

Implement live configuration reload#181
duaraghav8 wants to merge 14 commits intomainfrom
codex/add-auto-synced-configuration-directory

Conversation

@duaraghav8
Copy link
Member

Motivation

  • Ensure the config-sync feature uses an absolute, well-formed default directory instead of returning a raw ~/.mcpjungle string so downstream code and consumers get a concrete path.
  • Wire up the config-sync feature end-to-end so the server can optionally manage desired-state entities from a directory, track them, and keep them live-synced.
  • Provide safe guardrails for adoption of manual entities, admin user protection, and preserving last-good state on parse/validation errors.

Description

  • Add DefaultConfigSyncDirName constant and change getConfigSyncDir() to resolve the current user home via os.UserHomeDir() and return filepath.Join(home, DefaultConfigSyncDirName) with a fallback to filepath.Join("~", DefaultConfigSyncDirName) when home resolution fails.
  • Add CLI flags --config-sync and --config-dir and env var support (MCPJUNGLE_CONFIG_SYNC_ENABLED, MCPJUNGLE_CONFIG_DIR), and wire a new configsync service into startup so it is initialized and started when enabled.
  • Introduce a ManagedConfigFile model and include it in migrations, and implement a full configsync service that resolves the config dir, ensures subdirectories, watches with fsnotify, and reconciles mcp_servers, mcp_clients, groups, and users with adoption, tracking, and error aggregation behavior.
  • Update README.md to document the auto-synced config directory feature, layout, behavior, and guardrails, and add/update unit tests for CLI helpers and config-sync behaviors.

Testing

  • Ran the focused cmd unit test go test -vet=off ./cmd -run '^TestGetConfigSyncDir$' -count=1, which passed.
  • Ran gofmt on modified files and committed the changes.

Codex Task

@duaraghav8
Copy link
Member Author

duaraghav8 commented Feb 11, 2026

addresses #142

@duaraghav8 duaraghav8 force-pushed the codex/add-auto-synced-configuration-directory branch from 8f7434b to 9e902e4 Compare February 18, 2026 09:30
@duaraghav8 duaraghav8 changed the title Fix config sync default dir to use resolved home path Implement live configuration reload Feb 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant