Commit Graph

401 Commits

Author SHA1 Message Date
Leo-Andres Hofmann
fa7735b68e Fix translations and clean general-functions.pl
This patch fixes two wrong translations now used by the new
user manual links feature and removes an abandoned constant.

Signed-off-by: Leo-Andres Hofmann <hofmann@leo-andres.de>
Reviewed-by: Bernhard Bitsch <bbitsch@ipfire.org>
Tested-by: Bernhard Bitsch <bbitsch@ipfire.org>
2021-11-19 07:18:29 +01:00
Leo-Andres Hofmann
b0323d1946 webinterface: Add links to the configuration wiki
This patch adds a little "help" icon to the page header.
If a manual entry exists for a configuration page, the icon
appears and offers a quick way to access the wiki.
Wiki pages can be configured in the "manualpages" file.

Signed-off-by: Leo-Andres Hofmann <hofmann@leo-andres.de>
Reviewed-by: Bernhard Bitsch <bbitsch@ipfire.org>
Tested-by: Bernhard Bitsch <bbitsch@ipfire.org>
Reviewed-by: Michael Tremer <michael.tremer@ipfire.org>
2021-11-19 07:18:20 +01:00
Peter Müller
970e8547be location-functions.pl: Recognise XD / LOC_NETWORK_FLAG_DROP
This enables creating firewall rules using the special country code "XD"
for hostile networks safe to drop and ipinfo.cgi to display a meaningful
text for IP addresses having this flag set.

At the moment, the "LOC_NETWORK_FLAG_DROP" is not yet populated, but
will be in the future (as soon as libloc 0.9.9 is released and running
in production).

Signed-off-by: Peter Müller <peter.mueller@ipfire.org>
Reviewed-by: Michael Tremer <michael.tremer@ipfire.org>
2021-11-19 07:02:43 +01:00
Arne Fitzenreiter
a7b4f84711 general-functions: remove comment that system_output also in speed.cgi
this functions was removed from speed.cgi by reading kernel netowrk
statistics instead of parsing ip -s show ...

Signed-off-by: Arne Fitzenreiter <arne_f@ipfire.org>
2021-10-25 16:59:08 +00:00
Arne Fitzenreiter
110d4c8106 speed.cgi: reduce system load by copying two general-functions.
include general-functions.pl load and initialize many subfunctions that are not
needed by speed.cgi which was executed very often.
So this reduce the system load significant if webif was open in browser
and ajax-speed display enabled.

Signed-off-by: Arne Fitzenreiter <arne_f@ipfire.org>
Reviewed-by: Bernhard Bitsch <bbitsch@ipfire.org>
Signed-off-by: Arne Fitzenreiter <arne_f@ipfire.org>
2021-10-22 16:15:34 +00:00
Michael Tremer
637eb94684 index.cgi: Remove left-over DNSSEC status warning
An error message is still shown although there is no option to disable
DNSSEC at the moment. The old marker file could still be present on
older machines.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Signed-off-by: Arne Fitzenreiter <arne_f@ipfire.org>
2021-10-19 11:24:07 +00:00
Arne Fitzenreiter
b9a0d7065b network_functions: fix _get_wireless_status function
the function has returned the number of lines instead of the output itself.

Signed-off-by: Arne Fitzenreiter <arne_f@ipfire.org>
2021-09-12 10:55:43 +02:00
Michael Tremer
2d56b4869a No longer disable proxy when GREEN isn't present
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Signed-off-by: Arne Fitzenreiter <arne_f@ipfire.org>
2021-09-05 18:01:10 +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
Leo-Andres Hofmann
6dd084c22d network-functions.pl: Improve wifi_get_link_quality
iwconfig doesn't return values for "Link Quality" if the interface
is disconnected, causing a division by zero error. If there are odd
values, the resulting percentage may contain many decimal places.

This patch makes wifi_get_link_quality return zero instead of failing
and rounds the percentage to a more meaningful integer.

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:50:05 +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
Peter Müller
db4e10a6ec general-functions.pl: do not miscalculate when enumerating IPsec N2N subnet membership
Fixes: #11235

