Skip to content

Commit

Permalink
g3fcgen: support get udp listen addr from env
Browse files Browse the repository at this point in the history
  • Loading branch information
zh-jq-b committed Aug 16, 2023
1 parent aedc823 commit 9ae5810
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion g3fcgen/service/[email protected]
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Description=G3 X.509 Certificates Generation Service at %i

[Service]
Type=simple
EnvironmentFile=-/etc/g3fcgen/env
EnvironmentFile=-/etc/g3fcgen/%i/env
ExecStart=/usr/bin/g3fcgen -c /etc/g3fcgen/%i/main.yml -s -G %i

[Install]
Expand Down
6 changes: 6 additions & 0 deletions g3fcgen/src/opts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -172,5 +172,11 @@ pub fn parse_clap() -> anyhow::Result<Option<ProcArgs>> {
}
}

if let Some(s) = option_env!("UDP_LISTEN_ADDR") {
if let Ok(addr) = SocketAddr::from_str(s) {
proc_args.udp_addr = Some(addr);
}
}

Ok(Some(proc_args))
}

0 comments on commit 9ae5810

Please sign in to comment.