Commit Graph

577 Commits

Author SHA1 Message Date
Michael Tremer
9f3c37ab0c ovpnmain.cgi: Unify the error message box
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2024-08-14 16:53:54 +00:00
Michael Tremer
d33000e991 header.pl: Define a colour for WireGuard
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2024-08-07 14:26:20 +02:00
Michael Tremer
86ca826ff1 header.pl: Bump the CSS version so that browsers reload the file
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2024-08-06 17:45:58 +02:00
Michael Tremer
aca5f661c2 services.cgi: Drop the process graphs
These are utterly broken and incomplete. I don't want to fix this now,
so I am dropping it.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2024-08-06 17:14:41 +02:00
Michael Tremer
0b16963484 web: Create a function to show the service status
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2024-08-06 17:08:40 +02:00
Michael Tremer
0869a6f5f3 graphs: Highlight the default range before the user clicks anything
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2024-08-06 16:51:06 +02:00
Michael Tremer
76f429d5d8 licenses: Remove the braindead GPL acception stage
The GPL is not an EULA and so there is no value in having users
accept it.

The UI is very broken and so I believe it is best to drop this entirely.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2024-08-06 16:48:27 +02:00
Michael Tremer
10210334fe Merge remote-tracking branch 'ms/cleanup' into next 2024-07-24 16:32:28 +00:00
Adolf Belka
eef090c3de header.pl: Add utf-8 handling into cleanhtml command
- existing cleanhtml command does not handle diacritical charcters such as umlauts, acute,
   grave and circumflex accents.
- In bug 12395 the problem was resolved by adding decode before and encode after the
   cleanhtml command in dns.cgi
- Suggestion from @Michael Tremer was to add the decode and encode sections into the
   actual cleanhtml subroutine in header.pl
- This patch submission is the execution of that suggestion.
- This will ensure that whenever cleanhtml is used for any remark in a WUI page it will
   handle diacritical charcters.
- Tested out on my vm testbed system and confirmed to be working when cleanhtml has the
   encode and decode lines.
- Combined with this patch is another one that changes the dns.cgi to remove the decode
   and encode entries added into the cgi code.

Suggested-by: Michael Tremer <michael.tremer@ipfire.org>
Tested-by: Adolf Belka <adolf.belka@ipfire.org>
Signed-off-by: Adolf Belka <adolf.belka@ipfire.org>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2024-07-02 09:13:10 +00:00
Michael Tremer
6515a27802 header.pl: Fix parsing BOOTP leases
If the lease has been handed out over BOOTP, it will never expire.
However, the parser did not account for this case at all which is fixed
in this patch.