Cc: Alexander Marx <alexander.marx@ipfire.org>
Signed-off-by: Peter Müller <peter.mueller@ipfire.org>
Signed-off-by: Arne Fitzenreiter <arne_f@ipfire.org>
2021-08-09 07:25:59 +00:00
Michael Tremer
2a52353f3c general-functions.pl: Explicitely call new system function
Perl seems to just "guess" that someone no longer wants to use the
builtin "system" command when there is a function with the same name.

I have no idea what kind of liquid they are drinking, but because of the
side effects of that stuff, we explicitely call our system() function.

Not that that would be necessary, but why not waste a couple more CPU
cycles?

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2021-06-18 15:12:53 +00:00
Stefan Schantl
8163192065 ids-functions.pl: Use new system methods
Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
2021-06-17 20:11:37 +00:00
Stefan Schantl
f3e3cb371d network-functions.pl: Use new system methods
Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
2021-06-17 20:11:37 +00:00
Michael Tremer
03fe408112 general-functions.pl: Add "safe" system commands
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2021-06-10 14:29:42 +01:00
Michael Tremer
45b1fc5c7f hostapd: Find device by MAC address
With wireless device as members in bridges, we cannot predict the name
very well. So we will use the MAC address and find the correct device
name when we launch hostapd.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2021-04-16 10:05:57 +00:00
Jonatan Schlag
8186b37230 Hardcode theme to ipfire
This disables the theme support and makes it impossible to use any other
themes than the ipfire default theme.

The only intention of this patch is to hardcode the theme to ipfire.
To change any cgi we have is an ugly way, but the only way to do this
fast. The colour handling needs certainly to be improved as well, but
this will and should be done in other patches.

Signed-off-by: Jonatan Schlag <jonatan.schlag@ipfire.org>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2021-04-08 10:11:34 +00:00
Leo-Andres Hofmann
9c6a0ce12d rrdimage: Switch graphs.pl to the new graph scripts
"makegraphbox" is modified to remove the old iframe method and output
a modern div container instead.
Graph errors are now returned, to be displayed by getrrdimage.cgi.

entropy.cgi and netovpnsrv.cgi are modified to ensure compatibility.

Add cache control HTTP header to image output.

Signed-off-by: Leo-Andres Hofmann <hofmann@leo-andres.de>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2021-04-06 10:05:28 +00:00
Leo-Andres Hofmann
910f1e8494 rrdimage: Add scripts for new graph display method
This patch adds two scripts which will later be used to display graphs:

-> getrrdimage.cgi: Generates PNG images for graphs.
Until now, each CGI with embedded graphs had to be able to output
images. These functions are now gathered in this new script.
The additional parameter handling can be removed and the CGIs can
be simplified. This makes it easier to use and output the graphs.

-> rrdimage.js: Interactive Javascript functions
This allows the user to select time ranges without reloading the page.
In addition, the graphs are now periodically updated, allowing users
to live monitor the data.

Signed-off-by: Leo-Andres Hofmann <hofmann@leo-andres.de>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2021-04-06 10:01:15 +00:00
Leo-Andres Hofmann
9db81dc9d4 header.pl: Hide PPPoE menu item if RED is in IP mode
Fixes: #11342

Signed-off-by: Leo-Andres Hofmann <hofmann@leo-andres.de>
Reviewed-by: Peter Müller <peter.mueller@ipfire.org>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2021-03-29 10:28:15 +00:00
Leo-Andres Hofmann
92d8c1f73c network-functions.pl: Add MAC address compare function
Signed-off-by: Leo-Andres Hofmann <hofmann@leo-andres.de>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2021-03-25 09:21:39 +00:00
Leo-Andres Hofmann
00db2d8343 QoS graphs: Add color mapping table
Use the traffic class description field to identify similar classes.
This ensures that a class used in both the up- and down-link is
printed with matching colors in both graphs.

Signed-off-by: Leo-Andres Hofmann <hofmann@leo-andres.de>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2021-03-08 10:55:07 +00:00
Arne Fitzenreiter
69d90c36cc network-functions.pl: declare use of smartmatch
perl complains about the use of experimental smartmatch feature
if it is not declared.

