Conversation
|
Fixes #2 completely |
|
Docker image(s) for this PR are available:
Try locally: |
There was a problem hiding this comment.
Pull Request Overview
This PR modernizes the configuration system for freecaster-grid by introducing YAML-based configuration with environment variable support, restructuring the config schema with nested objects, and updating all related documentation and test files.
- Replaced flat config structure with nested schema (telegram config grouped, SSL as nested object, nodes as map instead of list)
- Added comprehensive environment variable configuration support using the
configcrate with double underscore separators - Updated all code paths to work with the new nested configuration structure and map-based node storage
Reviewed Changes
Copilot reviewed 11 out of 12 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| src/config.rs | Complete config system overhaul with new nested structures and environment variable support |
| src/main.rs | Updated config loading logic to support optional config files and new SSL structure |
| src/poller.rs | Adapted all node iteration logic for map-based storage and new telegram config structure |
| src/json_schema.rs | Added JSON schema generation feature for configuration validation |
| Cargo.toml | Added config crate dependency and JSON schema feature flag |
| README.md | Comprehensive documentation update with examples for both YAML and environment variable configuration |
| config.test*.yaml | Updated all test configs to match new nested schema format |
| config.schema.json | Generated JSON schema file for configuration validation |
| .vscode/settings.json | Added VS Code settings for optional JSON schema feature |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
…date environment variable prefix to FC_
There was a problem hiding this comment.
Pull Request Overview
Copilot reviewed 11 out of 12 changed files in this pull request and generated 6 comments.
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
|
Is there anything blocking this merge? |
This pull request introduces significant improvements to the configuration system for
freecaster-grid, adding support for flexible YAML and environment variable-based configuration, restructuring config schemas, and updating documentation and test files accordingly. The changes modernize how configuration is handled, making the application easier to deploy and manage, especially in containerized environments.Configuration System Overhaul
Replaced the old flat config structure with a nested schema:
telegramsettings are now grouped under atelegramsection, andserver.sslis now an object withcert_pathandkey_pathfields. Thenodesfield is now a map keyed by node name instead of a list.Added support for configuration via environment variables, using the
configcrate with double underscore (__) separators and case conversion, enabling full configuration without a YAML file.Updated the configuration loader to merge YAML file and environment variables, and refactored the codebase to use the new config schema throughout.
Added JSONSchema support via the
json_schemafeatureDocumentation and Example Updates
Expanded the
README.mdto document the new configuration format, including detailed examples for both YAML and environment variable usage.Updated example and test config files (
config.test.yaml,config.test2.yaml,config.test3.yaml) to match the new schema, demonstrating both SSL and telegram config nesting.Added
yaml-language-serverexample toconfig.test.yamlCodebase and Versioning
Bumped the crate version to
0.3.0and added theconfigcrate as a dependency inCargo.toml.Internal Refactors
Refactored all code paths that accessed config fields (e.g., server SSL, telegram, nodes) to use the new nested structures and map-based nodes.
These changes make configuration more robust, flexible, and maintainable, paving the way for easier deployments and future enhancements.