Fixes: #13689 - BOOTP breaks the list of DHCP leases due to erroneous parsing
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Signed-off-by: Arne Fitzenreiter <arne_f@ipfire.org>
2024-05-19 15:11:34 +02:00
Michael Tremer
98b755225e general-function.pl: Add a function to easily set defaults
This function can be used to set values in a hash if they have not been
set, yet.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2024-04-27 19:44:29 +02:00
Michael Tremer
3cd821c122 web: Refactor graphs
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2024-04-27 19:43:33 +02:00
Michael Tremer
2dd6bc7225 web: Introduce sections
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2024-04-27 19:43:07 +02:00
Michael Tremer
f5bddd4fe7 header.pl: Simplify boxes
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2024-04-27 19:41:33 +02:00
Michael Tremer
d716ad52a7 header.pl: Remove unused openpagewithoutmenu function
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2024-04-27 19:41:16 +02:00
Michael Tremer
66db90757a Remove RECONNECTION=dialondemand
We don't support this at all and so we don't need to check any more.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2024-04-27 19:35:47 +02:00
Michael Tremer
cc5613b3b5 network-functions.pl: Read PPP settings globally
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2024-04-27 19:35:36 +02:00
Michael Tremer
789251ae65 web: Read ethernet settings file only once in headers
The web UI is rather slow and one of the reasons for that is that we are
reading the same files over and over again...

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2024-04-27 19:35:24 +02:00
Michael Tremer
07257e1f83 general-functions.pl: Don't use line buffering
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2024-04-27 19:35:08 +02:00
Michael Tremer
0e750575a9 web-user-interface: Move theme functions back into header.pl
Since we no longer support other themes, the web UI should load quicker
if not importing too many other files.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2024-04-27 19:34:59 +02:00
Michael Tremer
9b044bc8eb header.pl: Remove unused function "is_modem"
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2024-04-27 19:34:36 +02:00
Michael Tremer
0e93c1eaf3 header.pl: Fix whitespace errors
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2024-04-27 19:34:27 +02:00
Michael Tremer
62a84fdb4a general-functions.pl: Remove unused NextIP* functions
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2024-04-27 19:34:14 +02:00
Michael Tremer
9c9f637e16 general-functions.pl: Remove unused srtarray function
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2024-04-27 19:34:04 +02:00
Michael Tremer
11e75894ce general-functions.pl: Remove getlastip/getnextip
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2024-04-27 19:33:55 +02:00
Michael Tremer
498feaa550 general-functions.pl: Drop unused getccdbc function
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2024-04-27 19:33:40 +02:00
Michael Tremer
b8d1ae216f general-functions.pl: Drop unused "writehashpart" function
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2024-04-27 19:33:31 +02:00
Michael Tremer
d110e751f3 general-functions.pl: Fix various whitespace issues
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2024-04-27 19:33:21 +02:00
Michael Tremer
737e9e1037 network-functions.pl: Add function to get netmask in dotted format
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2024-04-27 19:30:44 +02:00
Michael Tremer
85e004c2da network-functions.pl: Fix return code check
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2024-04-27 19:30:32 +02:00
Michael Tremer
65fff7fc34 network-functions.pl: Fix whitespace issues
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2024-04-27 19:30:21 +02:00
Michael Tremer
0e55d27737 network-functions.pl: Add function to extract prefix
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2024-04-27 19:30:09 +02:00
Michael Tremer
82fec28abe header.pl: Allow passing more HTTP headers to showhttpheaders()
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2024-04-27 19:28:25 +02:00
Stefan Schantl
ee16b227a5 ids-functions.pl: Use libarchive to extract archives
This gives us a lot of benefits:

* Speed up the extraction process
* More supported archive types due the power of libarchive
* Support of passphrase protected archives

It also fixes a problem with non extracted files next to a zero sized
file inside an archive.

Fixes #13632.

Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2024-03-30 12:09:14 +00:00
Stefan Schantl
738ee72027 ids-functions.pl: Improve logic to get the cached rulesfile of a provider
Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2024-03-22 15:18:41 +00:00
Jon Murphy
9297dba50f manualpages: update wiki url
Suggested-by: Leo-Andres Hofmann <hofmann@leo-andres.de>
Signed-off-by: Jon Murphy <jon.murphy@ipfire.org>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2024-03-14 09:26:47 +00:00
Adolf Belka
2071b2964f graphs.pl: Fixes graph failure when the DROP_HOSTILE directory is missing
- If a fresh install is done then only the DROP_HOSTILE_IN & DROP_HOSTILE_OUT
   rrd directories are created.
- With the DROP_HOSTILE directory missing then when the fwhits graph is updated an error
   message is caused by the inability to open the required files.
- This patch adds an if/else loop into the fwhits graph code to deal with the two cases
   of the DROP_HOSTILE being present or not depending on the history and if a backup with
   logs has been restored from when DROP_HOSTILE was in use.
- Tested on vm testbed and created a historical line for the hostile data when it was not
   split
- There might be a simpler or better approach than this but it was the only option I
   could identify. I couldn't find anything about being able to use if loops within the
   RRD::Graph loop

