Compare commits
6 Commits
9e11648a7c
...
v0.2.2
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e37b80a262 | ||
| 3ce62c272e | |||
| 21b771507c | |||
| 508c8b7feb | |||
|
|
33a889fa67 | ||
|
|
7ddb7812fc |
@@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
|
|||||||
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
||||||
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
||||||
|
|
||||||
|
## v0.2.2 (2025-09-30)
|
||||||
|
|
||||||
|
### Refactor
|
||||||
|
|
||||||
|
- Environment variable interpolation in config file works globally, not based on type
|
||||||
|
|
||||||
## v0.2.1 (2025-09-30)
|
## v0.2.1 (2025-09-30)
|
||||||
|
|
||||||
### Feat
|
### Feat
|
||||||
|
|||||||
Generated
+4
-4
@@ -230,7 +230,7 @@ version = "1.14.1"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "879b6c89592deb404ba4dc0ae6b58ffd1795c78991cbb5b8bc441c48a070440d"
|
checksum = "879b6c89592deb404ba4dc0ae6b58ffd1795c78991cbb5b8bc441c48a070440d"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"aws-lc-sys 0.32.1",
|
"aws-lc-sys 0.32.2",
|
||||||
"zeroize",
|
"zeroize",
|
||||||
]
|
]
|
||||||
|
|
||||||
@@ -249,9 +249,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "aws-lc-sys"
|
name = "aws-lc-sys"
|
||||||
version = "0.32.1"
|
version = "0.32.2"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "1ba2e2516bdf37af57fc6ff047855f54abad0066e5c4fdaaeb76dabb2e05bcf5"
|
checksum = "a2b715a6010afb9e457ca2b7c9d2b9c344baa8baed7b38dc476034c171b32575"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bindgen",
|
"bindgen",
|
||||||
"cc",
|
"cc",
|
||||||
@@ -1632,7 +1632,7 @@ checksum = "0cc23270f6e1808e30a928bdc84dea0b9b4136a8bc82338574f23baf47bbd280"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "gman"
|
name = "gman"
|
||||||
version = "0.2.1"
|
version = "0.2.2"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"anyhow",
|
"anyhow",
|
||||||
"argon2",
|
"argon2",
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "gman"
|
name = "gman"
|
||||||
version = "0.2.1"
|
version = "0.2.2"
|
||||||
edition = "2024"
|
edition = "2024"
|
||||||
authors = ["Alex Clarke <alex.j.tusa@gmail.com>"]
|
authors = ["Alex Clarke <alex.j.tusa@gmail.com>"]
|
||||||
description = "Universal command line secret management and injection tool"
|
description = "Universal command line secret management and injection tool"
|
||||||
|
|||||||
+2
-2
@@ -1,8 +1,8 @@
|
|||||||
use crate::command::preview_command;
|
use crate::command::preview_command;
|
||||||
use anyhow::{anyhow, Context, Result};
|
use anyhow::{Context, Result, anyhow};
|
||||||
use clap_complete::CompletionCandidate;
|
use clap_complete::CompletionCandidate;
|
||||||
use futures::future::join_all;
|
use futures::future::join_all;
|
||||||
use gman::config::{load_config, Config, RunConfig};
|
use gman::config::{Config, RunConfig, load_config};
|
||||||
use log::{debug, error};
|
use log::{debug, error};
|
||||||
use regex::Regex;
|
use regex::Regex;
|
||||||
use std::collections::HashMap;
|
use std::collections::HashMap;
|
||||||
|
|||||||
@@ -4,12 +4,12 @@ use crate::cli::secrets_completer;
|
|||||||
use anyhow::{Context, Result};
|
use anyhow::{Context, Result};
|
||||||
use clap::Subcommand;
|
use clap::Subcommand;
|
||||||
use clap::{
|
use clap::{
|
||||||
crate_authors, crate_description, crate_name, crate_version, CommandFactory, Parser, ValueEnum,
|
CommandFactory, Parser, ValueEnum, crate_authors, crate_description, crate_name, crate_version,
|
||||||
};
|
};
|
||||||
use clap_complete::{ArgValueCompleter, CompleteEnv};
|
use clap_complete::{ArgValueCompleter, CompleteEnv};
|
||||||
use crossterm::execute;
|
use crossterm::execute;
|
||||||
use crossterm::terminal::{disable_raw_mode, LeaveAlternateScreen};
|
use crossterm::terminal::{LeaveAlternateScreen, disable_raw_mode};
|
||||||
use gman::config::{get_config_file_path, load_config, Config};
|
use gman::config::{Config, get_config_file_path, load_config};
|
||||||
use std::ffi::OsString;
|
use std::ffi::OsString;
|
||||||
use std::io::{self, IsTerminal, Read, Write};
|
use std::io::{self, IsTerminal, Read, Write};
|
||||||
use std::panic::PanicHookInfo;
|
use std::panic::PanicHookInfo;
|
||||||
|
|||||||
+10
-13
@@ -300,13 +300,11 @@ pub fn load_config(interpolate: bool) -> Result<Config> {
|
|||||||
let yaml = app_dir.join("config.yaml");
|
let yaml = app_dir.join("config.yaml");
|
||||||
if yml.exists() || yaml.exists() {
|
if yml.exists() || yaml.exists() {
|
||||||
let load_path = if yml.exists() { &yml } else { &yaml };
|
let load_path = if yml.exists() { &yml } else { &yaml };
|
||||||
let mut content =
|
let mut content = fs::read_to_string(load_path)
|
||||||
fs::read_to_string(load_path).with_context(|| {
|
.with_context(|| format!("failed to read config file '{}'", load_path.display()))?;
|
||||||
format!("failed to read config file '{}'", load_path.display())
|
if interpolate {
|
||||||
})?;
|
content = interpolate_env_vars(&content);
|
||||||
if interpolate {
|
}
|
||||||
content = interpolate_env_vars(&content);
|
|
||||||
}
|
|
||||||
let cfg: Config = serde_yaml::from_str(&content).with_context(|| {
|
let cfg: Config = serde_yaml::from_str(&content).with_context(|| {
|
||||||
format!("failed to parse YAML config at '{}'", load_path.display())
|
format!("failed to parse YAML config at '{}'", load_path.display())
|
||||||
})?;
|
})?;
|
||||||
@@ -340,12 +338,11 @@ pub fn load_config(interpolate: bool) -> Result<Config> {
|
|||||||
|
|
||||||
fn load_confy_config(interpolate: bool) -> Result<Config> {
|
fn load_confy_config(interpolate: bool) -> Result<Config> {
|
||||||
let load_path = confy::get_configuration_file_path("gman", "config")?;
|
let load_path = confy::get_configuration_file_path("gman", "config")?;
|
||||||
let mut content =
|
let mut content = fs::read_to_string(&load_path)
|
||||||
fs::read_to_string(&load_path)
|
.with_context(|| format!("failed to read config file '{}'", load_path.display()))?;
|
||||||
.with_context(|| format!("failed to read config file '{}'", load_path.display()))?;
|
if interpolate {
|
||||||
if interpolate {
|
content = interpolate_env_vars(&content);
|
||||||
content = interpolate_env_vars(&content);
|
}
|
||||||
}
|
|
||||||
let cfg: Config = serde_yaml::from_str(&content)
|
let cfg: Config = serde_yaml::from_str(&content)
|
||||||
.with_context(|| format!("failed to parse YAML config at '{}'", load_path.display()))?;
|
.with_context(|| format!("failed to parse YAML config at '{}'", load_path.display()))?;
|
||||||
|
|
||||||
|
|||||||
@@ -1,14 +1,14 @@
|
|||||||
use anyhow::{anyhow, bail, Context};
|
use anyhow::{Context, anyhow, bail};
|
||||||
use secrecy::{ExposeSecret, SecretString};
|
use secrecy::{ExposeSecret, SecretString};
|
||||||
use std::collections::HashMap;
|
use std::collections::HashMap;
|
||||||
use std::path::{Path, PathBuf};
|
use std::path::{Path, PathBuf};
|
||||||
use std::{env, fs};
|
use std::{env, fs};
|
||||||
use zeroize::Zeroize;
|
use zeroize::Zeroize;
|
||||||
|
|
||||||
use crate::config::{get_config_file_path, load_config, Config};
|
use crate::config::{Config, get_config_file_path, load_config};
|
||||||
use crate::providers::git_sync::{
|
use crate::providers::git_sync::{
|
||||||
default_git_email, default_git_username, ensure_git_available, repo_name_from_url, resolve_git,
|
SyncOpts, default_git_email, default_git_username, ensure_git_available, repo_name_from_url,
|
||||||
sync_and_push, SyncOpts,
|
resolve_git, sync_and_push,
|
||||||
};
|
};
|
||||||
use crate::providers::{SecretProvider, SupportedProvider};
|
use crate::providers::{SecretProvider, SupportedProvider};
|
||||||
use crate::{
|
use crate::{
|
||||||
@@ -16,13 +16,13 @@ use crate::{
|
|||||||
};
|
};
|
||||||
use anyhow::Result;
|
use anyhow::Result;
|
||||||
use argon2::{Algorithm, Argon2, Params, Version};
|
use argon2::{Algorithm, Argon2, Params, Version};
|
||||||
use base64::{engine::general_purpose::STANDARD as B64, Engine as _};
|
use base64::{Engine as _, engine::general_purpose::STANDARD as B64};
|
||||||
use chacha20poly1305::aead::rand_core::RngCore;
|
use chacha20poly1305::aead::rand_core::RngCore;
|
||||||
use chacha20poly1305::{
|
use chacha20poly1305::{
|
||||||
aead::{Aead, KeyInit, OsRng},
|
|
||||||
Key, XChaCha20Poly1305, XNonce,
|
Key, XChaCha20Poly1305, XNonce,
|
||||||
|
aead::{Aead, KeyInit, OsRng},
|
||||||
};
|
};
|
||||||
use dialoguer::{theme, Input};
|
use dialoguer::{Input, theme};
|
||||||
use log::{debug, error};
|
use log::{debug, error};
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
use serde_with::skip_serializing_none;
|
use serde_with::skip_serializing_none;
|
||||||
|
|||||||
Reference in New Issue
Block a user