3082 Commits

Author SHA1 Message Date
Michael Tremer
6e40963459 ovpnclients.dat: Fix adjusting input dates
This patch changes that we no longer interpret any dates put in by the
user as UTC. They used to be converted into localtime because, although
they have already been in local time.

This went unnoticed since in Europe we are close (enough) to UTC that
there is no significant discrepancy on the report. However, being in
North America is enough to generate confusing reports.

Reported-by: Paul <kairis@gmail.com>
Fixes: #12768
Tested-by: Jon Murphy <jon.murphy@ipfire.org>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2022-02-15 17:59:01 +00:00
Matthias Fischer
b81c77b96b pakfire.cgi: Cosmetic fix
The two text passages for 'pakfire install...' and 'pakfire uninstall...' under
'Available' and 'Installed Addons:' are so close together that the first line
appears as a single line.

This patch separates these two areas a bit from each other so that they are
better readable.

Signed-off-by: Matthias Fischer <matthias.fischer@ipfire.org>
2022-02-11 15:21:43 +00:00
Matthias Fischer
57d4e48840 Typo in 'qos.cgi'
'bandwith*' => 'bandwidth*'

Plus: Image button for going back...

Signed-off-by: Matthias Fischer <matthias.fischer@ipfire.org>
2022-02-11 15:16:41 +00:00
Alexander Marx
feef6aca68 BUG12301: Iptables “host/network ‘none’ not found”
Fixes: #12301

When using hosts with MAC-addresses in a hostgroup,
the rule won't be generated if those hosts are selected as target.
There is a hint but due to a wrong hashparameter the hint was not shown.

With this patch the hint is shown again.
Additionally the rule is skipped when rules.pl creates rules.

There are no bootmessages with failed target "none" anymore.
Acked-by: Stefan Schantl <stefan.schantl@ipfire.org>
2022-02-06 17:18:31 +00:00
Matthias Fischer
ae2d7a3f91 media.cgi: Added missing translation string
Contination from http://patchwork.ipfire.org/project/ipfire/patch/20200513135520.30310-1-matthias.fischer@ipfire.org/

[Thanks Peter, I nearly forgot... ;-) ]

Signed-off-by: Matthias Fischer <matthias.fischer@ipfire.org>
Reviewed-by: Peter Müller <peter.mueller@ipfire.org>
2022-02-06 13:14:20 +00:00
Matthias Fischer
7e329483a1 backup.cgi: Cosmetic fix - mark backup files bold for better readability
Signed-off-by: Matthias Fischer <matthias.fischer@ipfire.org>
Acked-by: Michael Tremer <michael.tremer@ipfire.org>
2022-02-06 11:10:50 +00:00
Leo-Andres Hofmann
d235c1fd79 style.css: Add positive "z-index" to drop-down menu
Some input fields interfere with the menu items and block their use.
A z-index ensures that the menu is always rendered in the foreground.

Signed-off-by: Leo-Andres Hofmann <hofmann@leo-andres.de>
Reviewed-by: Peter Müller <peter.mueller@ipfire.org>
2022-02-05 12:06:16 +00:00
Peter Müller
1b939d0ecc ids.cgi: Fix unmatched curly bracket and trailing whitespaces
The former causes this CGI to crash with an HTTP error 500.

Signed-off-by: Peter Müller <peter.mueller@ipfire.org>
2022-01-29 17:07:34 +00:00
Matthias Fischer
8f58e6612b log.dat: Fix an error with 'monit' logging too much data.
Making the regex "non-greedy" fixes an error Jon found.

'monit' logged a whole line from '/var/log/messages' where it should only log the first part.

Reference:
https://www.ultraedit.com/support/tutorials-power-tips/ultraedit/non-greedy-perl-regex.html

Signed-off-by: Matthias Fischer <matthias.fischer@ipfire.org>
Reviewed-by: Peter Müller <peter.mueller@ipfire.org>
2022-01-25 17:33:00 +00:00
Peter Müller
04581dfb77 Merge branch 'next' into temp-c164-development 2022-01-18 21:12:56 +00:00
Michael Tremer
ca26f73220 qos.cgi: Add control to change link-layer encapsulation
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Signed-off-by: Arne Fitzenreiter <arne_f@ipfire.org>
2022-01-16 15:17:50 +00:00
Michael Tremer
2d42f1df3b qos.cgi: Reindent change bandwidth window
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Signed-off-by: Arne Fitzenreiter <arne_f@ipfire.org>
2022-01-16 15:17:50 +00:00
Leo-Andres Hofmann
219dacef2c pakfire.cgi: Improve HTML output and layout
Add missing closing tags, indentation and CSS styling.
Add link to reboot notice, left-align info list and resize packages
lists for better readability.