Tested-by: Adolf Belka <adolf.belka@ipfire.org>
Signed-off-by: Adolf Belka <adolf.belka@ipfire.org>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2024-02-14 19:01:44 +00:00
Michael Tremer
7c9a6cf163 firewall: graphs: Add a line for the total number of hostile hits
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2024-02-07 11:02:41 +00:00
Adolf Belka
216d4bfc3d graphs.pl: Fixes bug12981 - Creates in and outgoing drop hostile graph entries
- This v3 version of the patch set splits the single hostile networks graph entry into
   incoming hostile networks and outgoing hostile networks entries.

Fixes: bug12981
Tested-by: Adolf Belka <adolf.belka@ipfire.org>
Signed-off-by: Adolf Belka <adolf.belka@ipfire.org>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2024-02-07 11:02:18 +00:00
Michael Tremer
dbf1d1634b web-user-interface: Update interface design
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2024-01-10 12:13:04 +00:00
Jon Murphy
81feac13b1 manualpages: correct link to dns help page
- point the dns help link to "configuration/network/dns-server"

Signed-off-by: Jon Murphy <jon.murphy@ipfire.org>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2023-08-21 16:37:56 +00:00
Stefan Schantl
41d3d33dde update-ipblocklists: Fix loading new blocklists after update
* The script needs to run with root permissions in order to
  do the ipset operations. So remove code to drop the permissions
  on startup.

* Adjust execute calls to use the proper functions from
  general functions.

* Add some code to set the correct ownership (nobody:nobody) for
  changed files during script runtime.

Fixes #13072.

Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
2023-04-04 19:59:23 +00:00
Adolf Belka
a84b9ed2fe header.pl: Add reference to colors.txt into header.pl
- With change of common css entries into header.pl with commit
   https://git.ipfire.org/?p=ipfire-2.x.git;a=commit;h=b52a84ddc77f9db7e4ad7b129f21fbf528c6f990
   I had missed that color20 and color22 etc, that come from colors.txt, are not known in
   header.pl so that the alternate colours in tables were missing. Even though I tested the
   previous commit I obviously did not look well enough because I missed that the tables
   had no alternate colours. I just found it now when looking at Core Update 174 Testing.
- Confirmed by copying this version of header.pl into my CU174 Testing system and the
   alternate colour rows came back again as they should be. I am sure now that they are
   correct.

Tested-by: Adolf Belka <adolf.belka@ipfire.org>
Signed-off-by: Adolf Belka <adolf.belka@ipfire.org>
Reviewed-by: Bernhard Bitsch <bbitsch@ipfire.org>
Tested-by: Bernhard Bitsch <bbitsch@ipfire.org>
2023-04-02 17:10:04 +00:00
Leo-Andres Hofmann
11f4726b0d graphs.pl: Make canvas fixed size and limit cpufreq color index
This fixes an issue where systems with many CPU cores
run out of usable graph colors and canvas area.
It also unifies the canvas size for all graphs.

Discussion: https://community.ipfire.org/t/cpu-freq-graph-not-working-with-i5-1235u/9396

Fixes: #12890

Signed-off-by: Leo-Andres Hofmann <hofmann@leo-andres.de>
Reviewed-by: Michael Tremer <michael.tremer@ipfire.org>
2023-03-13 21:39:20 +00:00
Leo-Andres Hofmann
138b26e014 Drop support for entropy graph
Entropy data isn't collected anymore. See 8000bc0 for reference.

Signed-off-by: Leo-Andres Hofmann <hofmann@leo-andres.de>
Reviewed-by: Michael Tremer <michael.tremer@ipfire.org>
2023-03-13 21:37:39 +00:00
Adolf Belka
14051bfeb5 updatexlrator.cgi: Update to naming of variables in css section
- This updates the updatexlrator.cgi page to the same central use of extraHead from
   header.pl and simplifying of css variables where appropriate.
- The variables for the percentage bar will also be able to be used in other cgi pages
   with a percent bar.