Signed-off-by: Arne Fitzenreiter <arne_f@ipfire.org>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2021-02-01 10:45:38 +00:00
Leo-Andres Hofmann
eea288bc1a network-functions.pl: Improve zone configuration functions
Cache ethernet configuration in public variable "ethernet_settings",
add functions to simplify working with the network configuration.

Signed-off-by: Leo-Andres Hofmann <hofmann@leo-andres.de>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2021-01-25 19:32:40 +00:00
Leo-Andres Hofmann
abffcc99ad Refactor "get_available_network_zones", move to network-functions.pl
This function nicely translates the ethernet/settings "CONFIG_TYPE"
into a list of available zones. Therefore it should be more accessible!

Signed-off-by: Leo-Andres Hofmann <hofmann@leo-andres.de>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2021-01-25 19:32:38 +00:00
Leo-Andres Hofmann
56d37c8dbf header.pl: Remove duplicate "IpInSubnet" function
This function is deprecated. The commonly used and maintained "IpInSubnet" function can be found in general-functions.pl.

Signed-off-by: Leo-Andres Hofmann <hofmann@leo-andres.de>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2021-01-13 10:52:49 +00:00
Adolf Belka
5b4e33bc3b general-functions.pl: Update to fix bug #12428
- Patch of general-functions.pl for implementation of fix provided
	by Bernhard Bitsch in bug #12428.
	Had to be modified as that fix gave a failure for single character hostnames.
	Updated version prevents spaces being put into hostnames and works for single
	character hostnames
- Updated subroutine validfqdn to apply consistent rules for hostname & domain name
	portions of fqdn
- Minor updates for consistency across validhostname, validdomainname & validfqdn
- Patch implemented into testbed system and confirmed working for hostnames, domain names
	and FQDN's.

Signed-off-by: Adolf Belka <ahb.ipfire@gmail.com>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2021-01-04 10:44:20 +00:00
Stefan Schantl
aa9dd5386c location-functions.pl: Remove accidently keept 2nd DB init call.
The get_full_country_name() function had an accidenlty and not longer
required call of the DB init function.

This is a waste of memory and a known problem, especially on systems
with less than 1GB of RAM, where the application which uses libloc in
such a redundant way crashes.

Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2020-12-02 14:16:54 +00:00
Peter Müller
7b82ca1fc8 location-functions.pl: add functions for fetching AS information
The second version of this patch only unifies the licence banner, but
leaves GPLv2 untouched. In addition, functions have been changed to use
a script-wide location database handle, as introduced in commit
b62d7e0cc7.

Signed-off-by: Peter Müller <peter.mueller@ipfire.org>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2020-11-11 16:01:47 +00:00
Stefan Schantl
427190d578 locations-functions.pl: Allow get_locations() function to skip special locations.
When adding "no_special_locations" to the function call as argument
the special locations liks "A1, A2, A3 etc" will not be added to the
returned array as available locations.

Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2020-11-09 14:07:14 +00:00
Stefan Schantl
5bf91fe1b1 location-functions.pl: Add get_continent_code() function.
This tiny function is used to get the continent code for a given
country code.

Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2020-11-09 14:07:09 +00:00
Stefan Schantl
f46fd07814 location-functions.pl: Add END block to release the database handle.
Reference #12515.

Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2020-11-09 14:07:00 +00:00
Stefan Schantl
b62d7e0cc7 location-functions.pl: Use a single script-wide db_handle.
Create and use a single script-wide database handle for libloc to
prevent from creating multiple ones.

This helps saving memory, especially on small systems.