Signed-off-by: Leo-Andres Hofmann <hofmann@leo-andres.de>
Acked-by: Peter Müller <peter.mueller@ipfire.org>
2022-01-14 14:36:22 +00:00
Leo-Andres Hofmann
4d70f59173 pakfire: Implement feedback from mailing list discussion
- Improve lockfile test: Return immediately if lockfile is present,
to prevent unnecessary and expensive "pidof" calls

- Add better explanation to the log file reading command and JS

- Change user interface: If no errors occurred, the page returns to
the main screen (after a short delay). If an error occurred, the log
output remains and a message is shown.

Signed-off-by: Leo-Andres Hofmann <hofmann@leo-andres.de>
Acked-by: Peter Müller <peter.mueller@ipfire.org>
2022-01-14 14:36:15 +00:00
Leo-Andres Hofmann
a02f132338 pakfire.cgi: Remove "sleep" after running Pakfire command
The extended lockfile test seems to be sufficient to detect
a running Pakfire process and display the logs.
"Sleep" even proved to be counterproductive, as fast processes
can finish in under a second and are then again not detected.

Signed-off-by: Leo-Andres Hofmann <hofmann@leo-andres.de>
2022-01-14 14:36:06 +00:00
Leo-Andres Hofmann
524bbe326d pakfire.cgi: Add new translations
Signed-off-by: Leo-Andres Hofmann <hofmann@leo-andres.de>
2022-01-14 14:36:02 +00:00
Leo-Andres Hofmann
db9ee62e0a pakfire.cgi: Implement JavaScript log message display
Currently the page becomes unresponsive while Pakfire is busy.
This patch implements a AJAX/JSON driven log output, to provide
continuous information to the user while Pakfire is running.

The output is updated 1x per second, if the load should be too high,
the interval can be change by writing to "pakfire.refreshInterval".

Signed-off-by: Leo-Andres Hofmann <hofmann@leo-andres.de>
2022-01-14 14:35:57 +00:00
Leo-Andres Hofmann
d255e2d1c2 pakfire.cgi: Extend the lockfile test
This implements a function to determine if Pakfire is already running.
It tests the PID and lockfile and can be expanded easily later.
'pidof' checks the full path to avoid confusion.

Removes the unreachable function "refreshpage".

Signed-off-by: Leo-Andres Hofmann <hofmann@leo-andres.de>
2022-01-14 14:35:52 +00:00
Stefan Schantl
b4c9d29971 pakfire.cgi: Bring back old logic for log displaying
Trying to get rid of the system backpipe check if a pakfire is running
does not work very well. It simply makes the code more complex and
only introduced some new problems.

This commit switches back to the old logic which worked well in the
past.

Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
Reviewed-by: Bernhard Bitsch <bbitsch@ipfire.org>
Tested-by: Bernhard Bitsch <bbitsch@ipfire.org>
2022-01-14 14:35:46 +00:00
Peter Müller
f871a115f4 optionsfw.cgi: Make logging of spoofed/martians packets and the DROP_HOSTILE filter configurable
Signed-off-by: Peter Müller <peter.mueller@ipfire.org>
2022-01-14 14:16:47 +00:00
Peter Müller
86cf6898aa Merge branch 'master-IDSv3' into temp-c164-development 2022-01-14 14:05:10 +00:00
Stefan Schantl
f8384fbf8d vpnmain.cgi: Fix extra whitespace in exported pk12 file
Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
Reviewed-by: Michael Tremer <michael.tremer@ipfire.org>
Reviewed-by: Peter Müller <peter.mueller@ipfire.org>
2022-01-04 18:06:12 +01:00
Stefan Schantl
0f1d0b9c3c ids.cgi: Use experimental smartmatch.
This will prevent from spawning the http error log with warnings.

Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
2021-12-19 13:23:45 +01:00
Stefan Schantl
4d438241c3 ids.cgi: Do not expect a space after the msg tag has been closed while
processing rules.

Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
2021-12-19 13:23:45 +01:00
Stefan Schantl
14696ced7e ids.cgi: Always write used providers rulefiles file.
Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
2021-12-19 13:23:45 +01:00
Stefan Schantl
258924ee79 ids.cgi: Add the provider handle if the forced update of a provider
fails.

Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
2021-12-19 13:23:45 +01:00
Stefan Schantl
969983eba4 ids.cgi: Add some more sanity checks when adding a new provider.
* Check if the system is online.
* Check if enough free disk space is available.
* Abort whith an error message if the ruleset could not be
  downloaded.

