Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
I
ISPConfig 3
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
494
Issues
494
List
Boards
Labels
Service Desk
Milestones
Merge Requests
32
Merge Requests
32
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ISPConfig
ISPConfig 3
Commits
2de9fd78
Commit
2de9fd78
authored
Jan 10, 2013
by
hellkat
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
FS#2615 - Fix up ufw installation code
- This makes ufw the default if it's found
parent
e88a7a64
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
30 additions
and
21 deletions
+30
-21
install/autoupdate.php
install/autoupdate.php
+1
-1
install/install.php
install/install.php
+19
-13
install/lib/installer_base.lib.php
install/lib/installer_base.lib.php
+2
-4
install/update.php
install/update.php
+8
-3
No files found.
install/autoupdate.php
View file @
2de9fd78
...
...
@@ -285,7 +285,7 @@ $inst->configure_dbserver();
//if(@is_dir('/etc/Bastille')) {
//* Configure Firewall
swriteln
(
'Configuring Firewall'
);
$inst
->
configure_firewall
();
$inst
->
configure_
bastille_
firewall
();
//}
//** Configure ISPConfig
...
...
install/install.php
View file @
2de9fd78
...
...
@@ -257,10 +257,17 @@ if($install_mode == 'standard') {
$inst
->
configure_apps_vhost
();
//* Configure Firewall
//* Configure Bastille Firewall
$conf
[
'services'
][
'firewall'
]
=
true
;
swriteln
(
'Configuring Bastille Firewall'
);
$inst
->
configure_firewall
();
if
(
$conf
[
'ufw'
][
'installed'
]
==
true
)
{
//* Configure Ubuntu Firewall
$conf
[
'services'
][
'firewall'
]
=
true
;
swriteln
(
'Configuring Ubuntu Firewall'
);
$inst
->
configure_ufw_firewall
();
}
else
{
//* Configure Bastille Firewall
$conf
[
'services'
][
'firewall'
]
=
true
;
swriteln
(
'Configuring Bastille Firewall'
);
$inst
->
configure_bastille_firewall
();
}
//* Configure Fail2ban
if
(
$conf
[
'fail2ban'
][
'installed'
]
==
true
)
{
...
...
@@ -328,7 +335,7 @@ if($install_mode == 'standard') {
if
(
$conf
[
'bind'
][
'installed'
]
==
true
&&
$conf
[
'bind'
][
'init_script'
]
!=
''
&&
is_executable
(
$conf
[
'init_scripts'
]
.
'/'
.
$conf
[
'bind'
][
'init_script'
]))
system
(
$conf
[
'init_scripts'
]
.
'/'
.
$conf
[
'bind'
][
'init_script'
]
.
' restart &> /dev/null'
);
//if($conf['squid']['installed'] == true && $conf['squid']['init_script'] != '' && is_file($conf['init_scripts'].'/'.$conf['squid']['init_script'])) system($conf['init_scripts'].'/'.$conf['squid']['init_script'].' restart &> /dev/null');
if
(
$conf
[
'nginx'
][
'installed'
]
==
true
&&
$conf
[
'nginx'
][
'init_script'
]
!=
''
&&
is_file
(
$conf
[
'init_scripts'
]
.
'/'
.
$conf
[
'nginx'
][
'init_script'
]))
system
(
$conf
[
'init_scripts'
]
.
'/'
.
$conf
[
'nginx'
][
'init_script'
]
.
' restart &> /dev/null'
);
//
if($conf['ufw']['installed'] == true && $conf['ufw']['init_script'] != '' && is_file($conf['init_scripts'].'/'.$conf['ufw']['init_script'])) system($conf['init_scripts'].'/'.$conf['ufw']['init_script'].' restart &> /dev/null');
if
(
$conf
[
'ufw'
][
'installed'
]
==
true
&&
$conf
[
'ufw'
][
'init_script'
]
!=
''
&&
is_file
(
$conf
[
'init_scripts'
]
.
'/'
.
$conf
[
'ufw'
][
'init_script'
]))
system
(
$conf
[
'init_scripts'
]
.
'/'
.
$conf
[
'ufw'
][
'init_script'
]
.
' restart &> /dev/null'
);
}
else
{
//* In expert mode, we select the services in the following steps, only db is always available
...
...
@@ -544,18 +551,17 @@ if($install_mode == 'standard') {
//** Configure Firewall
if
(
strtolower
(
$inst
->
simple_query
(
'Configure Firewall Server'
,
array
(
'y'
,
'n'
),
'y'
))
==
'y'
)
{
//if($conf['bastille']['installed'] == true) {
//* Configure Bastille Firewall
$conf
[
'services'
][
'firewall'
]
=
true
;
swriteln
(
'Configuring Bastille Firewall'
);
$inst
->
configure_firewall
();
/*} elseif($conf['ufw']['installed'] == true) {
if
(
$conf
[
'ufw'
][
'installed'
]
==
true
)
{
//* Configure Ubuntu Firewall
$conf
[
'services'
][
'firewall'
]
=
true
;
swriteln
(
'Configuring Ubuntu Firewall'
);
$inst
->
configure_ufw_firewall
();
}
else
{
//* Configure Bastille Firewall
$conf
[
'services'
][
'firewall'
]
=
true
;
swriteln
(
'Configuring Bastille Firewall'
);
$inst
->
configure_bastille_firewall
();
}
*/
}
//** Configure Firewall
...
...
@@ -622,4 +628,4 @@ if($install_mode == 'standard') {
echo
"Installation completed.
\n
"
;
?>
\ No newline at end of file
?>
install/lib/installer_base.lib.php
View file @
2de9fd78
...
...
@@ -132,7 +132,7 @@ class installer_base {
if
(
is_installed
(
'named'
)
||
is_installed
(
'bind'
)
||
is_installed
(
'bind9'
))
$conf
[
'bind'
][
'installed'
]
=
true
;
if
(
is_installed
(
'squid'
))
$conf
[
'squid'
][
'installed'
]
=
true
;
if
(
is_installed
(
'nginx'
))
$conf
[
'nginx'
][
'installed'
]
=
true
;
//
if(is_installed('iptables') && is_installed('ufw')) $conf['ufw']['installed'] = true;
if
(
is_installed
(
'iptables'
)
&&
is_installed
(
'ufw'
))
$conf
[
'ufw'
][
'installed'
]
=
true
;
if
(
is_installed
(
'fail2ban-server'
))
$conf
[
'fail2ban'
][
'installed'
]
=
true
;
if
(
is_installed
(
'vzctl'
))
$conf
[
'openvz'
][
'installed'
]
=
true
;
if
(
is_dir
(
"/etc/Bastille"
))
$conf
[
'bastille'
][
'installed'
]
=
true
;
...
...
@@ -1349,7 +1349,6 @@ class installer_base {
exec
(
'chown root:root '
.
$conf
[
"squid"
][
"config_dir"
]
.
'/'
.
$configfile
);
}
/*
public
function
configure_ufw_firewall
()
{
$configfile
=
'ufw.conf'
;
...
...
@@ -1359,9 +1358,8 @@ class installer_base {
exec
(
'chmod 600 /etc/ufw/ufw.conf'
);
exec
(
'chown root:root /etc/ufw/ufw.conf'
);
}
*/
public
function
configure_firewall
()
{
public
function
configure_
bastille_
firewall
()
{
global
$conf
;
$dist_init_scripts
=
$conf
[
'init_scripts'
];
...
...
install/update.php
View file @
2de9fd78
...
...
@@ -341,10 +341,15 @@ if($reconfigure_services_answer == 'yes') {
if
(
$conf
[
'services'
][
'firewall'
])
{
if
(
$conf
[
'bastille'
][
'installed'
]
==
true
)
{
if
(
$conf
[
'ufw'
][
'installed'
]
==
true
)
{
//* Configure Ubuntu Firewall
$conf
[
'services'
][
'firewall'
]
=
true
;
swriteln
(
'Configuring Ubuntu Firewall'
);
$inst
->
configure_ufw_firewall
();
}
else
{
//* Configure Bastille Firewall
swriteln
(
'Configuring Bastille Firewall'
);
$inst
->
configure_firewall
();
$inst
->
configure_
bastille_
firewall
();
}
}
...
...
@@ -426,7 +431,7 @@ if($reconfigure_services_answer == 'yes') {
}
if
(
$conf
[
'services'
][
'firewall'
])
{
//
if($conf['ufw']['installed'] == true && $conf['ufw']['init_script'] != '' && is_executable($conf['init_scripts'].'/'.$conf['ufw']['init_script'])) system($conf['init_scripts'].'/'.$conf['ufw']['init_script'].' restart &> /dev/null');
if
(
$conf
[
'ufw'
][
'installed'
]
==
true
&&
$conf
[
'ufw'
][
'init_script'
]
!=
''
&&
is_executable
(
$conf
[
'init_scripts'
]
.
'/'
.
$conf
[
'ufw'
][
'init_script'
]))
system
(
$conf
[
'init_scripts'
]
.
'/'
.
$conf
[
'ufw'
][
'init_script'
]
.
' restart &> /dev/null'
);
}
}
...
...
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