Commit Graph

2673 Commits

Author SHA1 Message Date
Michael Tremer
aec1c53cf1 IPsec: Do not interpret $? as error code of move()
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
Tested-by: Stefan Schantl <stefan.schantl@ipfire.org>
Signed-off-by: Arne Fitzenreiter <arne_f@ipfire.org>
2021-09-10 16:57:06 +00:00
Michael Tremer
6688e0bc7a IPsec: Fix extra whitespace in exported certificates
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
Tested-by: Stefan Schantl <stefan.schantl@ipfire.org>
Signed-off-by: Arne Fitzenreiter <arne_f@ipfire.org>
2021-09-10 16:57:06 +00:00
Adolf Belka
15db822688 wlanap.cgi: Access db.txt in place of using regdbdump on regulatory.bin
- wlanap.cgi was using regdbdump from crda to create a text based list of the
   wireless settings by country database.
- With the removal of crda as part of the removal of python2 this option could not be
   used.
- wireless-regdb also has a text based database list in the source tarball and this
   patch makes wlanap.cgi read this list into the @countrylist_cmd variable
- This needs to be tested by someone that has an IPFire system with wifi that can access
   and evaluate wlanap.cgi to confirm that this change functions as expected.
- This version changes the name of the stored text file from db.txt to regulatorydb.txt
- The command to read the data from regulatorydb.txt into @countrylist_cmd has been
   corrected

Signed-off-by: Adolf Belka <adolf.belka@ipfire.org>
Reviewed-by: Bernhard Bitsch <bbitsch@ipfire.org>
Signed-off-by: Arne Fitzenreiter <arne_f@ipfire.org>
2021-09-10 07:27:46 +00:00
Michael Tremer
bc464ecd5c proxy.cgi: Use sane check for subnet
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Signed-off-by: Arne Fitzenreiter <arne_f@ipfire.org>
2021-09-05 18:01:54 +00:00
Michael Tremer
ee4b5bbb2d proxy.cgi: Support running proxy without GREEN
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Signed-off-by: Arne Fitzenreiter <arne_f@ipfire.org>
2021-09-05 18:01:36 +00:00
Leo-Andres Hofmann
fd7a022630 rrd graphs: Switch to SVG output format
The vector graphics can be scaled without becoming blurred.

Signed-off-by: Leo-Andres Hofmann <hofmann@leo-andres.de>
Reviewed-by: Bernhard Bitsch <bbitsch@ipfire.org>
Tested-by: Bernhard Bitsch <bbitsch@ipfire.org>
Signed-off-by: Arne Fitzenreiter <arne_f@ipfire.org>
2021-09-05 17:52:16 +00:00
Stefan Schantl
c4522a1764 qos.cgi: Fix truncated status output
In the past only the fist line of the status output has been passed
to the cleanhtml() function and displayed. Now the whole output will be
converted to a string, cleaned and displyed on the WUI again.

Fixes #12666.

Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
Reviewed-by: Bernhard Bitsch <bbitsch@ipfire.org>
Reviewed-by: Michael Tremer <michael.tremer@ipfire.org>
Signed-off-by: Arne Fitzenreiter <arne_f@ipfire.org>
2021-09-05 17:42:35 +00:00
Stefan Schantl
55da553742 firewall.cgi: Bring back check for single IP when using DNAT.
This check has been removed by commit: bbe8e009b8

