Commit Graph

55 Commits

Author SHA1 Message Date
Adolf Belka
43fea080eb dns.cgi: Remove the decode and encode lines as now integrated in header.pl
- decode and encode lines have now been integrated into the cleanhtml subroutine in
   header.pl so that all uses of cleanhtml will be able to handle diacritical characters

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
ee9b73657e dns.cgi: Remove excess whitespace
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2024-03-14 09:26:19 +00:00
Adolf Belka
cd7a901109 dns.cgi: Add use Encode + encode back to UTF-8
- use Encode was missed out in the previous patch for dns.cgi This would mean that the
   decode from UTF-8 would fail. I had tested the previous change but forgot to copy across
   the use Encode line when I created the patch.
- This patch adds an encode back to UTF-8 after running the cleanhtml command. This way
   the text is decoded from UTF-8 so that the cleanhtml command works correctly on
   umlauted characters and then is encoded back to UTF-8 so that all text in the cgi page
   is UTF-8.

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-03-14 09:24:33 +00:00
Adolf Belka
716b8fb503 dns.cgi: Fixes bug#12395 - German umlauts not correctly displayed in remarks
- If Freifunk München e.V. is entered as a remark it gets converted to
   Freifunk München e.V.
- This is because cleanhtml is used on the UTF-8 remark text before saving it to the file
   and the HTML::Entities::encode_entities command that is run on that remark text does
   not work with UTF-8 text.
- If the UTF-8 text in the remark is decoded before running through the cleanhtml command
   then the characters with diacritical marks are correctly shown.
- Have tested out the fix on a remark with a range of different characters with
   diacritical marks and all of the ones tested were displayed correctly with the fix while
   in the original form they were mangled.

Fixes: Bug#12395
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-03-12 09:30:50 +00:00
Adolf Belka
5a7342fc28 dns.cgi: Revert "dns.cgi: Fixes bug#12395 - German umlauts not correctly displayed in remarks"
- This reverts commit 7c6ff5ff12
- That commit removed the cleanhtml command which is not advised, based on feedback from
   Michael Tremer from other patch submissions as it creates a potential security problem.

Signed-off-by: Adolf Belka <adolf.belka@ipfire.org>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2024-03-12 09:30:50 +00:00
Adolf Belka
7c6ff5ff12 dns.cgi: Fixes bug#12395 - German umlauts not correctly displayed in remarks
- If Freifunk München e.V. is entered as a remark it gets converted to
   Freifunk München e.V.
- This is because cleanhtml is used on the remark text before saving it to the file  and
   the HTML::Entities::encode_entities command that is run on that remark text encodes all
   higher bit characters as unsafe characters and replaces them with their HTML entity
   representation.
- Have tested out the remark with a range of different characters with diacritical marks
   and all of the ones tested were re-written.
- The use of the cleanhtml makes sense when used on URL's or on text that is going to be
   printed as part of the HTML code for a page but it doesn't seem to make sense for text
   used in a remark.
- The cleanhtml function is only used on the remark text in dns.cgi and not on any other
   entries on the page.
- Removing the call to the cleanhtml function results in the German umlauts being printed
   in the remark section.
- Many of the WUI pages have the cleanhtml function used on remark or comment text.
- fwhosts.cgi does not use cleanhtml anywhere. So all its remark sections work with
   characters with diacritical marks.
- If this patch is accepted, I will then submit patches for the other WUI pages where
   characters with diacritical marks are re-written in remark or comment sections.

Fixes: Bug#12395
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-28 16:10:28 +00:00
Peter Müller
c04309ef01 Do not mark CGI files as executable
Signed-off-by: Peter Müller <peter.mueller@ipfire.org>
2022-04-23 19:35:37 +00:00
Michael Tremer
8a1e6afef5 dns.cgi: Use new system commands
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2021-06-10 14:30:52 +01: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
Peter Müller
358e42ffbf langs: add changed strings to German and English translations
Signed-off-by: Peter Müller <peter.mueller@ipfire.org>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2020-11-11 16:01:51 +00:00
Michael Tremer
65ef52a335 DNS: Make YouTube configurable for Safe Search
When safe search is enabled, it is being enabled on YouTube, too.

