Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
O
OpnSense
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kulya
OpnSense
Commits
4ea0d90d
Commit
4ea0d90d
authored
Jul 06, 2015
by
Ad Schellevis
Committed by
Franco Fichtner
Jul 20, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
(legacy) more cleanups
parent
a43ec6c6
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
42 additions
and
50 deletions
+42
-50
rc.filter_synchronize
src/etc/rc.filter_synchronize
+23
-22
fbegin.inc
src/www/fbegin.inc
+1
-1
system_hasync.php
src/www/system_hasync.php
+18
-27
No files found.
src/etc/rc.filter_synchronize
View file @
4ea0d90d
...
...
@@ -249,6 +249,7 @@ if (file_exists('/var/run/booting')) {
}
if
(
is_array
(
$config
[
'hasync'
]))
{
$sections
=
array
();
update_filter_reload_status
(
"Building high availability information"
);
$hasync
=
$config
[
'hasync'
];
...
...
@@ -273,59 +274,59 @@ if (is_array($config['hasync'])) {
}
if
(
$hasync
[
'synchronizerules'
]
!=
""
)
{
if
(
isset
(
$hasync
[
'synchronizerules'
])
)
{
if
(
!
is_array
(
$config
[
'filter'
]))
$config
[
'filter'
]
=
array
();
$sections
[]
=
'filter'
;
}
if
(
$hasync
[
'synchronizenat'
]
!=
""
)
{
if
(
isset
(
$hasync
[
'synchronizenat'
])
)
{
if
(
!
is_array
(
$config
[
'nat'
]))
$config
[
'nat'
]
=
array
();
$sections
[]
=
'nat'
;
}
if
(
$hasync
[
'synchronizealiases'
]
!=
""
)
{
if
(
isset
(
$hasync
[
'synchronizealiases'
])
)
{
if
(
!
is_array
(
$config
[
'aliases'
]))
$config
[
'aliases'
]
=
array
();
$sections
[]
=
'aliases'
;
}
if
(
$hasync
[
'synchronizedhcpd'
]
!=
""
and
is_array
(
$config
[
'dhcpd'
]))
if
(
isset
(
$hasync
[
'synchronizedhcpd'
])
&&
is_array
(
$config
[
'dhcpd'
]))
$sections
[]
=
'dhcpd'
;
if
(
$hasync
[
'synchronizewol'
]
!=
""
)
{
if
(
isset
(
$hasync
[
'synchronizewol'
])
)
{
if
(
!
is_array
(
$config
[
'wol'
]))
$config
[
'wol'
]
=
array
();
$sections
[]
=
'wol'
;
}
if
(
$hasync
[
'synchronizestaticroutes'
]
!=
""
)
{
if
(
isset
(
$hasync
[
'synchronizestaticroutes'
])
)
{
if
(
!
is_array
(
$config
[
'staticroutes'
]))
$config
[
'staticroutes'
]
=
array
();
if
(
!
is_array
(
$config
[
'staticroutes'
][
'route'
]))
if
(
!
is
set
(
$config
[
'staticroutes'
][
'route'
])
||
!
is
_array
(
$config
[
'staticroutes'
][
'route'
]))
$config
[
'staticroutes'
][
'route'
]
=
array
();
$sections
[]
=
'staticroutes'
;
if
(
!
is_array
(
$config
[
'gateways'
]))
$config
[
'gateways'
]
=
array
();
$sections
[]
=
'gateways'
;
}
if
(
$hasync
[
'synchronizevirtualip'
]
!=
""
)
{
if
(
!
is_array
(
$config
[
'virtualip'
]))
if
(
isset
(
$hasync
[
'synchronizevirtualip'
])
)
{
if
(
!
is
set
(
$config
[
'virtualip'
])
||
!
is
_array
(
$config
[
'virtualip'
]))
$config
[
'virtualip'
]
=
array
();
$sections
[]
=
'virtualip'
;
}
if
(
$hasync
[
'synchronizelb'
]
!=
""
)
{
if
(
isset
(
$hasync
[
'synchronizelb'
])
)
{
if
(
!
is_array
(
$config
[
'load_balancer'
]))
$config
[
'load_balancer'
]
=
array
();
$sections
[]
=
'load_balancer'
;
}
if
(
$hasync
[
'synchronizeipsec'
]
!=
""
)
{
if
(
isset
(
$hasync
[
'synchronizeipsec'
])
)
{
if
(
!
is_array
(
$config
[
'ipsec'
]))
$config
[
'ipsec'
]
=
array
();
$sections
[]
=
'ipsec'
;
}
if
(
$hasync
[
'synchronizeopenvpn'
]
!=
""
)
{
if
(
!
is_array
(
$config
[
'openvpn'
]))
if
(
isset
(
$hasync
[
'synchronizeopenvpn'
])
)
{
if
(
!
is
set
(
$config
[
'openvpn'
])
||
!
is
_array
(
$config
[
'openvpn'
]))
$config
[
'openvpn'
]
=
array
();
$sections
[]
=
'openvpn'
;
}
if
(
$hasync
[
'synchronizecerts'
]
!=
""
||
$hasync
[
'synchronizeopenvpn'
]
!=
""
)
{
if
(
isset
(
$hasync
[
'synchronizecerts'
])
||
isset
(
$hasync
[
'synchronizeopenvpn'
])
)
{
if
(
!
is_array
(
$config
[
'cert'
]))
$config
[
'cert'
]
=
array
();
$sections
[]
=
'cert'
;
...
...
@@ -334,27 +335,27 @@ if (is_array($config['hasync'])) {
$config
[
'ca'
]
=
array
();
$sections
[]
=
'ca'
;
if
(
!
is_array
(
$config
[
'crl'
]))
if
(
!
is
set
(
$config
[
'crl'
])
||
!
is
_array
(
$config
[
'crl'
]))
$config
[
'crl'
]
=
array
();
$sections
[]
=
'crl'
;
}
if
(
$hasync
[
'synchronizeusers'
]
!=
""
)
{
if
(
isset
(
$hasync
[
'synchronizeusers'
])
)
{
$sections
[]
=
'user'
;
$sections
[]
=
'group'
;
}
if
(
$hasync
[
'synchronizeauthservers'
]
!=
""
)
{
if
(
isset
(
$hasync
[
'synchronizeauthservers'
])
)
{
$sections
[]
=
'authserver'
;
}
if
(
$hasync
[
'synchronizednsforwarder'
]
!=
""
and
is_array
(
$config
[
'dnsmasq'
]))
if
(
isset
(
$hasync
[
'synchronizednsforwarder'
])
&&
is_array
(
$config
[
'dnsmasq'
]))
$sections
[]
=
'dnsmasq'
;
if
(
$hasync
[
'synchronizeschedules'
]
!=
""
||
$hasync
[
'synchronizerules'
]
!=
""
)
{
if
(
!
is_array
(
$config
[
'schedules'
]))
if
(
isset
(
$hasync
[
'synchronizeschedules'
])
||
isset
(
$hasync
[
'synchronizerules'
])
)
{
if
(
!
is
set
(
$config
[
'schedules'
])
||
!
is
_array
(
$config
[
'schedules'
]))
$config
[
'schedules'
]
=
array
();
$sections
[]
=
'schedules'
;
}
if
(
$hasync
[
'synchronizecaptiveportal'
]
!=
""
and
is_array
(
$config
[
'captiveportal'
]))
if
(
isset
(
$hasync
[
'synchronizecaptiveportal'
])
&&
isset
(
$config
[
'captiveportal'
])
&&
is_array
(
$config
[
'captiveportal'
]))
$sections
[]
=
'captiveportal'
;
if
(
$hasync
[
'synchronizecaptiveportal'
]
!=
""
and
is_array
(
$config
[
'vouchers'
]))
if
(
isset
(
$hasync
[
'synchronizecaptiveportal'
])
&&
isset
(
$config
[
'vouchers'
])
&&
is_array
(
$config
[
'vouchers'
]))
$sections
[]
=
'vouchers'
;
if
(
count
(
$sections
)
<=
0
)
{
...
...
src/www/fbegin.inc
View file @
4ea0d90d
...
...
@@ -180,7 +180,7 @@ $pgtitle_output = true;
<?php
if
(
isset
(
$shortcut_section
)
&&
!
$hide_service_status
&&
!
empty
(
$shortcuts
[
$shortcut_section
][
'service'
]))
{
if
(
isset
(
$shortcut_section
)
&&
!
empty
(
$shortcuts
[
$shortcut_section
][
'service'
]))
{
$ssvc
=
array
();
switch
(
$shortcut_section
)
{
case
"openvpn"
:
...
...
src/www/system_hasync.php
View file @
4ea0d90d
...
...
@@ -31,7 +31,7 @@ require_once("guiconfig.inc");
$referer
=
(
isset
(
$_SERVER
[
'HTTP_REFERER'
])
?
$_SERVER
[
'HTTP_REFERER'
]
:
'/system_hasync.php'
);
if
(
!
is_array
(
$config
[
'hasync'
]))
{
if
(
!
is
set
(
$config
[
'hasync'
])
||
!
is
_array
(
$config
[
'hasync'
]))
{
$config
[
'hasync'
]
=
array
();
}
...
...
@@ -52,14 +52,17 @@ $checkbox_names = array('pfsyncenabled',
'synchronizestaticroutes'
,
'synchronizelb'
,
'synchronizevirtualip'
,
'synchronizetrafficshaper'
,
'synchronizednsforwarder'
,
'synchronizecaptiveportal'
);
if
(
$_POST
)
{
$pconfig
=
$_POST
;
foreach
(
$checkbox_names
as
$name
)
{
$a_hasync
[
$name
]
=
$pconfig
[
$name
]
?
$pconfig
[
$name
]
:
false
;
if
(
isset
(
$pconfig
[
$name
]))
{
$a_hasync
[
$name
]
=
$pconfig
[
$name
];
}
else
{
$a_hasync
[
$name
]
=
false
;
}
}
$a_hasync
[
'pfsyncpeerip'
]
=
$pconfig
[
'pfsyncpeerip'
];
$a_hasync
[
'pfsyncinterface'
]
=
$pconfig
[
'pfsyncinterface'
];
...
...
@@ -73,13 +76,19 @@ if ($_POST) {
}
foreach
(
$checkbox_names
as
$name
)
{
$pconfig
[
$name
]
=
$a_hasync
[
$name
];
if
(
isset
(
$a_hasync
[
$name
]))
{
$pconfig
[
$name
]
=
$a_hasync
[
$name
];
}
else
{
$pconfig
[
$name
]
=
null
;
}
}
foreach
(
array
(
'pfsyncpeerip'
,
'pfsyncinterface'
,
'synchronizetoip'
,
'username'
,
'password'
)
as
$tag
)
{
if
(
isset
(
$a_hasync
[
$tag
]))
{
$pconfig
[
$tag
]
=
$a_hasync
[
$tag
];
}
else
{
$pconfig
[
$tag
]
=
null
;
}
}
$pconfig
[
'pfsyncpeerip'
]
=
$a_hasync
[
'pfsyncpeerip'
];
$pconfig
[
'pfsyncinterface'
]
=
$a_hasync
[
'pfsyncinterface'
];
$pconfig
[
'synchronizetoip'
]
=
$a_hasync
[
'synchronizetoip'
];
$pconfig
[
'username'
]
=
$a_hasync
[
'username'
];
$pconfig
[
'password'
]
=
$a_hasync
[
'password'
];
$ifaces
=
get_configured_interface_with_descr
();
$ifaces
[
"lo0"
]
=
"loopback"
;
...
...
@@ -331,24 +340,6 @@ include("head.inc");
Automatically sync the CARP Virtual IPs to the other HA host when changes are made.
</td>
</tr>
<tr
valign=
"top"
>
<td
width=
"22%"
class=
"vncell"
>
Synchronize traffic shaper(queues)
</td>
<td
class=
"vtable"
>
<input
id=
'synchronizetrafficshaper'
type=
'checkbox'
name=
'synchronizetrafficshaper'
value=
'on'
<?php
if
(
$pconfig
[
'synchronizetrafficshaper'
]
===
"on"
)
{
echo
"checked='checked'"
;
}
?>
/>
Automatically sync the traffic shaper configuration for queues to the other HA host when changes are made.
</td>
</tr>
<tr
valign=
"top"
>
<td
width=
"22%"
class=
"vncell"
>
Synchronize traffic shaper(limiter)
</td>
<td
class=
"vtable"
>
<input
id=
'synchronizetrafficshaperlimiter'
type=
'checkbox'
name=
'synchronizetrafficshaperlimiter'
value=
'on'
<?php
if
(
$pconfig
[
'synchronizetrafficshaperlimiter'
]
===
"on"
)
{
echo
"checked='checked'"
;
}
?>
/>
Automatically sync the traffic shaper configuration for limiters to the other HA host when changes are made.
</td>
</tr>
<tr
valign=
"top"
>
<td
width=
"22%"
class=
"vncell"
>
Synchronize DNS Forwarder
</td>
<td
class=
"vtable"
>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment