aboutsummaryrefslogtreecommitdiffstats
path: root/client
diff options
context:
space:
mode:
authorGuilhem Moulin <guilhem@fripost.org>2021-02-25 01:41:59 +0100
committerGuilhem Moulin <guilhem@fripost.org>2021-02-25 10:30:22 +0100
commit9a8f705eddd18ccc9a24fe0e7efe6b5a87b2be09 (patch)
treeb2adb720a6201660d9000c1990e82479b4649a50 /client
parentf09c95ea97c9bdee92f7c7622689aed540373a73 (diff)
lacme: pass a temporary JSON file with the client configuration to the internal client.
So it doesn't have to parse the INI file again. Also, while lacme.conf is world-readable by default, one might restrict permissions and add private information in there, not realizing that everything, including comments, will be readable by the client.
Diffstat (limited to 'client')
-rwxr-xr-xclient8
1 files changed, 1 insertions, 7 deletions
diff --git a/client b/client
index 33189d3..8439ddb 100755
--- a/client
+++ b/client
@@ -56,8 +56,6 @@ use Date::Parse ();
use LWP::UserAgent ();
use JSON ();
-use Config::Tiny ();
-
# Clean up PATH
$ENV{PATH} = join ':', qw{/usr/bin /bin};
delete @ENV{qw/IFS CDPATH ENV BASH_ENV/};
@@ -107,11 +105,7 @@ do {
my $CONFIG = do {
my $conf = do { local $/ = undef; <$CONFFILE> };
- close $CONFFILE or die "close: $!";
- my $h = Config::Tiny::->read_string($conf) or die Config::Tiny::->errstr()."\n";
- $h->{_} //= {};
- $h->{client}->{$_} //= $h->{_}->{$_} foreach keys %{$h->{_}}; # add defaults
- $h->{client};
+ JSON::->new->decode($conf);
};
my $UA = do {
my %args = %$CONFIG;