1 |
5b237745
|
Scott Ullrich
|
<?php
|
2 |
2af1b0c7
|
Stephen Beaver
|
/* ====================================================================
|
3 |
|
|
* Copyright (c) 2004-2015 Electric Sheep Fencing, LLC. All rights reserved.
|
4 |
|
|
*
|
5 |
|
|
* Redistribution and use in source and binary forms, with or without modification,
|
6 |
|
|
* are permitted provided that the following conditions are met:
|
7 |
|
|
*
|
8 |
|
|
* 1. Redistributions of source code must retain the above copyright notice,
|
9 |
|
|
* this list of conditions and the following disclaimer.
|
10 |
|
|
*
|
11 |
|
|
* 2. Redistributions in binary form must reproduce the above copyright
|
12 |
|
|
* notice, this list of conditions and the following disclaimer in
|
13 |
|
|
* the documentation and/or other materials provided with the
|
14 |
|
|
* distribution.
|
15 |
|
|
*
|
16 |
|
|
* 3. All advertising materials mentioning features or use of this software
|
17 |
|
|
* must display the following acknowledgment:
|
18 |
|
|
* "This product includes software developed by the pfSense Project
|
19 |
|
|
* for use in the pfSense software distribution. (http://www.pfsense.org/).
|
20 |
|
|
*
|
21 |
|
|
* 4. The names "pfSense" and "pfSense Project" must not be used to
|
22 |
|
|
* endorse or promote products derived from this software without
|
23 |
|
|
* prior written permission. For written permission, please contact
|
24 |
|
|
* coreteam@pfsense.org.
|
25 |
|
|
*
|
26 |
|
|
* 5. Products derived from this software may not be called "pfSense"
|
27 |
|
|
* nor may "pfSense" appear in their names without prior written
|
28 |
|
|
* permission of the Electric Sheep Fencing, LLC.
|
29 |
|
|
*
|
30 |
|
|
* 6. Redistributions of any form whatsoever must retain the following
|
31 |
|
|
* acknowledgment:
|
32 |
|
|
*
|
33 |
|
|
* "This product includes software developed by the pfSense Project
|
34 |
|
|
* for use in the pfSense software distribution (http://www.pfsense.org/).
|
35 |
|
|
*
|
36 |
|
|
* THIS SOFTWARE IS PROVIDED BY THE pfSense PROJECT ``AS IS'' AND ANY
|
37 |
|
|
* EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
38 |
|
|
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
39 |
|
|
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE pfSense PROJECT OR
|
40 |
|
|
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
41 |
|
|
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
42 |
|
|
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
43 |
|
|
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
44 |
|
|
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
|
45 |
|
|
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
46 |
|
|
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
|
47 |
|
|
* OF THE POSSIBILITY OF SUCH DAMAGE.
|
48 |
|
|
*
|
49 |
|
|
* ====================================================================
|
50 |
|
|
*
|
51 |
|
|
*/
|
52 |
9ba87997
|
Phil Davis
|
|
53 |
523855b0
|
Scott Ullrich
|
|
54 |
43c83997
|
Phil Davis
|
// Global defines
|
55 |
523855b0
|
Scott Ullrich
|
|
56 |
43c83997
|
Phil Davis
|
// Automatic panel collapse
|
57 |
2af1b0c7
|
Stephen Beaver
|
define(COLLAPSIBLE, 0x08);
|
58 |
|
|
define(SEC_CLOSED, 0x04);
|
59 |
|
|
define(SEC_OPEN, 0x00);
|
60 |
5b237745
|
Scott Ullrich
|
|
61 |
5ea90990
|
Stephen Beaver
|
// AddPassword method defines
|
62 |
|
|
define(DMYPWD, "********");
|
63 |
|
|
|
64 |
8346b5c4
|
jim-p
|
global $g;
|
65 |
5b237745
|
Scott Ullrich
|
$g = array(
|
66 |
1180e4f0
|
Sjon Hortensius
|
"base_packages" => "siproxd",
|
67 |
0ae6daf8
|
Ermal
|
"event_address" => "unix:///var/run/check_reload_status",
|
68 |
4b96b367
|
mgrooms
|
"factory_shipped_username" => "admin",
|
69 |
46974905
|
Chris Buechler
|
"factory_shipped_password" => "pfsense",
|
70 |
1ef7b568
|
Scott Ullrich
|
"upload_path" => "/root",
|
71 |
e9e7d501
|
Matthew Grooms
|
"dhcpd_chroot_path" => "/var/dhcpd",
|
72 |
6671b7cd
|
Warren Baker
|
"unbound_chroot_path" => "/var/unbound",
|
73 |
563771b1
|
Renato Botelho
|
"var_path" => "/var",
|
74 |
e9e7d501
|
Matthew Grooms
|
"varrun_path" => "/var/run",
|
75 |
|
|
"varetc_path" => "/var/etc",
|
76 |
|
|
"vardb_path" => "/var/db",
|
77 |
|
|
"varlog_path" => "/var/log",
|
78 |
|
|
"etc_path" => "/etc",
|
79 |
|
|
"tmp_path" => "/tmp",
|
80 |
|
|
"conf_path" => "/conf",
|
81 |
|
|
"conf_default_path" => "/conf.default",
|
82 |
|
|
"cf_path" => "/cf",
|
83 |
|
|
"cf_conf_path" => "/cf/conf",
|
84 |
|
|
"www_path" => "/usr/local/www",
|
85 |
|
|
"xml_rootobj" => "pfsense",
|
86 |
|
|
"admin_group" => "admins",
|
87 |
36d0358b
|
Scott Ullrich
|
"product_name" => "pfSense",
|
88 |
70497688
|
Renato Botelho
|
"product_version" => trim(file_get_contents("/etc/version"), " \n"),
|
89 |
90a27e64
|
Chris Buechler
|
"product_copyright" => "Electric Sheep Fencing LLC",
|
90 |
2d724ce2
|
Jared Dillard
|
"product_copyright_url" => "https://pfsense.org/license",
|
91 |
2bb93345
|
Tuyan Ozipek
|
"product_copyright_years" => "2004 - ".date("Y"),
|
92 |
73113ce9
|
Ermal Luci
|
"product_website" => "www.pfsense.org",
|
93 |
1180e4f0
|
Sjon Hortensius
|
"product_website_footer" => "https://www.pfsense.org/?gui=bootstrap",
|
94 |
c57e9f90
|
Chris Buechler
|
"product_email" => "coreteam@pfsense.org",
|
95 |
3d7639eb
|
Scott Ullrich
|
"hideplatform" => false,
|
96 |
9beebb5e
|
Renato Botelho
|
"hidebackupbeforeupgrade" => false,
|
97 |
3b29612f
|
Chris Buechler
|
"disablehelpmenu" => false,
|
98 |
28181237
|
Renato Botelho
|
"disablehelpicon" => false,
|
99 |
36365f49
|
Scott Ullrich
|
"disablecrashreporter" => false,
|
100 |
f3109fac
|
Chris Buechler
|
"crashreporterurl" => "https://crashreporter.pfsense.org/crash_reporter.php",
|
101 |
e9e7d501
|
Matthew Grooms
|
"debug" => false,
|
102 |
29c0d920
|
Stephen Beaver
|
"latest_config" => "13.4",
|
103 |
e9e7d501
|
Matthew Grooms
|
"nopkg_platforms" => array("cdrom"),
|
104 |
67b0ed57
|
Chris Buechler
|
"minimum_ram_warning" => "101",
|
105 |
9f274393
|
Chris Buechler
|
"minimum_ram_warning_text" => "128 MB",
|
106 |
1180e4f0
|
Sjon Hortensius
|
"wan_interface_name" => "wan",
|
107 |
e9e7d501
|
Matthew Grooms
|
"captiveportal_path" => "/usr/local/captiveportal",
|
108 |
|
|
"captiveportal_element_path" => "/var/db/cpelements",
|
109 |
c2d0699f
|
Scott Ullrich
|
"captiveportal_element_sizelimit" => 1048576,
|
110 |
e3a13b00
|
Scott Ullrich
|
"services_dhcp_server_enable" => true,
|
111 |
8c62fa48
|
jim-p
|
"wireless_regex" => "/^(ndis|wi|ath|an|ral|ural|iwi|wlan|rum|run|bwn|zyd|mwl|bwi|ipw|iwn|malo|uath|upgt|urtw|wpi)/",
|
112 |
0bd239d9
|
Renato Botelho
|
"help_base_url" => "/help.php",
|
113 |
60ff91f1
|
Renato Botelho
|
"pkg_prefix" => "pfSense-pkg-",
|
114 |
|
|
"default_timezone" => "Etc/UTC"
|
115 |
5b237745
|
Scott Ullrich
|
);
|
116 |
|
|
|
117 |
a03e3c1f
|
Bill Marquette
|
/* IP TOS flags */
|
118 |
ec6adc21
|
Bill Marquette
|
$iptos = array("lowdelay", "throughput", "reliability");
|
119 |
a03e3c1f
|
Bill Marquette
|
|
120 |
|
|
/* TCP flags */
|
121 |
79cc9e6b
|
bcyrill
|
$tcpflags = array("syn", "ack", "fin", "rst", "psh", "urg", "ece", "cwr");
|
122 |
a03e3c1f
|
Bill Marquette
|
|
123 |
9ba87997
|
Phil Davis
|
if (file_exists("/etc/platform")) {
|
124 |
9a7f6731
|
Ermal
|
$arch = php_uname("m");
|
125 |
9633e518
|
jim-p
|
|
126 |
5779ade6
|
Renato Botelho
|
if (strstr($g['product_version'], "-RELEASE")) {
|
127 |
f5b23288
|
Renato Botelho
|
/* This is only necessary for RELEASE */
|
128 |
|
|
$arch = ($arch == "i386") ? "" : '/' . $arch;
|
129 |
|
|
/* Full installs and NanoBSD use the same update directory and manifest in 2.x */
|
130 |
|
|
$g['update_url']="https://updates.pfsense.org/_updaters{$arch}";
|
131 |
|
|
$g['update_manifest']="https://updates.pfsense.org/manifest";
|
132 |
|
|
} else {
|
133 |
|
|
/* Full installs and NanoBSD use the same update directory and manifest in 2.x */
|
134 |
|
|
$g['update_url']="https://snapshots.pfsense.org/FreeBSD_releng/10.1/{$arch}/pfSense_HEAD/.updaters/";
|
135 |
|
|
$g['update_manifest']="https://updates.pfSense.org/manifest";
|
136 |
|
|
}
|
137 |
9633e518
|
jim-p
|
|
138 |
03cc2016
|
Erik
|
$g['platform'] = trim(file_get_contents("/etc/platform"));
|
139 |
9ba87997
|
Phil Davis
|
if ($g['platform'] == "nanobsd") {
|
140 |
b4a9785a
|
jim-p
|
$g['firmware_update_text']="pfSense-*.img.gz";
|
141 |
9beebb5e
|
Renato Botelho
|
$g['hidebackupbeforeupgrade'] = true;
|
142 |
fdcd8ac7
|
jim-p
|
|
143 |
aadf2c9f
|
Scott Ullrich
|
} else {
|
144 |
b4a9785a
|
jim-p
|
$g['firmware_update_text']="pfSense-*.tgz";
|
145 |
aadf2c9f
|
Scott Ullrich
|
}
|
146 |
b24a7390
|
Scott Ullrich
|
}
|
147 |
|
|
|
148 |
3a35f55f
|
Scott Ullrich
|
/* Default sysctls */
|
149 |
1180e4f0
|
Sjon Hortensius
|
$sysctls = array("net.inet.ip.portrange.first" => "1024",
|
150 |
|
|
"net.inet.tcp.blackhole" => "2",
|
151 |
|
|
"net.inet.udp.blackhole" => "1",
|
152 |
|
|
"net.inet.ip.random_id" => "1",
|
153 |
|
|
"net.inet.tcp.drop_synfin" => "1",
|
154 |
|
|
"net.inet.ip.redirect" => "1",
|
155 |
|
|
"net.inet6.ip6.redirect" => "1",
|
156 |
20a3b436
|
Renato Botelho
|
"net.inet6.ip6.use_tempaddr" => "0",
|
157 |
|
|
"net.inet6.ip6.prefer_tempaddr" => "0",
|
158 |
1180e4f0
|
Sjon Hortensius
|
"net.inet.tcp.syncookies" => "1",
|
159 |
|
|
"net.inet.tcp.recvspace" => "65228",
|
160 |
|
|
"net.inet.tcp.sendspace" => "65228",
|
161 |
|
|
"net.inet.tcp.delayed_ack" => "0",
|
162 |
|
|
"net.inet.udp.maxdgram" => "57344",
|
163 |
|
|
"net.link.bridge.pfil_onlyip" => "0",
|
164 |
|
|
"net.link.bridge.pfil_member" => "1",
|
165 |
|
|
"net.link.bridge.pfil_bridge" => "0",
|
166 |
|
|
"net.link.tap.user_open" => "1",
|
167 |
|
|
"kern.randompid" => "347",
|
168 |
|
|
"net.inet.ip.intr_queue_maxlen" => "1000",
|
169 |
|
|
"hw.syscons.kbd_reboot" => "0",
|
170 |
|
|
"net.inet.tcp.log_debug" => "0",
|
171 |
|
|
"net.inet.tcp.tso" => "1",
|
172 |
feae85bc
|
Scott Ullrich
|
"net.inet.icmp.icmplim" => "0",
|
173 |
abe7607f
|
Scott Ullrich
|
"vfs.read_max" => "32",
|
174 |
2b7ca9b2
|
Ermal
|
"kern.ipc.maxsockbuf" => "4262144",
|
175 |
c06240db
|
Ermal
|
"net.inet.ip.process_options" => 0,
|
176 |
b2b002cd
|
Ermal
|
"kern.random.sys.harvest.interrupt" => 0,
|
177 |
|
|
"kern.random.sys.harvest.point_to_point" => 0,
|
178 |
f06ce79d
|
Ermal
|
"kern.random.sys.harvest.ethernet" => 0,
|
179 |
7d8b75ab
|
Ermal
|
"net.route.netisr_maxqlen" => 1024,
|
180 |
a3a1b24e
|
Ermal
|
"net.inet.udp.checksum" => 1,
|
181 |
2f5488df
|
Ermal
|
"net.inet.icmp.reply_from_interface" => 1,
|
182 |
ec5753e7
|
Ermal LUÇI
|
"net.inet6.ip6.rfc6204w3" => 1,
|
183 |
c46f9695
|
Ermal
|
"net.enc.out.ipsec_bpf_mask" => "0x0001",
|
184 |
|
|
"net.enc.out.ipsec_filter_mask" => "0x0001",
|
185 |
8e068605
|
Chris Buechler
|
"net.enc.in.ipsec_bpf_mask" => "0x0002",
|
186 |
|
|
"net.enc.in.ipsec_filter_mask" => "0x0002",
|
187 |
62dc93d1
|
Chris Buechler
|
"net.key.preferred_oldsa" => "0",
|
188 |
1dbe220c
|
jim-p
|
"net.inet.carp.senderr_demotion_factor" => 0, /* Do not demote CARP for interface send errors */
|
189 |
|
|
"net.pfsync.carp_demotion_factor" => 0 /* Do not demote CARP for pfsync errors */
|
190 |
feae85bc
|
Scott Ullrich
|
);
|
191 |
3a35f55f
|
Scott Ullrich
|
|
192 |
8346b5c4
|
jim-p
|
/* Include override values for the above if needed. If the file doesn't exist, don't try to load it. */
|
193 |
9ba87997
|
Phil Davis
|
if (file_exists("/etc/inc/globals_override.inc")) {
|
194 |
8346b5c4
|
jim-p
|
@include("globals_override.inc");
|
195 |
9ba87997
|
Phil Davis
|
}
|
196 |
8346b5c4
|
jim-p
|
|
197 |
16d6c1df
|
Renato Botelho
|
function platform_booting($on_console = false) {
|
198 |
285ef132
|
Ermal LUÇI
|
global $g;
|
199 |
|
|
|
200 |
9ba87997
|
Phil Davis
|
if ($g['booting'] || file_exists("{$g['varrun_path']}/booting")) {
|
201 |
|
|
if ($on_console == false || php_sapi_name() != 'fpm-fcgi') {
|
202 |
16d6c1df
|
Renato Botelho
|
return true;
|
203 |
9ba87997
|
Phil Davis
|
}
|
204 |
|
|
}
|
205 |
285ef132
|
Ermal LUÇI
|
|
206 |
|
|
return false;
|
207 |
|
|
}
|
208 |
b8d09280
|
Ermal LUÇI
|
|
209 |
9ba87997
|
Phil Davis
|
if (file_exists("{$g['cf_conf_path']}/enableserial_force")) {
|
210 |
719db60e
|
Ermal LUÇI
|
$g['enableserial_force'] = true;
|
211 |
9ba87997
|
Phil Davis
|
}
|
212 |
719db60e
|
Ermal LUÇI
|
|
213 |
1883455a
|
Ermal
|
$config_parsed = false;
|
214 |
9734b054
|
Scott Ullrich
|
|
215 |
2b7ca9b2
|
Ermal
|
?>
|