Reference #12515.

Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2020-11-09 14:06:53 +00:00
Leo-Andres Hofmann
c27b8825be Improve DHCP dynamic leases list usability. Active and expired leases are now grouped and the list is divided by a horizontal line. Sorting and creating static leases remains unchanged.
Signed-off-by: Leo-Andres Hofmann <hofmann@leo-andres.de>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2020-10-23 10:07:08 +00:00
Leo-Andres Hofmann
934a376918 Improve indentation and HTML output of PrintActualLeases & leasesort
Signed-off-by: Leo-Andres Hofmann <hofmann@leo-andres.de>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2020-10-23 10:07:03 +00:00
Michael Tremer
79131c6e47 firewall hits graph: Fix order of values
The fields were mixed up and therefore graph showed incorrect
values.

Fixes: #12496
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2020-10-12 10:27:15 +00:00
Stefan Schantl
33975f578d ipinfo.cgi: Allow to display multiple flags.
Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2020-09-24 17:36:38 +00:00
Stefan Schantl
278b8710bc general-functions.pl: Drop unused use of Locale::Codes::Country.
Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2020-09-24 17:36:38 +00:00
Stefan Schantl
d443f504aa location-functions.pl: Add address_has_flag() function.
This function can be used to check if a given address has
one of the known flags like "Anonymous Proxy".

If this is true, the mapped special country code will be returned.

Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2020-09-24 17:36:38 +00:00
Stefan Schantl
b868abd251 location-functions.pl: Refactor get_full_country_name() function to use the Location module.
Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2020-09-24 17:36:38 +00:00
Stefan Schantl
79b564c8ce location-functions.pl: Refactor get_locations() function to use the Location module.
Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2020-09-24 17:36:38 +00:00
Matthias Fischer
2bba650947 graphs.pl: Standardize localization strings for entropy graphs
Signed-off-by: Matthias Fischer <matthias.fischer@ipfire.org>
Reviewed-by: Michael Tremer <michael.tremer@ipfire.org>
Signed-off-by: Arne Fitzenreiter <arne_f@ipfire.org>
2020-09-19 19:21:53 +00:00
Matthias Fischer
03dd66d616 graphs.pl: Standardize localization strings for disk access graphs
Signed-off-by: Matthias Fischer <matthias.fischer@ipfire.org>
Reviewed-by: Michael Tremer <michael.tremer@ipfire.org>
Signed-off-by: Arne Fitzenreiter <arne_f@ipfire.org>
2020-09-19 19:21:27 +00:00
Matthias Fischer
cc573a98d1 graphs.pl: Standardize temperature displays
Signed-off-by: Matthias Fischer <matthias.fischer@ipfire.org>
Signed-off-by: Arne Fitzenreiter <arne_f@ipfire.org>
2020-09-19 19:15:15 +00:00
Michael Tremer
8ffdc78c49 web UI: Add graph for connection tracking
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Signed-off-by: Arne Fitzenreiter <arne_f@ipfire.org>
2020-09-19 19:13:10 +00:00
Matthias Fischer
fa088214bc graphs.pl: Added translation for 'ACPI Thermal Zone'
This patchset is based on https://git.ipfire.org/?p=people/ms/ipfire-2.x.git;a=commitdiff;h=4bf0d000ffe961cdc5d9dbd27b3a11f900b3daed

Signed-off-by: Matthias Fischer <matthias.fischer@ipfire.org>
Signed-off-by: Arne Fitzenreiter <arne_f@ipfire.org>
2020-09-19 19:10:29 +00:00
Michael Tremer
6fc3625512 graphs: Fix rendering CPU graphs after number of cores decreased
Fixes: #12193 - cpu graphs cannot created if smt is disabled
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Signed-off-by: Arne Fitzenreiter <arne_f@ipfire.org>
2020-09-19 19:05:46 +00:00
Michael Tremer
087e302381 general-functions.pl: Do not check IPsec subnets for VTI/GRE connections
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2020-08-20 17:56:03 +00:00
Peter Müller
cc9eb2d306 network-functions.pl: add missing unit tests for changed, network membership procedure
Cc: Tim FitzGeorge <ipfr@tfitzgeorge.me.uk>
Cc: Alexander Marx <alexander.marx@ipfire.org>
Signed-off-by: Peter Müller <peter.mueller@ipfire.org>
Signed-off-by: Arne Fitzenreiter <arne_f@ipfire.org>
2020-07-28 18:37:32 +00:00