initial commit of file from CVS for smeserver-openvpn-bridge on Sat Sep 7 19:57:25 AEST 2024

This commit is contained in:
Trevor Batley
2024-09-07 19:57:25 +10:00
parent d755aea606
commit 9dcb47db31
73 changed files with 14036 additions and 2 deletions

View File

@@ -0,0 +1 @@
AES-128-CBC

View File

@@ -0,0 +1 @@
disabled

View File

@@ -0,0 +1 @@
http://localhost:940/phpki/index.php?stage=dl_crl_pem

View File

@@ -0,0 +1 @@
SHA256

View File

@@ -0,0 +1 @@
1194

View File

@@ -0,0 +1 @@
public

View File

@@ -0,0 +1 @@
disabled

View File

@@ -0,0 +1 @@
PerClient

View File

@@ -0,0 +1 @@
disabled

View File

@@ -0,0 +1 @@
tap0

View File

@@ -0,0 +1 @@
service

View File

@@ -0,0 +1 @@
CrtWithPass

View File

@@ -0,0 +1,12 @@
{
my $openvpn = $DB->get('openvpn-bridge') || $DB->new_record('openvpn-bridge', {type => 'service'});
my $management = $openvpn->prop('management') || '';
# If the management interface is already defined, return nothing
return "" if ($management ne '');
# Else, we generate a random password
$pass=`/usr/bin/openssl rand -base64 20 | tr -c -d '[:alnum:]'`;
$openvpn->set_prop('management',"localhost:11194:$pass");
}

View File

@@ -0,0 +1,36 @@
{
my $openvpn = $DB->get('openvpn-bridge') || $DB->new_record('openvpn-bridge', {type => 'service'});
my $start = $openvpn->prop('startPool') || '';
my $end = $openvpn->prop('endPool') || '';
# If start and end are define, we return an empty string
return "" if ($start ne '' and $end ne '');
# Else, we compute valid address
$start = '0.0.0.10';
$end = '0.0.0.30';
$start = esmith::util::IPquadToAddr($start);
$end = esmith::util::IPquadToAddr($end);
my $netmask = esmith::util::IPquadToAddr($LocalNetmask);
my $localnet = esmith::util::IPquadToAddr($LocalIP) & $netmask;
# AND-out the host bits from the start and end ips.
# And, OR our local network with our start and end host values.
$start = $localnet | ($start & ~$netmask);
$end = $localnet | ($end & ~$netmask);
# Make sure that $start is less than $end (might not be if netmask has changed)
if ($start > $end)
{
my $temp = $start;
$start = $end;
$end = $temp;
}
$openvpn->merge_props(startPool => esmith::util::IPaddrToQuad($start),
endPool => esmith::util::IPaddrToQuad($end));
}

View File

@@ -0,0 +1,16 @@
{
#migrate cipher to Cipher that is used in all other openvpn contribs
my $opv = $DB->get('openvpn-bridge') || $DB->new_record('openvpn-bridge', {type => 'service'});
my %old2new = (
'cipher' => "Cipher",
);
for my $keyt ( keys %old2new )
{
next unless ( $opv->prop($keyt) );
my $value = $DB->get_prop_and_delete('openvpn-bridge', $keyt);
next if ( $opv->prop($old2new{$keyt}) );
$DB->set_prop('openvpn-bridge', $old2new{$keyt}, $value);
}
}