So it was able to create DNAT rules with a network as target.

Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
Reviewed-by: Michael Tremer <michael.tremer@ipfire.org>
Signed-off-by: Arne Fitzenreiter <arne_f@ipfire.org>
2021-09-05 08:41:12 +00:00
Stefan Schantl
446dc99e25 firewall.cgi: Map rule if manual target address belongs to IPFire
Automatically map the rule target if a manual entered target address is
assigned to a network zone.

Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
Reviewed-by: Michael Tremer <michael.tremer@ipfire.org>
Signed-off-by: Arne Fitzenreiter <arne_f@ipfire.org>
2021-09-05 08:41:00 +00:00
Stefan Schantl
a9611629cc firewall.cgi: Allow to creating input rules from Orange to another zone.
It was not able to create a firewall rule from the orange network to a
different network address of the firewall. ( For example: Orange -> IPFire's green address)

These rules always have been handled as FORWARD rules which is totaly
wrong.

Fixes #12265.

Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
Tested-by: Peter Müller <peter.mueller@ipfire.org>
Reviewed-by: Michael Tremer <michael.tremer@ipfire.org>
Signed-off-by: Arne Fitzenreiter <arne_f@ipfire.org>
2021-09-05 08:40:45 +00:00
Leo-Andres Hofmann
fc81e493b1 qos.cgi: Fix missing translation
Fixes: #12443

Signed-off-by: Leo-Andres Hofmann <hofmann@leo-andres.de>
Reviewed-by: Michael Tremer <michael.tremer@ipfire.org>
Signed-off-by: Arne Fitzenreiter <arne_f@ipfire.org>
2021-09-05 08:39:33 +00:00
Leo-Andres Hofmann
4190b2a621 rrd graphs: Fix indentation after removing graph output
Signed-off-by: Leo-Andres Hofmann <hofmann@leo-andres.de>
Signed-off-by: Arne Fitzenreiter <arne_f@ipfire.org>
2021-09-05 08:32:17 +00:00
Leo-Andres Hofmann
05c8c10f19 rrd graphs: Remove unused individual graph output
PNG generation has been moved to getrrdimage.cgi

Signed-off-by: Leo-Andres Hofmann <hofmann@leo-andres.de>
Signed-off-by: Arne Fitzenreiter <arne_f@ipfire.org>
2021-09-05 08:32:12 +00:00
Stefan Schantl
ca1f4a07ab firewalllog.dat: Proper display protocol names.
In some cases iptables logs the protocol number instead of the name.
When accessing the logs via the WUI, this number has been displayed as used
protocol, which is very hard to read and understand.

This commit adds a new function to the general-functions.pl, which
generates a hash to translate the protocol number into the protocol
name.

Fixes #11282.

Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
Reviewed-by: Michael Tremer <michael.tremer@ipfire.org>
Reviewed-by: Bernhard Bitsch <bbitsch@ipfire.org>
Signed-off-by: Arne Fitzenreiter <arne_f@ipfire.org>
2021-09-02 09:21:16 +00:00
Leo-Andres Hofmann
e64a5b4f74 shutdown.cgi: Add "reboot with filesystem check" button
ipfirereboot.c is able to force a file system check during reboot.
This patch makes this function available in the shutdown GUI.

Signed-off-by: Leo-Andres Hofmann <hofmann@leo-andres.de>
Signed-off-by: Arne Fitzenreiter <arne_f@ipfire.org>
2021-09-02 09:11:50 +00:00
Leo-Andres Hofmann
3cc3edeca4 RRD graphs: Remove padding around graph images
The images inherited padding from the general design and
have been resized to fit the layout, resulting in blurred graphs.
This removes the padding and shows the graphs in full size.

Fixes: #12657

Signed-off-by: Leo-Andres Hofmann <hofmann@leo-andres.de>
Reviewed-by: Michael Tremer <michael.tremer@ipfire.org>
Signed-off-by: Arne Fitzenreiter <arne_f@ipfire.org>
2021-09-02 09:01:46 +00:00
Stefan Schantl
ec0ed11d71 firewall.cgi: Make checked and selected hashes private for each single function.
Some functions uses those two hashes and are altering them - making them
private will erase and fill it with new data.

Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
Signed-off-by: Arne Fitzenreiter <arne_f@ipfire.org>
2021-09-02 08:56:56 +00:00
Stefan Schantl
04b6a4baa8 firewall.cgi: Fix multiple usage of configured net or interface.
When configuring a standard network as source or target the same
interface would be pre-selected as firewall interface when editing an
existing rule.

In case an existing input rule with an configured firewall interface
should be changed, the same network device has been pre-selected in the
standard networks dropdown box.

This easily confuses users and may lead to false configurations when
saving an edited rule.

Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
Signed-off-by: Arne Fitzenreiter <arne_f@ipfire.org>
2021-09-02 08:56:42 +00:00
Stefan Schantl
0e9b164722 firewall.cgi: Remove faulty assignments for selected hash.
The removed assignments are wrong because both are trying to assign
something different to the same key and will overwrite each other.

Secondary the assignment to the hash is not needed at this place, so it
safely can be removed.

Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
Signed-off-by: Arne Fitzenreiter <arne_f@ipfire.org>
2021-09-02 08:56:07 +00:00
Peter Müller
6f36132e68 fwhosts.cgi: properly fetch configured IPsec N2N subnets
Previously, the getcolor() function did not correctly process IPsec
N2N connections with more than one remote network configured, resulting
in networks mistakenly marked as being part of a VPN connection, or vice
versa.

Fixes: #11235

Signed-off-by: Peter Müller <peter.mueller@ipfire.org>
Acked-by: Stefan Schantl <stefan.schantl@ipfire.org>
Reviewed-by: Michael Tremer <michael.tremer@ipfire.org>
Signed-off-by: Arne Fitzenreiter <arne_f@ipfire.org>
2021-08-09 07:50:57 +00:00
Michael Tremer
c64dc3bef5 vpnmain.cgi: Join certificate output before &Header::cleanhtml();
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2021-07-13 15:33:49 +00:00
Michael Tremer
b71a7fb97d Partially revert "vpnmain.cgi: Use new system methods"
This reverts commit a81cbf6127.

It was no longer possible to generate the root/host certificates.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2021-07-13 15:33:42 +00:00
Michael Tremer
8c946d1c0a ovpnmain.cgi: Join certificate output before &Header::cleanhtml();
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2021-07-13 15:33:40 +00:00
Michael Tremer
6f15b0cbe0 pakfire.cgi: Sleep after running a pakfire command
This is required to have better chances in the race of showing the log
output afterwards.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2021-07-09 13:19:08 +00:00
Michael Tremer
124926ee86 pakfire.cgi: Remove confusing dots in install message
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2021-07-09 13:05:13 +00:00
Michael Tremer
75ee0279ec pakfire.cgi: Pass packages to install/uninstall as array
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2021-07-09 13:04:14 +00:00
Michael Tremer
0fd28c360e fireinfo.cgi: Fix kernel version
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2021-07-09 12:56:17 +00:00
Stefan Schantl
1d32c50e03 ddns.cgi: Fix sanity check logic.
The input validation did not work in the proper way. It allways
reported "No password" when using a provider which supports token and
the token has been given.

This of course is wrong and leaded to unuseable providers.

Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2021-07-07 09:34:31 +00:00
Stefan Schantl
274ca65bc5 ovpnmain.cgi: Fix typos.
Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2021-06-22 13:36:40 +00:00
Stefan Schantl
b959b9f5a6 ovpnmain.cgi: Call correct system_output() function.
Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2021-06-22 13:36:37 +00:00
Stefan Schantl
f560408053 ovpnmain.cgi: Fix detection of used DH key lenght.
Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2021-06-21 17:18:26 +00:00
Stefan Schantl
016859ffe4 vpnmain.cgi: Fix typo.
Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2021-06-21 17:16:41 +00:00
Stefan Schantl
8f73d902e3 pppsetup.cgi: Fix typos.
Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2021-06-21 17:16:00 +00:00
Stefan Schantl
5e99660d7d speed.cgi: Add requirement for general-functions.pl.
The CGI now requires the general-functions library, because the
get_red_interface() function is used.

Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2021-06-20 12:37:33 +00:00
Stefan Schantl
6239e587f0 memory.cgi: Fix missing qoutes.
Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2021-06-20 12:37:29 +00:00
Peter Müller
e981b751d1 proxy.cgi: Suppress Squid version by default
While hiding version information does not come with any _actual_
security improvements, it is generally a good thing to do so by default:
Attackers will still be able to reasonably guess or enumerate the
software version running, but need to conduct additional effort to do
so, hence more likely raising alerts and drawing attention on their
operation.

In addition, we suppress version details somewhere else in IPFire 2.x by
default, too (e. g. Unbound and Apache), so we can justify this patch by
aiming to stay consistent, I guess. :-)

