Skip to content

Instantly share code, notes, and snippets.

@hennevogel
Created September 4, 2017 13:31
Show Gist options
  • Save hennevogel/aa7bc30f9695eb16746fd2d92ded2b04 to your computer and use it in GitHub Desktop.
Save hennevogel/aa7bc30f9695eb16746fd2d92ded2b04 to your computer and use it in GitHub Desktop.
use Net::Domain;
use Socket;
my $frontend="frontend";
# If defined, restrict access to the backend servers (bs_repserver, bs_srcserver, bs_service)
our $ipaccess = {
'127\..*' => 'rw', # only the localhost can write to the backend
"^$ip" => 'rw', # Permit IP of FQDN
'.*' => 'worker', # build results can be delivered from any client in the network
};
# IP of the WebUI/API Server (only used for $ipaccess)
if ($frontend) {
my $frontendip = quotemeta inet_ntoa(inet_aton($frontend) || inet_aton("localhost"));
$ipaccess->{$frontendip} = 'rw' ; # in dotted.quad format
}
print "@{[ %$ipaccess ]}\n";
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment