From ef9ce6f2dfc9fcbb91e3cec0b7a2b7f7e359be5d Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Fri, 16 Jun 2017 02:03:32 +0000 Subject: view: implement optional address obfuscation This is lightly-tested and seems to work. I'm still hesitant to support this, but the alternative of receiving death threats for displaying unobfuscated addresses seems to be not worth it. --- lib/PublicInbox/Config.pm | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'lib/PublicInbox/Config.pm') diff --git a/lib/PublicInbox/Config.pm b/lib/PublicInbox/Config.pm index 323f8a1a..0597a527 100644 --- a/lib/PublicInbox/Config.pm +++ b/lib/PublicInbox/Config.pm @@ -140,6 +140,17 @@ sub _fill { my $v = $self->{"$pfx.$k"}; $rv->{$k} = $v if defined $v; } + foreach my $k (qw(obfuscate)) { + my $v = $self->{"$pfx.$k"}; + defined $v or next; + if ($v =~ /\A(?:false|no|off|0)\z/) { + $rv->{$k} = 0; + } elsif ($v =~ /\A(?:true|yes|on|1)\z/) { + $rv->{$k} = 1; + } else { + warn "Ignoring $pfx.$k=$v in config, not boolean\n"; + } + } # TODO: more arrays, we should support multi-value for # more things to encourage decentralization -- cgit v1.2.3-24-ge0c7