From 9aa5c9037d7e2dddc2ab46906bd34a23b0f7cd5b Mon Sep 17 00:00:00 2001 From: jake Date: Thu, 22 Sep 2022 13:56:28 -0400 Subject: first argument is now the config file --- TO_FIX.md | 6 ++++-- gmi.pl | 9 ++++++--- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/TO_FIX.md b/TO_FIX.md index af0e0c1..611c3c9 100644 --- a/TO_FIX.md +++ b/TO_FIX.md @@ -2,8 +2,6 @@ TODO: can log_file be written to? add systemd unit? -gmi.pl needs to accept an arguemnt, where the config.toml is located. - remove magic numbers make log output user adjustable @@ -23,3 +21,7 @@ handle signals like interrupt better recently-accepted-cert-cache for specific cert-req keys, doing a look up EACH and EVERY TIME can be expensive when it it likely that a single person will be looking around. reduce complexity in cert_req() + +permission denied when the file is readable (MAC permissions) + +use GetOpt::Long in a reasonable manner diff --git a/gmi.pl b/gmi.pl index a7610a1..d3237c4 100755 --- a/gmi.pl +++ b/gmi.pl @@ -7,7 +7,7 @@ use warnings; use 5.010; #use diagnostics; -our $VERSION = 'v0.18.3'; +our $VERSION = 'v0.19.0'; # Modules use IO::Socket::SSL; # CPAN @@ -70,8 +70,11 @@ const our @VALID_VHOST_SETTINGS => qw/auto_cert assume_index dir_listing root cert key default_mime bind ports unix redirection redirect cert_req gone/; - -my ($config, $err) = from_toml(_slurp('./config.toml')); +my $config_path = './config.toml'; +if ($ARGV[0]) { + $config_path = $ARGV[0]; +} +my ($config, $err) = from_toml(_slurp($config_path)); if ($err) { die "TOML config error: $err."; } -- cgit v1.2.3