In error case the provider now will be removed again from the file which
keeps the configured providers. Sadly it needs to be added first because
otherwise the downloader could not read the required values from it.....

Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
2021-12-19 13:23:45 +01:00
Stefan Schantl
214f34ec4e ids.cgi: Use newly intruduced functions when removing a provider.
Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
2021-12-19 13:23:45 +01:00
Stefan Schantl
63cf95af3f ids.cgi: Introduce remove_provider().
This function is used to remove a configured provider by it's ID.

Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
2021-12-19 13:23:45 +01:00
Stefan Schantl
697787c930 ids.cgi: Introduce get_provider_handle().
This function is used to get the configured provider handle by a a given ID.

Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
2021-12-19 13:23:45 +01:00
Stefan Schantl
1e52a25825 ids.cgi: Regenerate ruleset if a provider get re-enabled.
Otherwise it could happen, that there are no rules files for this
specific provider.

Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
2021-12-19 13:23:45 +01:00
Stefan Schantl
724f98c086 ids.cgi: Fix check when changing the IDS to monitor mode or drop mode.
The test condition was wrong here and therefore oinkmaster never has
been executed when this setting has been changed.

Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
2021-12-19 13:23:45 +01:00
Stefan Schantl
7131a7bd94 ids.cgi: Allow whitespaces when parsing the rules files.
Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
2021-12-19 13:23:44 +01:00
Stefan Schantl
ded4348d0d ids.cgi: Do not expect a space before the sid when parsing rulefiles.
Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
2021-12-19 13:23:44 +01:00
Stefan Schantl
4015d3f499 ids.cgi: Sort elements in providers dropdown menu.
Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
2021-12-19 13:23:44 +01:00
Stefan Schantl
69b3156f74 IDS: Move read_enabled_disabled_sids_file() function to ids-functions.pl.
Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
2021-12-19 13:23:44 +01:00
Stefan Schantl
515a694d1c ids.cgi: Add code to handle the reset of a provider to it's defaults.
Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
2021-12-19 13:23:43 +01:00
Stefan Schantl
f3d421a3b1 ids.cgi: Make backend code for forced ruleset update working again.
Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
2021-12-19 13:23:43 +01:00
Stefan Schantl
962e58cdd4 ids.cgi: Add section for additional provider actions.
This section only will be displayed when an existing provider will be
edited and allows to reset a provider back to it's defaults or to force
a ruleset update.

Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
2021-12-19 13:23:43 +01:00
Stefan Schantl
7e1a09f925 ids.cgi: Fix display issue with colum backgound colour in provider list.
Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
2021-12-19 13:23:43 +01:00
Stefan Schantl
0c5b2f6da3 ids.cgi: Handle oinkmaster provider includes when deleting a provider.
Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
2021-12-19 13:23:43 +01:00
Stefan Schantl
ce40fddefc ids.cgi: Fix function call of get_used_provider_rulesfile_file().
The function is locatated in the IDS module and therefore needs to be
called from there.

Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
2021-12-19 13:23:43 +01:00
Stefan Schantl
eade546821 ids.cgi: Add/Remove provider file include in oinkmaster providers
include file when toggeling a provider.

Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
2021-12-19 13:23:43 +01:00
Stefan Schantl
5d523e4161 ids.cgi: Use get_oinkmaster_provider_modified_sids_file() function.
Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
2021-12-19 13:23:43 +01:00
Stefan Schantl
15832b10c2 IDS: Redesign backend for enabled/disabled sids in rulefiles.
The enabled or disabled sids now will be written to an own
provider exclusive configuration file which dynamically will
be included by oinkmaster if needed.

Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
2021-12-19 13:23:43 +01:00
Stefan Schantl
593abb3510 ids.cgi: Use get_ruleset_date() from ids-functions.pl.
Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
2021-12-19 13:23:42 +01:00
Stefan Schantl
02fee15e0e ids.cgi: Prevent from chainging the provider when editing an existing
one.

This commit locks the dropdown menu for selecting a provider, in case
an existing one should be edited.

Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
2021-12-19 13:23:42 +01:00
Stefan Schantl
1fa187335b ids.cgi: Add hardcoded error message to language files.
Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
2021-12-19 13:23:42 +01:00
Stefan Schantl
4b6cf2a54a ids.cgi: Fix check and message when trying to enable suricata without
any enabled or no provider.

Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
2021-12-19 13:23:42 +01:00
Stefan Schantl
106f00bdbb ids.cgi: Lock the CGI when a provder will be deleted.
Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
2021-12-19 13:23:42 +01:00