This creates problems in some scenarios like schools where politics
is being tought as well as other subjects that might be censored by
YouTube (i.e. election TV spots).

Therefore it is now possible to exclude YouTube from Safe Search
but keep it enabled for the search engines.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2020-11-11 12:08:21 +00:00
Stefan Schantl
07e42be978 Adjust CGI files to work with latest location-function.pl changes.
Fixes #12515.

Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2020-11-09 14:07:21 +00:00
Matthias Fischer
743808bb8e dns.cgi: Cosmetics and customized translations
Updated/deleted redundant, unused or missing translation strings for dns.cgi

Affected:  'dns', 'dns title', 'dns server', 'dns servers'

Signed-off-by: Matthias Fischer <matthias.fischer@ipfire.org>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2020-11-07 13:27:25 +00:00
Stefan Schantl
4346cb6660 dns.cgi: Use location-functions.pl
Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
2020-06-12 17:59:43 +02:00
Arne Fitzenreiter
80bed5817d dns.cgi: restart suricata before unbound reload
if unbound is reloaded it start a bunch of dns queries
so suricata needs to now which servers should used.

Signed-off-by: Arne Fitzenreiter <arne_f@ipfire.org>
2020-03-04 21:38:24 +00:00
Michael Tremer
18e97c76b0 dns.cgi: Do not show table header if no servers are configured
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Signed-off-by: Arne Fitzenreiter <arne_f@ipfire.org>
2020-02-16 15:58:09 +00:00
Arne Fitzenreiter
f2d2c69787 dns.cgi: increase timeout to 5s
Signed-off-by: Arne Fitzenreiter <arne_f@ipfire.org>
2020-01-30 12:24:24 +00:00
Michael Tremer
38f51465c9 dns.cgi: Shorten time when checking if DNS is alive
For localhost, one second should be plenty

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2020-01-29 11:47:35 +01:00
Michael Tremer
351ad526b2 dns.cgi: Show recursor mode message even when we have some servers to show
The message was not shown when we have received DNS servers from the
provider.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2020-01-29 11:40:59 +01:00
Stefan Schantl
4a791d2ab9 dns.cgi: Display when unbound is running in recursor mode.
Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
Reviewed-by: Peter Müller <peter.mueller@ipfire.org>
Signed-off-by: Arne Fitzenreiter <arne_f@ipfire.org>
2020-01-21 19:33:43 +00:00
Stefan Schantl
19602b681f dns.cgi: Fix ID and greater than checks.
Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
Signed-off-by: Arne Fitzenreiter <arne_f@ipfire.org>
2020-01-14 21:01:44 +00:00
Stefan Schantl
3a5866ac2b dns.cgi: Set kdig params for timeout and retry back to default.
Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
Acked-by: Michael Tremer <michael.tremer@ipfire.org>
Signed-off-by: Arne Fitzenreiter <arne_f@ipfire.org>
2020-01-14 21:01:42 +00:00
Michael Tremer
a25dcda295 dns.cgi: Fix check for undefined variable
This was positive when zero was returned.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2020-01-13 20:44:55 +01:00
Stefan Schantl
39a6219fff dns.cgi: Show error when trying to use ISP nameservers and TLS at the same time.
Because the ISP-assigned nameservers do not have any TLS-hostname
information they cannot be used, when TLS is activated.

They only can be used if they will be added as "regular" DNS servers
with a TLS-hostname.

Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
2020-01-13 17:40:29 +01:00
Stefan Schantl
611587cf29 dns.cgi: Fix id compare when adding a new nameserver.
I do not know why perl when using "le" which means "less-or-equal"
defines a "10" as "1".