Signed-off-by: Peter Müller <peter.mueller@ipfire.org>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2021-06-18 08:47:36 +00:00
Michael Tremer
46443100e0 Merge branch 'perl-system' into next 2021-06-17 20:11:47 +00:00
Stefan Schantl
508547f98d hardwaregraphs.cgi: Perform all sensor lookups in pure perl.
Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
2021-06-17 20:11:37 +00:00
Stefan Schantl
f6340997aa services.cgi: Redesign isautorun() because shell globbing cannot used anymore.
Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
2021-06-17 20:11:37 +00:00
Stefan Schantl
e2839b1a2c remote.cgi: Fix splitting output from ssh-keygen.
The split function requires an string as input.

Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
2021-06-17 20:11:37 +00:00
Stefan Schantl
5410fcbc45 dhcp.cgi: Fix typo and displaying advanced options syntax.
Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
2021-06-17 20:11:37 +00:00
Stefan Schantl
5153fcc9f1 fireinfo.cgi: Fix read-in profile data.
To read-in the whole file content the data type needs to be an array.

Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
2021-06-17 20:11:37 +00:00
Stefan Schantl
276f938b09 time.cgi: Get and manipuate date and time in pure perl
Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
2021-06-17 20:11:37 +00:00
Stefan Schantl
82215f2d5f netexternal.cgi: Grab DNS servers in pure perl
Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
2021-06-17 20:11:37 +00:00
Stefan Schantl
17ee1f135f mdstat.cgi: Print mdstat status in pure perl
Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
2021-06-17 20:11:37 +00:00
Stefan Schantl
2ccb63bce8 fireinfo.cgi: Use new system methods
Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
2021-06-17 20:11:37 +00:00
Stefan Schantl
a81cbf6127 vpnmain.cgi: Use new system methods
Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
2021-06-17 20:11:37 +00:00
Stefan Schantl
1366526c0b pppsetup.cgi: Use new system methods
Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
2021-06-17 20:10:58 +00:00
Stefan Schantl
4abd5cd00e wireless.cgi: Use new system methods
Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
2021-06-17 20:10:24 +00:00
Peter Müller
6323e9086f proxy.cgi: drop options for faking Referer and User-Agent HTTP headers
While maintaining privacy when accessing web sites probably has never
been more important than it is today, faking Referer and User-Agent
headers is both obsolete and counterproductive:

