initial commit of file from CVS for e-smith-apache on Wed 12 Jul 08:48:55 BST 2023

This commit is contained in:
Brian Read
2023-07-12 08:48:55 +01:00
parent 59a683f749
commit 9a57a15f5f
177 changed files with 2648 additions and 2 deletions

View File

@@ -0,0 +1,49 @@
{
use esmith::AccountsDB;
my $db = esmith::AccountsDB->open_ro;
return "" unless $db;
foreach my $path ($db->get_all_by_prop(type => 'ProxyPass'))
{
my $key = $path->key;
my $target = $path->prop('Target');
unless (defined $target)
{
warn("No Target property specified for ProxyPath $key." .
" Skipping...");
next;
}
my $desc = $path->prop('Description');
if (defined $desc)
{
$OUT .= "# ProxyPass: $key\n";
$OUT .= "# Description: $desc\n";
}
$OUT .= "ProxyPass\t/$key\t$target\n";
$OUT .= "ProxyPassReverse\t/$key\t$target\n";
$OUT .= "<Location /$key>\n";
my $proxyHTTP = $path->prop('HTTP') || "yes";
my $proxyHTTPS = $path->prop('HTTPS') || "yes";
if ( $proxyHTTP eq "no" )
{
$OUT .= " SSLRequireSSL\n";
}
if ( $proxyHTTPS eq "no" )
{
$OUT .= ' SSLRequire (%{HTTPS} eq "NULL")' . "\n";
}
my $valid = $path->prop('ValidFrom');
if (defined $valid)
{
# Convert from comma separated list to space separated
$valid =~ s/,/ /g;
# Make sure that /32 ValidFrom specs don't cause Apache problems.
$valid =~ s:/255.255.255.255::g;
$OUT .= " Require ip $valid\n";
}
$OUT .= "</Location>\n";
}
}