| Crates.io | confguard |
| lib.rs | confguard |
| version | 3.2.0 |
| created_at | 2025-07-03 21:23:14.890893+00 |
| updated_at | 2025-07-03 21:23:14.890893+00 |
| description | Guard your sensitive configuration files |
| homepage | |
| repository | https://github.com/sysid/rs-cg |
| max_upload_size | |
| id | 1737047 |
| size | 295,024 |
A Rust-based configuration management tool for securing and managing environment files across different deployment stages.
ConfGuard helps manage sensitive configuration files by:
.envrc files to a managed locationWhen guarding a project, ConfGuard automatically creates multiple environment files:
local.env - Local development environmenttest.env - Testing environmentint.env - Integration/staging environmentprod.env - Production environmentEach file contains export RUN_ENV="<environment>" to identify the active environment.
cargo install --path .
Secure an existing project with a .envrc file:
confguard guard /path/to/project
This will:
.envrc file to a secure locationDisplay information about a guarded project:
confguard show /path/to/project
Remove ConfGuard management and restore original files:
confguard unguard /path/to/project
Create a new .envrc file from template:
confguard init /path/to/project
Guard an individual file within a project:
confguard guard-one /path/to/project /path/to/file
Restore broken symbolic links:
confguard relink /path/to/dot.envrc
Convert a symbolic link back to a regular file:
confguard replace-link /path/to/link
Update IDE run configurations:
confguard fix-run-config /path/to/project
confguard sops-init [--template /path/to/template]
confguard sops-enc [--dir /path/to/directory]
confguard sops-dec [--dir /path/to/directory]
confguard sops-clean [--dir /path/to/directory]
CONFGUARD_BASE_DIR: Override default base directory (default: $HOME/xxx/rs-cg)CONFGUARD_VERSION: Override configuration versionWhen a project is guarded, files are organized as:
$CONFGUARD_BASE_DIR/
├── guarded/
│ └── <project-name-uuid>/
│ ├── dot.envrc # Original .envrc content
│ └── environments/
│ ├── local.env # export RUN_ENV="local"
│ ├── test.env # export RUN_ENV="test"
│ ├── int.env # export RUN_ENV="int"
│ └── prod.env # export RUN_ENV="prod"
└── confguard.toml # SOPS configuration
Create confguard.toml in your base directory:
gpg_key = "your-gpg-key-id"
file_extensions_enc = ["env"]
file_names_enc = ["local.env", "test.env"]
file_extensions_dec = ["enc"]
file_names_dec = []
cargo build --release
# Run all tests
cargo test -- --test-threads=1
# Run specific test module
cargo test core::guard
src/
├── cli/ # Command-line interface
├── core/ # Core guarding functionality
├── sops/ # SOPS encryption integration
├── util/ # Utility functions
└── errors.rs # Error handling with thiserror
ConfGuard uses thiserror for structured error handling, providing specific error types for different failure scenarios:
cargo test -- --test-threads=1[License information would go here]