(a) Most web sites require HTTPS, thwarting manipulation attempts to
    HTTP headers in transit. Given todays' internet landscape, faking
    these headers is unlikely to work for the vast majority of web
    sites.

(b) It is trivial to detect faked HTTP User-Agent headers by obtaining
    corresponding browser information via JavaScript. Any difference
    most likely indicates (trivial) header manipulation attempts, hence
    rendering this feature useless if browsers do not behave in the same
    manner, which we cannot control on IPFire.

(c) Especially static Referer headers make users stick out like a sore
    thumb, as nobody else in the world is likely to have the same
    Referer set _all the time_.

    Modern browsers attempt to strip sensitive information from Referer
    headers, or ditch them completely, particularly to 3rd party sites.

Given the state of the web ecosystem as we know it today, enforcing
privacy in a centralised manner does not even come close to being
sufficient. Without gaining control over users' browsers, their
settings, and their infrastructure (such as setting up terminal
environments for accessing the web, preventing hardware
fingerprinting), a centralised attempt will at best fail, if not making
things worse, as highlighted in (c).

Therefore, removing these features from the Squid GUI is the least worse
option we have. We should not give our users a false sense of privacy.

Signed-off-by: Peter Müller <peter.mueller@ipfire.org>
Reviewed-by: Bernhard Bitsch <bbitsch@ipfire.org>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2021-06-17 20:06:26 +00:00