mirror of
https://github.com/rkivalin/certforge.git
synced 2026-10-18 16:01:01 +00:00
Remove init command
The init command printed systemd-creds encrypt commands, but this is already covered more thoroughly in the README credential storage docs. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.6
parent
b2b470dd69
commit
4a41e60790
@@ -68,9 +68,6 @@ pub enum Command {
|
||||
/// Validate configuration file
|
||||
ConfigCheck,
|
||||
|
||||
/// Print systemd-creds encrypt commands for initial setup
|
||||
Init,
|
||||
|
||||
/// Manage ACME account
|
||||
Account {
|
||||
#[command(subcommand)]
|
||||
|
||||
-43
@@ -78,11 +78,6 @@ async fn main() -> anyhow::Result<()> {
|
||||
}
|
||||
}
|
||||
|
||||
Command::Init => {
|
||||
let config = config::Config::load(&cli.config)?;
|
||||
print_init_commands(&config);
|
||||
}
|
||||
|
||||
Command::Account { action } => {
|
||||
let config = config::Config::load(&cli.config)?;
|
||||
match action {
|
||||
@@ -258,41 +253,3 @@ async fn dane_check(
|
||||
Ok(())
|
||||
}
|
||||
|
||||
fn print_init_commands(config: &config::Config) {
|
||||
println!("# Run these commands to set up encrypted credentials.");
|
||||
println!("# Pipe the secret data into each command via stdin.\n");
|
||||
|
||||
if let Some(path) = &config.acme.account_key_credential {
|
||||
println!(
|
||||
"# ACME account key (will be auto-generated if not present)\nsystemd-creds encrypt - {}\n",
|
||||
path.display()
|
||||
);
|
||||
}
|
||||
|
||||
for (name, dns) in &config.dns {
|
||||
if let Some(path) = &dns.tsig_key_credential {
|
||||
println!(
|
||||
"# DNS TSIG key for '{name}' (zones: {:?})\nsystemd-creds encrypt - {}\n",
|
||||
dns.all_zones(),
|
||||
path.display()
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
for cert in &config.certificates {
|
||||
if let Some(path) = &cert.key_credential {
|
||||
println!(
|
||||
"# TLS private key for certificate '{}'\nsystemd-creds encrypt - {}\n",
|
||||
cert.name,
|
||||
path.display()
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
println!("# Example systemd unit LoadCredentialEncrypted directives:");
|
||||
for cert in &config.certificates {
|
||||
if let Some(path) = &cert.key_credential {
|
||||
println!("# LoadCredentialEncrypted={}-tls-key:{}", cert.name, path.display());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user