This commit fixes the issue that it was not possible to add more than 8
nameservers.

Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
2020-01-13 10:42:56 +01:00
Stefan Schantl
4caa0efc59 ids.cgi: Do reload instead of restarting unbound
Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
2020-01-11 19:37:50 +01:00
Stefan Schantl
f03f34298b dns.cgi: Only perform reverse lookup if DNS is working.
Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
2020-01-11 19:34:12 +01:00
Stefan Schantl
8fbb12f168 dns.cgi: Restart suricata if neccessary.
When the DNS configuration of the system is changed,
we need to re-generate the file which contains the DNS Server
details for suricata and to restart the service.

Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
2020-01-09 16:36:39 +01:00
Stefan Schantl
9702252470 dns.cgi: Move grab_address_from_file function to general-functions.pl
Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
2020-01-08 18:44:41 +01:00
Stefan Schantl
8f4bde6574 dns.cgi: Also restart unbound if a server got enabled/disabled
Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
2020-01-08 18:19:58 +01:00
Stefan Schantl
46cc88ed22 dns.cgi: Remove accidently commited debug code
Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
2020-01-08 18:15:33 +01:00
Stefan Schantl
719db1cdb8 dns.cgi: Restart unbound
Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
2020-01-08 18:12:38 +01:00
Stefan Schantl
770ea81ee5 dns.cgi: Display DNS system status.
For this, a test query to the local unbound instance will be
sent and if the DNS system work properly can be answerd.

Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
2020-01-08 18:00:15 +01:00
Stefan Schantl
4314099302 dns.cgi: Perform server checks on user request
Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
2020-01-08 17:44:55 +01:00
Stefan Schantl
a969acc7d7 dns.cgi: Remove hard-coded box title.
Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
2020-01-08 15:22:56 +01:00
Stefan Schantl
03e466de35 dns.cgi: Do not perform kdig tests when adding a server
Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
2020-01-08 12:58:50 +01:00
Stefan Schantl
038f962ea0 dns.cgi: Check for empty server address.
Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
2020-01-08 12:12:29 +01:00
Stefan Schantl
70187da6a6 dns.cgi: Perform kdig tests only if the system is online.
Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
2020-01-08 11:13:05 +01:00
Stefan Schantl
f36855fe73 dns.cgi: Introduce red_is_active()
Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
2020-01-08 11:12:42 +01:00
Stefan Schantl
f10fb4bf43 dns.cgi: Always display the input field for TLS_HOSTNAME
* Mark it as required if the protocol is set to TLS.

Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
2020-01-08 10:35:52 +01:00
Stefan Schantl
25dda4a082 dns.cgi: Only perform reverse lookups if the system is online
Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
2020-01-08 10:35:24 +01:00
Michael Tremer
77c7a94cdd dns.cgi: Show ISP name servers as disabled
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2020-01-07 14:49:54 +00:00
Michael Tremer
984f14bdc4 dns.cgi: Fix handling of WARNINGs from kdig
There might be multiple warnings which must all be shown
to the user.

Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2020-01-07 14:41:13 +00:00
Michael Tremer
71471d9bde dns.cgi: Remove smartmatch operator
Perl likes to make things difficult

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2020-01-07 13:46:11 +00:00
Michael Tremer
dab1258a78 dns.cgi: Timeout after 2 seconds for DNS server checks
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2020-01-07 13:45:21 +00:00
Michael Tremer
1434fa0df5 DNS: Write name servers received from ISP to /var/run/dns{1,2}
Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2020-01-07 13:35:45 +00:00
Michael Tremer
3bf804e834 dns.cgi: Set EDNS buffer size to 1232
References: #12240
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2020-01-07 11:06:10 +00:00
Stefan Schantl
24d7c5ef6b dns.cgi: Rework to allow central DNS configuration.
Fixes #12237.

Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
2020-01-07 10:30:37 +01:00
peter.mueller@ipfire.org
fe9fb38682 fix link to public DNS server list in dns.cgi
Fixes: #11851

Reported-by: Dani W <assgex@gmail.com>
Signed-off-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>
2019-10-14 17:41:49 +00:00
Jonatan Schlag
4c8f144e58 Fix URL to list of public name servers in dns.cgi
We have only one english wiki, so the link to the list of public
dns servers can point directly to the right page.
(The link was also not correct).

Fixes: #11191

Signed-off-by: Jonatan Schlag <jonatan.schlag@ipfire.org>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2016-09-24 12:25:46 +01:00