Enterprise-Onion-Toolkit/lib.d/lint.pl

53 wiersze
1.3 KiB
Perl
Executable File

#!/usr/bin/perl
# eotk (c) 2017 Alec Muffett
my %known =
(
'SSL_TOOL' => 1,
'TEMPLATE_TOOL' => 1,
# dns source domains
'DNS_DOMAIN' => 1, # site being mapped
'DNS_DOMAIN_RE' => 1, # ...with dots escaped
# onion destination addresses
'ONION_ADDRESS' => 1, # onion being mapped-to
'ONION_ADDRESS_RE' => 1, # with dots escaped
# ssl cert prefix
'CERT_PREFIX' => 1,
# template directories
'LOG_DIR' => 1, # where logs for the current project live
'SSL_DIR' => 1, # where ssl certs for the current project live
'TOR_DIR' => 1, # where the current onion is being installed; subtle
'PROJECT' => 1, # what the current project is called
'PROJECT_DIR' => 1, # where the current project is being installed
'PROJECTS_HOME' => 1, # where the projects live
# in-template settings
'NGINX_HELLO_ONION' => 1,
'NGINX_RESOLVER' => 1,
'NGINX_RLIM' => 1,
'NGINX_TEMPLATE' => 1,
'NGINX_TIMEOUT' => 1,
'NGINX_WORKERS' => 1,
'TOR_INTROS_PER_DAEMON' => 1,
'TOR_SINGLE_ONION' => 1,
'TOR_TEMPLATE' => 1,
'TOR_WORKER_DIR_PREFIX' => 1,
);
my %syms = ();
while (<>) { s/%(\w+)%/$syms{$1}++, '-'/ge; }
foreach $var (sort keys %syms) {
print "$syms{$var} $var";
print " <- *unknown*" unless ($known{$var});
print "\n";
}
exit 0;