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
0e553b0a
Commit
0e553b0a
authored
Mar 21, 2016
by
Ad Schellevis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
(proxy) force restart when a cert change is detected in reconfigureAction
parent
373adce5
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
2 deletions
+15
-2
ServiceController.php
.../app/controllers/OPNsense/Proxy/Api/ServiceController.php
+15
-2
No files found.
src/opnsense/mvc/app/controllers/OPNsense/Proxy/Api/ServiceController.php
View file @
0e553b0a
...
@@ -118,6 +118,7 @@ class ServiceController extends ApiControllerBase
...
@@ -118,6 +118,7 @@ class ServiceController extends ApiControllerBase
public
function
reconfigureAction
()
public
function
reconfigureAction
()
{
{
if
(
$this
->
request
->
isPost
())
{
if
(
$this
->
request
->
isPost
())
{
$force_restart
=
false
;
// close session for long running action
// close session for long running action
$this
->
sessionClose
();
$this
->
sessionClose
();
...
@@ -126,8 +127,20 @@ class ServiceController extends ApiControllerBase
...
@@ -126,8 +127,20 @@ class ServiceController extends ApiControllerBase
$runStatus
=
$this
->
statusAction
();
$runStatus
=
$this
->
statusAction
();
// some operations can not be performed by a squid -k reconfigure,
// try to determine if we need a stop/start here
if
(
is_file
(
'/var/squid/ssl_crtd.id'
))
{
$prev_sslbump_cert
=
trim
(
file_get_contents
(
'/var/squid/ssl_crtd.id'
));
}
else
{
$prev_sslbump_cert
=
""
;
}
if
(((
string
)
$mdlProxy
->
forward
->
sslcertificate
)
!=
$prev_sslbump_cert
)
{
$force_restart
=
true
;
}
// stop squid when disabled
// stop squid when disabled
if
(
$runStatus
[
'status'
]
==
"running"
&&
$mdlProxy
->
general
->
enabled
->
__toString
()
==
0
)
{
if
(
$runStatus
[
'status'
]
==
"running"
&&
(
$mdlProxy
->
general
->
enabled
->
__toString
()
==
0
||
$force_restart
))
{
$this
->
stopAction
();
$this
->
stopAction
();
}
}
...
@@ -136,7 +149,7 @@ class ServiceController extends ApiControllerBase
...
@@ -136,7 +149,7 @@ class ServiceController extends ApiControllerBase
// (res)start daemon
// (res)start daemon
if
(
$mdlProxy
->
general
->
enabled
->
__toString
()
==
1
)
{
if
(
$mdlProxy
->
general
->
enabled
->
__toString
()
==
1
)
{
if
(
$runStatus
[
'status'
]
==
"running"
)
{
if
(
$runStatus
[
'status'
]
==
"running"
&&
!
$force_restart
)
{
$backend
->
configdRun
(
"proxy reconfigure"
);
$backend
->
configdRun
(
"proxy reconfigure"
);
}
else
{
}
else
{
$this
->
startAction
();
$this
->
startAction
();
...
...
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