Tested-by: Adolf Belka <adolf.belka@ipfire.org>
Signed-off-by: Adolf Belka <adolf.belka@ipfire.org>
2023-03-11 16:30:39 +00:00
Adolf Belka
d3aec71828 dhcp.cgi: Update to naming of variables in css section
- After looking at other .cgi files I realised that I had named the variables based on
   their dhcp usage only. However colouryellow or color20 etc can be used not only in a
   row but also in a cell or a column. Rather than ending up with multiple copies of the
   same colour for rows, cells, columns etc I have simplified the variable names to just
   the colour. They can then be used in whatever situation is wanted. The rest of the cgi
   code will give the view of what structure the colour is being applied to.
- This will limit the number of different css variables defined in the header.pl file

Tested-by: Adolf Belka <adolf.belka@ipfire.org>
Signed-off-by: Adolf Belka <adolf.belka@ipfire.org>
2023-03-11 16:30:39 +00:00
Stefan Schantl
c35974f87d ids-functions.pl: Extract rules files if they are in a providers rules folder.
Now the rules files in a subfolder like "<provider>-rules" also will get
extracted.

Fixes rule file extraction for Snort Community ruleset.

Fixes #12948.

Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
Reviewed-by: Adolf Belka <adolf.belka@ipfire.org>
2023-03-11 16:26:15 +00:00
Adolf Belka
b52a84ddc7 dhcp.cgi: Fix bug#10629 - Highlight fixed IP's in dynamic range in red
- This v2 patch has moved the extraHead variable into header.pl
- This patch marks all IP's that are in the Fixed list but are also in the dynamic range
   that has been defined, in red.
- Additional function created to check if an ip address is in a defined range.
- Added an additional key item under the Fixed Leases table for Fixed IP in dynamic range
- Added line to English Language file for this key item.
- ./make lang run before commit.
- Tested in vm testbed and confirmed that any ip address in the Fixed Leases table that
   is in the defined dynamic range is highlighted in red
- This uses the css background-color appoach from the first patch in this set.
- This patch only highlights those IP's that overlap in red but does nothing more. So a
   user can still create new ones if they want but they will all show up in red.
- This patch flags up if people are doing things that they shouldn't be doing but allows
   them to continue doing so without changing anything if they don't want to and so will
   not break existing setups.

Fixes: Bug#10629
Tested-by: Adolf Belka <adolf.belka@ipfire.org>
Signed-off-by: Adolf Belka <adolf.belka@ipfire.org>
Reviewed-by: Bernhard Bitsch <bbitsch@ipfire.org>
Tested-by: Bernhard Bitsch <bbitsch@ipfire.org>
2023-03-04 13:41:21 +00:00
Adolf Belka
de4dea96aa dhcp.cgi: Fix for bug#10629 - update bgcolor to css
- This v2 version moves the extraHead variable to header.pl as many of the css values
   will be used in many other WUI cgi pages so makes sense to not define anew in every
   location using the bgcolor or other colour variables.
- I will submit patches to follow the same approach in all other WUI cgi pages once this
   has been submitted into next
- bgcolor was deprecated in HTML 4.01 and is not supported by HTML 5
- The orange colour for IP's that are outside the IPFire green and blue subnets does not
   work on any browser I am using.
- I used the CSS approach that @Leo used in the Zone Configuration cgi page
- This patch changes all existing bgcolor entries to the css based background-color
- Tested on my vm testbed and confirmed to work. The Orange colour for IP's outside of
   the subnet now shows up.

Fixes: Bug#10629
Tested-by: Adolf Belka <adolf.belka@ipfire.org>
Signed-off-by: Adolf Belka <adolf.belka@ipfire.org>
Reviewed-by: Bernhard Bitsch <bbitsch@ipfire.org>
Tested-by: Bernhard Bitsch <bbitsch@ipfire.org>
2023-03-04 13:41:21 +00:00