mirror of
https://github.com/vincentmli/bpfire.git
synced 2026-04-09 18:45:54 +02:00
vpnmain.cgi: Add field for roadwarrior endpoint
This is the IP address or FQDN which will be written into Apple Configuration profiles as public peer address. Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
This commit is contained in:
@@ -889,6 +889,8 @@ WARNING: untranslated string: guardian logtarget_file = unknown string
|
||||
WARNING: untranslated string: guardian logtarget_syslog = unknown string
|
||||
WARNING: untranslated string: guardian no entries = unknown string
|
||||
WARNING: untranslated string: guardian service = unknown string
|
||||
WARNING: untranslated string: ipsec invalid ip address or fqdn for rw endpoint = Invalid IP address or FQDN for Host-to-Net Endpoint
|
||||
WARNING: untranslated string: ipsec roadwarrior endpoint = Host-to-Net Endpoint
|
||||
WARNING: untranslated string: netbios nameserver daemon = NetBIOS Nameserver Daemon
|
||||
WARNING: untranslated string: no entries = No entries at the moment.
|
||||
WARNING: untranslated string: optional = Optional
|
||||
|
||||
@@ -1144,9 +1144,11 @@ WARNING: untranslated string: ipsec connection = IPsec Connection
|
||||
WARNING: untranslated string: ipsec interface mode gre = GRE
|
||||
WARNING: untranslated string: ipsec interface mode none = - None (Default) -
|
||||
WARNING: untranslated string: ipsec interface mode vti = VTI
|
||||
WARNING: untranslated string: ipsec invalid ip address or fqdn for rw endpoint = Invalid IP address or FQDN for Host-to-Net Endpoint
|
||||
WARNING: untranslated string: ipsec mode transport = Transport
|
||||
WARNING: untranslated string: ipsec mode tunnel = Tunnel
|
||||
WARNING: untranslated string: ipsec network = IPsec network
|
||||
WARNING: untranslated string: ipsec roadwarrior endpoint = Host-to-Net Endpoint
|
||||
WARNING: untranslated string: ipsec routing table entries = IPsec Routing Table Entries
|
||||
WARNING: untranslated string: ipsec settings = IPsec Settings
|
||||
WARNING: untranslated string: iptmangles = IPTable Mangles
|
||||
|
||||
@@ -1227,9 +1227,11 @@ WARNING: untranslated string: ipsec connection = IPsec Connection
|
||||
WARNING: untranslated string: ipsec interface mode gre = GRE
|
||||
WARNING: untranslated string: ipsec interface mode none = - None (Default) -
|
||||
WARNING: untranslated string: ipsec interface mode vti = VTI
|
||||
WARNING: untranslated string: ipsec invalid ip address or fqdn for rw endpoint = Invalid IP address or FQDN for Host-to-Net Endpoint
|
||||
WARNING: untranslated string: ipsec mode transport = Transport
|
||||
WARNING: untranslated string: ipsec mode tunnel = Tunnel
|
||||
WARNING: untranslated string: ipsec network = IPsec network
|
||||
WARNING: untranslated string: ipsec roadwarrior endpoint = Host-to-Net Endpoint
|
||||
WARNING: untranslated string: ipsec routing table entries = IPsec Routing Table Entries
|
||||
WARNING: untranslated string: ipsec settings = IPsec Settings
|
||||
WARNING: untranslated string: itlb multihit = iTLB MultiHit
|
||||
|
||||
@@ -924,6 +924,8 @@ WARNING: untranslated string: guardian logtarget_file = unknown string
|
||||
WARNING: untranslated string: guardian logtarget_syslog = unknown string
|
||||
WARNING: untranslated string: guardian no entries = unknown string
|
||||
WARNING: untranslated string: guardian service = unknown string
|
||||
WARNING: untranslated string: ipsec invalid ip address or fqdn for rw endpoint = Invalid IP address or FQDN for Host-to-Net Endpoint
|
||||
WARNING: untranslated string: ipsec roadwarrior endpoint = Host-to-Net Endpoint
|
||||
WARNING: untranslated string: pakfire ago = ago.
|
||||
WARNING: untranslated string: route config changed = unknown string
|
||||
WARNING: untranslated string: routing config added = unknown string
|
||||
|
||||
@@ -1066,8 +1066,10 @@ WARNING: untranslated string: ipsec connection = IPsec Connection
|
||||
WARNING: untranslated string: ipsec interface mode gre = GRE
|
||||
WARNING: untranslated string: ipsec interface mode none = - None (Default) -
|
||||
WARNING: untranslated string: ipsec interface mode vti = VTI
|
||||
WARNING: untranslated string: ipsec invalid ip address or fqdn for rw endpoint = Invalid IP address or FQDN for Host-to-Net Endpoint
|
||||
WARNING: untranslated string: ipsec mode transport = Transport
|
||||
WARNING: untranslated string: ipsec mode tunnel = Tunnel
|
||||
WARNING: untranslated string: ipsec roadwarrior endpoint = Host-to-Net Endpoint
|
||||
WARNING: untranslated string: ipsec routing table entries = IPsec Routing Table Entries
|
||||
WARNING: untranslated string: ipsec settings = IPsec Settings
|
||||
WARNING: untranslated string: itlb multihit = iTLB MultiHit
|
||||
|
||||
@@ -1075,8 +1075,10 @@ WARNING: untranslated string: ipsec connection = IPsec Connection
|
||||
WARNING: untranslated string: ipsec interface mode gre = GRE
|
||||
WARNING: untranslated string: ipsec interface mode none = - None (Default) -
|
||||
WARNING: untranslated string: ipsec interface mode vti = VTI
|
||||
WARNING: untranslated string: ipsec invalid ip address or fqdn for rw endpoint = Invalid IP address or FQDN for Host-to-Net Endpoint
|
||||
WARNING: untranslated string: ipsec mode transport = Transport
|
||||
WARNING: untranslated string: ipsec mode tunnel = Tunnel
|
||||
WARNING: untranslated string: ipsec roadwarrior endpoint = Host-to-Net Endpoint
|
||||
WARNING: untranslated string: ipsec routing table entries = IPsec Routing Table Entries
|
||||
WARNING: untranslated string: ipsec settings = IPsec Settings
|
||||
WARNING: untranslated string: itlb multihit = iTLB MultiHit
|
||||
|
||||
@@ -1232,9 +1232,11 @@ WARNING: untranslated string: ipsec connection = IPsec Connection
|
||||
WARNING: untranslated string: ipsec interface mode gre = GRE
|
||||
WARNING: untranslated string: ipsec interface mode none = - None (Default) -
|
||||
WARNING: untranslated string: ipsec interface mode vti = VTI
|
||||
WARNING: untranslated string: ipsec invalid ip address or fqdn for rw endpoint = Invalid IP address or FQDN for Host-to-Net Endpoint
|
||||
WARNING: untranslated string: ipsec mode transport = Transport
|
||||
WARNING: untranslated string: ipsec mode tunnel = Tunnel
|
||||
WARNING: untranslated string: ipsec network = IPsec network
|
||||
WARNING: untranslated string: ipsec roadwarrior endpoint = Host-to-Net Endpoint
|
||||
WARNING: untranslated string: ipsec routing table entries = IPsec Routing Table Entries
|
||||
WARNING: untranslated string: ipsec settings = IPsec Settings
|
||||
WARNING: untranslated string: itlb multihit = iTLB MultiHit
|
||||
|
||||
@@ -1230,9 +1230,11 @@ WARNING: untranslated string: ipsec connection = IPsec Connection
|
||||
WARNING: untranslated string: ipsec interface mode gre = GRE
|
||||
WARNING: untranslated string: ipsec interface mode none = - None (Default) -
|
||||
WARNING: untranslated string: ipsec interface mode vti = VTI
|
||||
WARNING: untranslated string: ipsec invalid ip address or fqdn for rw endpoint = Invalid IP address or FQDN for Host-to-Net Endpoint
|
||||
WARNING: untranslated string: ipsec mode transport = Transport
|
||||
WARNING: untranslated string: ipsec mode tunnel = Tunnel
|
||||
WARNING: untranslated string: ipsec network = IPsec network
|
||||
WARNING: untranslated string: ipsec roadwarrior endpoint = Host-to-Net Endpoint
|
||||
WARNING: untranslated string: ipsec routing table entries = IPsec Routing Table Entries
|
||||
WARNING: untranslated string: ipsec settings = IPsec Settings
|
||||
WARNING: untranslated string: itlb multihit = iTLB MultiHit
|
||||
|
||||
@@ -1002,8 +1002,10 @@ WARNING: untranslated string: ipsec connection = IPsec Connection
|
||||
WARNING: untranslated string: ipsec interface mode gre = GRE
|
||||
WARNING: untranslated string: ipsec interface mode none = - None (Default) -
|
||||
WARNING: untranslated string: ipsec interface mode vti = VTI
|
||||
WARNING: untranslated string: ipsec invalid ip address or fqdn for rw endpoint = Invalid IP address or FQDN for Host-to-Net Endpoint
|
||||
WARNING: untranslated string: ipsec mode transport = Transport
|
||||
WARNING: untranslated string: ipsec mode tunnel = Tunnel
|
||||
WARNING: untranslated string: ipsec roadwarrior endpoint = Host-to-Net Endpoint
|
||||
WARNING: untranslated string: ipsec routing table entries = IPsec Routing Table Entries
|
||||
WARNING: untranslated string: ipsec settings = IPsec Settings
|
||||
WARNING: untranslated string: itlb multihit = iTLB MultiHit
|
||||
|
||||
@@ -40,6 +40,8 @@
|
||||
< g.dtm
|
||||
< g.lite
|
||||
< insert removable device
|
||||
< ipsec invalid ip address or fqdn for rw endpoint
|
||||
< ipsec roadwarrior endpoint
|
||||
< netbios nameserver daemon
|
||||
< no entries
|
||||
< notes
|
||||
@@ -541,10 +543,12 @@
|
||||
< ipsec interface mode gre
|
||||
< ipsec interface mode none
|
||||
< ipsec interface mode vti
|
||||
< ipsec invalid ip address or fqdn for rw endpoint
|
||||
< ipsec mode transport
|
||||
< ipsec mode tunnel
|
||||
< ipsec network
|
||||
< ipsec no connections
|
||||
< ipsec roadwarrior endpoint
|
||||
< ipsec routing table entries
|
||||
< ipsec settings
|
||||
< itlb multihit
|
||||
@@ -925,6 +929,8 @@
|
||||
< download apple profile
|
||||
< g.dtm
|
||||
< g.lite
|
||||
< ipsec invalid ip address or fqdn for rw endpoint
|
||||
< ipsec roadwarrior endpoint
|
||||
< upload fcdsl.o
|
||||
< zoneconf val vlan tag range error
|
||||
############################################################################
|
||||
@@ -1139,8 +1145,10 @@
|
||||
< ipsec interface mode gre
|
||||
< ipsec interface mode none
|
||||
< ipsec interface mode vti
|
||||
< ipsec invalid ip address or fqdn for rw endpoint
|
||||
< ipsec mode transport
|
||||
< ipsec mode tunnel
|
||||
< ipsec roadwarrior endpoint
|
||||
< ipsec routing table entries
|
||||
< ipsec settings
|
||||
< itlb multihit
|
||||
@@ -1550,8 +1558,10 @@
|
||||
< ipsec interface mode gre
|
||||
< ipsec interface mode none
|
||||
< ipsec interface mode vti
|
||||
< ipsec invalid ip address or fqdn for rw endpoint
|
||||
< ipsec mode transport
|
||||
< ipsec mode tunnel
|
||||
< ipsec roadwarrior endpoint
|
||||
< ipsec routing table entries
|
||||
< ipsec settings
|
||||
< itlb multihit
|
||||
@@ -2284,10 +2294,12 @@
|
||||
< ipsec interface mode gre
|
||||
< ipsec interface mode none
|
||||
< ipsec interface mode vti
|
||||
< ipsec invalid ip address or fqdn for rw endpoint
|
||||
< ipsec mode transport
|
||||
< ipsec mode tunnel
|
||||
< ipsec network
|
||||
< ipsec no connections
|
||||
< ipsec roadwarrior endpoint
|
||||
< ipsec routing table entries
|
||||
< ipsec settings
|
||||
< itlb multihit
|
||||
@@ -3179,10 +3191,12 @@
|
||||
< ipsec interface mode gre
|
||||
< ipsec interface mode none
|
||||
< ipsec interface mode vti
|
||||
< ipsec invalid ip address or fqdn for rw endpoint
|
||||
< ipsec mode transport
|
||||
< ipsec mode tunnel
|
||||
< ipsec network
|
||||
< ipsec no connections
|
||||
< ipsec roadwarrior endpoint
|
||||
< ipsec routing table entries
|
||||
< ipsec settings
|
||||
< itlb multihit
|
||||
@@ -3641,8 +3655,10 @@
|
||||
< ipsec interface mode gre
|
||||
< ipsec interface mode none
|
||||
< ipsec interface mode vti
|
||||
< ipsec invalid ip address or fqdn for rw endpoint
|
||||
< ipsec mode transport
|
||||
< ipsec mode tunnel
|
||||
< ipsec roadwarrior endpoint
|
||||
< ipsec routing table entries
|
||||
< ipsec settings
|
||||
< itlb multihit
|
||||
|
||||
@@ -26,6 +26,7 @@ use File::Copy;
|
||||
use File::Temp qw/ tempfile tempdir /;
|
||||
use strict;
|
||||
use Sort::Naturally;
|
||||
use Sys::Hostname;
|
||||
# enable only the following on debugging purpose
|
||||
#use warnings;
|
||||
#use CGI::Carp 'fatalsToBrowser';
|
||||
@@ -112,6 +113,7 @@ $cgiparams{'ROOTCERT_EMAIL'} = '';
|
||||
$cgiparams{'ROOTCERT_OU'} = '';
|
||||
$cgiparams{'ROOTCERT_CITY'} = '';
|
||||
$cgiparams{'ROOTCERT_STATE'} = '';
|
||||
$cgiparams{'RW_ENDPOINT'} = '';
|
||||
$cgiparams{'RW_NET'} = '';
|
||||
$cgiparams{'DPD_DELAY'} = '30';
|
||||
$cgiparams{'DPD_TIMEOUT'} = '120';
|
||||
@@ -507,12 +509,18 @@ if ($ENV{"REMOTE_ADDR"} eq "") {
|
||||
if ($cgiparams{'ACTION'} eq $Lang::tr{'save'} && $cgiparams{'TYPE'} eq '' && $cgiparams{'KEY'} eq '') {
|
||||
&General::readhash("${General::swroot}/vpn/settings", \%vpnsettings);
|
||||
|
||||
if ($cgiparams{'RW_ENDPOINT'} ne '' && !&General::validip($cgiparams{'RW_ENDPOINT'}) && !&General::validfqdn($cgiparams{'RW_ENDPOINT'})) {
|
||||
$errormessage = $Lang::tr{'ipsec invalid ip address or fqdn for rw endpoint'};
|
||||
goto SAVE_ERROR;
|
||||
}
|
||||
|
||||
if ( $cgiparams{'RW_NET'} ne '' and !&General::validipandmask($cgiparams{'RW_NET'}) ) {
|
||||
$errormessage = $Lang::tr{'urlfilter invalid ip or mask error'};
|
||||
goto SAVE_ERROR;
|
||||
}
|
||||
|
||||
$vpnsettings{'ENABLED'} = $cgiparams{'ENABLED'};
|
||||
$vpnsettings{'RW_ENDPOINT'} = $cgiparams{'RW_ENDPOINT'};
|
||||
$vpnsettings{'RW_NET'} = $cgiparams{'RW_NET'};
|
||||
&General::writehash("${General::swroot}/vpn/settings", \%vpnsettings);
|
||||
&writeipsecfiles();
|
||||
@@ -1182,6 +1190,10 @@ END
|
||||
|
||||
# Export Apple profile to browser
|
||||
} elsif ($cgiparams{'ACTION'} eq $Lang::tr{'download apple profile'}) {
|
||||
# Read global configuration
|
||||
&General::readhash("${General::swroot}/vpn/settings", \%vpnsettings);
|
||||
|
||||
# Read connections
|
||||
&General::readhasharray("${General::swroot}/vpn/config", \%confighash);
|
||||
my $key = $cgiparams{'KEY'};
|
||||
|
||||
@@ -1209,6 +1221,9 @@ END
|
||||
print "Content-Disposition: attachment; filename=" . $confighash{$key}[1] . ".mobileconfig\n";
|
||||
print "\n"; # end headers
|
||||
|
||||
# Use our own FQDN if nothing else is configured
|
||||
my $endpoint = ($vpnsettings{'RW_ENDPOINT'} ne "") ? $vpnsettings{'RW_ENDPOINT'} : &hostname();
|
||||
|
||||
print "<!DOCTYPE plist PUBLIC \"-//Apple//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">\n";
|
||||
print "<plist version=\"1.0\">\n";
|
||||
print " <dict>\n";
|
||||
@@ -1240,7 +1255,7 @@ END
|
||||
print " <key>IKEv2</key>\n";
|
||||
print " <dict>\n";
|
||||
print " <key>RemoteAddress</key>\n";
|
||||
print " <string>18.206.152.26</string>\n";
|
||||
print " <string>$endpoint</string>\n";
|
||||
|
||||
# Left ID
|
||||
if ($confighash{$key}[9]) {
|
||||
@@ -3081,6 +3096,10 @@ EOF
|
||||
<input type='checkbox' name='ENABLED' $checked{'ENABLED'} />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class='base' nowrap='nowrap' width="60%">$Lang::tr{'ipsec roadwarrior endpoint'}:</td>
|
||||
<td width="40%"><input type='text' name='RW_ENDPOINT' value='$cgiparams{'RW_ENDPOINT'}' /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class='base' nowrap='nowrap' width="60%">$Lang::tr{'host to net vpn'}:</td>
|
||||
<td width="40%"><input type='text' name='RW_NET' value='$cgiparams{'RW_NET'}' /></td>
|
||||
|
||||
@@ -1550,10 +1550,12 @@
|
||||
'ipsec interface mode gre' => 'GRE',
|
||||
'ipsec interface mode none' => '- None (Default) -',
|
||||
'ipsec interface mode vti' => 'VTI',
|
||||
'ipsec invalid ip address or fqdn for rw endpoint' => 'Invalid IP address or FQDN for Host-to-Net Endpoint',
|
||||
'ipsec mode transport' => 'Transport',
|
||||
'ipsec mode tunnel' => 'Tunnel',
|
||||
'ipsec network' => 'IPsec network',
|
||||
'ipsec no connections' => 'No active IPsec connections',
|
||||
'ipsec roadwarrior endpoint' => 'Host-to-Net Endpoint',
|
||||
'ipsec routing table entries' => 'IPsec Routing Table Entries',
|
||||
'ipsec settings' => 'IPsec Settings',
|
||||
'iptable rules' => 'IPTable rules',
|
||||
|
||||
Reference in New Issue
Block a user