From: Michael Tremer <michael.tremer@ipfire.org>
To: development@lists.ipfire.org
Subject: Re: [PATCH 1/2] squid / WPAD: Add GUI for exception-files for generation of proxy.pac
Date: Thu, 18 Apr 2019 11:27:11 +0100 [thread overview]
Message-ID: <11B054C6-E738-4642-9FE2-773D56FBFAC4@ipfire.org> (raw)
In-Reply-To: <1555545258-20523-1-git-send-email-ipfire@starkstromkonsument.de>
[-- Attachment #1: Type: text/plain, Size: 15258 bytes --]
This looks good. Good work!
And also fast :)
I didn’t run it yet, so I do not know where the boxes on the page have gone and if that position makes sense to me.
> On 18 Apr 2019, at 00:54, Alexander Koch <ipfire(a)starkstromkonsument.de> wrote:
>
> This patch adds the missing Web-GUI for the WPAD-Exceptions to proxy.cgi
>
> Note: The translations are only done for "en" and "de" yet!
Those are a problem though. If you do not have translations, please leave them empty. The web UI will automatically fall back to the English string. But when the strings exist, we won’t know that they are not translated.
Would you please submit without the other translations?
-Michael
>
> Signed-off-by: Alexander Koch <ipfire(a)starkstromkonsument.de>
> ---
> html/cgi-bin/proxy.cgi | 110 +++++++++++++++++++++++++++++++++++++++++++++++--
> langs/de/cgi-bin/de.pl | 7 ++++
> langs/en/cgi-bin/en.pl | 7 ++++
> langs/es/cgi-bin/es.pl | 7 ++++
> langs/fr/cgi-bin/fr.pl | 7 ++++
> langs/it/cgi-bin/it.pl | 7 ++++
> langs/nl/cgi-bin/nl.pl | 7 ++++
> langs/pl/cgi-bin/pl.pl | 7 ++++
> langs/ru/cgi-bin/ru.pl | 7 ++++
> langs/tr/cgi-bin/tr.pl | 7 ++++
> 10 files changed, 169 insertions(+), 4 deletions(-)
>
> diff --git a/html/cgi-bin/proxy.cgi b/html/cgi-bin/proxy.cgi
> index 369a5cb..46908d2 100644
> --- a/html/cgi-bin/proxy.cgi
> +++ b/html/cgi-bin/proxy.cgi
> @@ -559,6 +559,8 @@ ERROR:
> delete $proxysettings{'SRC_UNRESTRICTED_MAC'};
> delete $proxysettings{'DST_NOCACHE'};
> delete $proxysettings{'DST_NOAUTH'};
> + delete $proxysettings{'DST_NOPROXY_IP'};
> + delete $proxysettings{'DST_NOPROXY_URL'};
> delete $proxysettings{'PORTS_SAFE'};
> delete $proxysettings{'PORTS_SSL'};
> delete $proxysettings{'MIME_TYPES'};
> @@ -1318,6 +1320,58 @@ END
> ;
> }
>
> +# ===================================================================
> +# WPAD settings
> +# ===================================================================
> +
> +print <<END
> +<table width='100%'>
> +<tr>
> + <td colspan='4'><b>$Lang::tr{'advproxy wpad title'}</b></td>
> +</tr>
> +<tr>
> + <td width='25%'></td> <td width='20%'> </td><td width='25%'> </td><td width='30%'></td>
> +</tr>
> +<tr>
> + <td colspan='2' class='base'>$Lang::tr{'advproxy wpad label dst_noproxy_ip'}:</td>
> + <td colspan='2' class='base'>$Lang::tr{'advproxy wpad label dst_noproxy_url'}:</td>
> +</tr>
> +<tr>
> + <td colspan='2'><textarea name='DST_NOPROXY_IP' cols='32' rows='3' wrap='off'>
> +END
> +;
> +
> + print $proxysettings{'DST_NOPROXY_IP'};
> +
> +print <<END
> + </textarea></td>
> +
> + <td colspan='2'><textarea name='DST_NOPROXY_URL' cols='32' rows='3' wrap='off'>
> +END
> +;
> +
> + print $proxysettings{'DST_NOPROXY_URL'};
> +
> +print <<END
> + </textarea></td>
> +</tr>
> +<tr>
> + <td colspan='2' class='base'>$Lang::tr{'advproxy wpad example dst_noproxy_ip'}</td>
> + <td colspan='2' class='base'>$Lang::tr{'advproxy wpad example dst_noproxy_url'}</td>
> +</tr>
> +<tr>
> + <td colspan="4"> </td>
> +</tr>
> +<tr>
> + <td colspan="4">$Lang::tr{'advproxy wpad view pac'}: <a href="http://$ENV{SERVER_ADDR}:81/wpad.dat" target="_blank">http://$ENV{SERVER_ADDR}:81/wpad.dat</a></td>
> +</tr>
> +</table>
> +
> +<hr size='1'>
> +
> +END
> +;
> +
> # -------------------------------------------------------------------
>
> print <<END
> @@ -2261,6 +2315,18 @@ sub read_acls
> while (<FILE>) { $proxysettings{'DST_NOAUTH'} .= $_ };
> close(FILE);
> }
> + if (-e "$acl_dst_noproxy_ip") {
> + open(FILE,"$acl_dst_noproxy_ip");
> + delete $proxysettings{'DST_NOPROXY_IP'};
> + while (<FILE>) { $proxysettings{'DST_NOPROXY_IP'} .= $_ };
> + close(FILE);
> + }
> + if (-e "$acl_dst_noproxy_url") {
> + open(FILE,"$acl_dst_noproxy_url");
> + delete $proxysettings{'DST_NOPROXY_URL'};
> + while (<FILE>) { $proxysettings{'DST_NOPROXY_URL'} .= $_ };
> + close(FILE);
> + }
> if (-e "$acl_ports_safe") {
> open(FILE,"$acl_ports_safe");
> delete $proxysettings{'PORTS_SAFE'};
> @@ -2446,6 +2512,31 @@ sub check_acls
> }
> }
>
> + @temp = split(/\n/,$proxysettings{'DST_NOPROXY_IP'});
> + undef $proxysettings{'DST_NOPROXY_IP'};
> + foreach (@temp)
> + {
> + s/^\s+//g; s/\s+$//g;
> + if ($_)
> + {
> + unless (&General::validipormask($_)) { $errormessage = $Lang::tr{'advproxy errmsg wpad invalid ip or mask'}; }
> + $proxysettings{'DST_NOPROXY_IP'} .= $_."\n";
> + }
> + }
> +
> + @temp = split(/\n/,$proxysettings{'DST_NOPROXY_URL'});
> + undef $proxysettings{'DST_NOPROXY_URL'};
> + foreach (@temp)
> + {
> + s/^\s+//g;
> + unless (/^#/) { s/\s+//g; }
> + if ($_)
> + {
> + if (/^\./) { $_ = '*'.$_; }
> + $proxysettings{'DST_NOPROXY_URL'} .= $_."\n";
> + }
> + }
> +
> if (($proxysettings{'NTLM_ENABLE_ACL'} eq 'on') && ($proxysettings{'NTLM_USER_ACL'} eq 'positive'))
> {
> @temp = split(/\n/,$proxysettings{'NTLM_ALLOW_USERS'});
> @@ -2584,6 +2675,16 @@ sub write_acls
> print FILE $proxysettings{'DST_NOAUTH'};
> close(FILE);
>
> + open(FILE, ">$acl_dst_noproxy_ip");
> + flock(FILE, 2);
> + print FILE $proxysettings{'DST_NOPROXY_IP'};
> + close(FILE);
> +
> + open(FILE, ">$acl_dst_noproxy_url");
> + flock(FILE, 2);
> + print FILE $proxysettings{'DST_NOPROXY_URL'};
> + close(FILE);
> +
> open(FILE, ">$acl_dst_noauth_net");
> close(FILE);
> open(FILE, ">$acl_dst_noauth_dom");
> @@ -2769,7 +2870,7 @@ END
> # Additional exceptions for URLs
> # The file has to be created by the user and should contain one entry per line
> # Line-Format: <URL incl. wildcards>
> - # e.g. *ipfire.org*
> + # e.g. *.ipfire.org*
> if (-s "$acl_dst_noproxy_url") {
> undef @templist;
>
> @@ -2786,8 +2887,8 @@ END
>
> # Additional exceptions for Subnets
> # The file has to be created by the user and should contain one entry per line
> - # Line-Format: "<IP>", "<SUBNET MASK>"
> - # e.g. "192.168.0.0", "255.255.255.0"
> + # Line-Format: <IP>/<SUBNET MASK>
> + # e.g. 192.168.0.0/255.255.255.0
> if (-s "$acl_dst_noproxy_ip") {
> undef @templist;
>
> @@ -2798,7 +2899,8 @@ END
>
> foreach (@templist)
> {
> - print FILE " (isInNet(host, $_)) ||\n";
> + @temp = split(/\//);
> + print FILE " (isInNet(host, \"$temp[0]\", \"$temp[1]\")) ||\n";
> }
> }
>
> diff --git a/langs/de/cgi-bin/de.pl b/langs/de/cgi-bin/de.pl
> index d63ebe6..764ea60 100644
> --- a/langs/de/cgi-bin/de.pl
> +++ b/langs/de/cgi-bin/de.pl
> @@ -396,6 +396,13 @@
> 'advproxy visible hostname' => 'Sichtbarer Hostname',
> 'advproxy web browser' => 'Web-Browser',
> 'advproxy wednesday' => 'Mi',
> +'advproxy wpad title' => 'Web Proxy Auto-Discovery Protocol (WPAD) / Proxy Auto-Config (PAC)',
> +'advproxy wpad label dst_noproxy_url' => 'Ausgenommene URL\'s (eine pro Zeile)',
> +'advproxy wpad label dst_noproxy_ip' => 'Ausgenommene IP-Subnetze (eins pro Zeile)',
> +'advproxy wpad example dst_noproxy_url' => 'z.B. *.ipfire.org*',
> +'advproxy wpad example dst_noproxy_ip' => 'z.B. 192.168.2.0/255.255.255.0',
> +'advproxy errmsg wpad invalid ip or mask' => 'WPAD: Ungültige IP oder Subnetz für ausgenommenes IP-Subnetz',
> +'advproxy wpad view pac' => 'PAC-Datei aufrufen',
> 'again' => 'Wiederholung:',
> 'age second' => 'Sekunde',
> 'age seconds' => 'Sekunden',
> diff --git a/langs/en/cgi-bin/en.pl b/langs/en/cgi-bin/en.pl
> index a709604..c66914d 100644
> --- a/langs/en/cgi-bin/en.pl
> +++ b/langs/en/cgi-bin/en.pl
> @@ -397,6 +397,13 @@
> 'advproxy visible hostname' => 'Visible hostname',
> 'advproxy web browser' => 'Web browser',
> 'advproxy wednesday' => 'Wed',
> +'advproxy wpad title' => 'Web Proxy Auto-Discovery Protocol (WPAD) / Proxy Auto-Config (PAC)',
> +'advproxy wpad label dst_noproxy_url' => 'Excluded URL\'s (one per line)',
> +'advproxy wpad label dst_noproxy_ip' => 'Excluded IP-Subnets (one per line)',
> +'advproxy wpad example dst_noproxy_url' => 'e.g. *.ipfire.org*',
> +'advproxy wpad example dst_noproxy_ip' => 'e.g. 192.168.2.0/255.255.255.0',
> +'advproxy errmsg wpad invalid ip or mask' => 'WPAD: Invalid IP or subnet for excluded IP-subnet',
> +'advproxy wpad view pac' => 'Open PAC-File',
> 'again' => 'Again:',
> 'age second' => 'second',
> 'age seconds' => 'seconds',
> diff --git a/langs/es/cgi-bin/es.pl b/langs/es/cgi-bin/es.pl
> index 23bc207..f960461 100644
> --- a/langs/es/cgi-bin/es.pl
> +++ b/langs/es/cgi-bin/es.pl
> @@ -316,6 +316,13 @@
> 'advproxy visible hostname' => 'Nombre de host visible',
> 'advproxy web browser' => 'Navegador Web',
> 'advproxy wednesday' => 'Mie',
> +'advproxy wpad title' => 'Web Proxy Auto-Discovery Protocol (WPAD) / Proxy Auto-Config (PAC)',
> +'advproxy wpad label dst_noproxy_url' => 'Excluded URL\'s (one per line)',
> +'advproxy wpad label dst_noproxy_ip' => 'Excluded IP-Subnets (one per line)',
> +'advproxy wpad example dst_noproxy_url' => 'e.g. *.ipfire.org*',
> +'advproxy wpad example dst_noproxy_ip' => 'e.g. 192.168.2.0/255.255.255.0',
> +'advproxy errmsg wpad invalid ip or mask' => 'WPAD: Invalid IP or subnet for excluded IP-subnet',
> +'advproxy wpad view pac' => 'Open PAC-File',
> 'again' => 'De nuevo:',
> 'aktiv' => 'Activo',
> 'album' => 'Album',
> diff --git a/langs/fr/cgi-bin/fr.pl b/langs/fr/cgi-bin/fr.pl
> index b4ecf32..f5d3e51 100644
> --- a/langs/fr/cgi-bin/fr.pl
> +++ b/langs/fr/cgi-bin/fr.pl
> @@ -394,6 +394,13 @@
> 'advproxy visible hostname' => 'Nom d\'hôte visible ',
> 'advproxy web browser' => 'Navigateur web',
> 'advproxy wednesday' => 'Mer',
> +'advproxy wpad title' => 'Web Proxy Auto-Discovery Protocol (WPAD) / Proxy Auto-Config (PAC)',
> +'advproxy wpad label dst_noproxy_url' => 'Excluded URL\'s (one per line)',
> +'advproxy wpad label dst_noproxy_ip' => 'Excluded IP-Subnets (one per line)',
> +'advproxy wpad example dst_noproxy_url' => 'e.g. *.ipfire.org*',
> +'advproxy wpad example dst_noproxy_ip' => 'e.g. 192.168.2.0/255.255.255.0',
> +'advproxy errmsg wpad invalid ip or mask' => 'WPAD: Invalid IP or subnet for excluded IP-subnet',
> +'advproxy wpad view pac' => 'Open PAC-File',
> 'again' => 'De nouveau :',
> 'age second' => 'seconde',
> 'age seconds' => 'secondes',
> diff --git a/langs/it/cgi-bin/it.pl b/langs/it/cgi-bin/it.pl
> index 6c9137c..2b819ff 100644
> --- a/langs/it/cgi-bin/it.pl
> +++ b/langs/it/cgi-bin/it.pl
> @@ -331,6 +331,13 @@
> 'advproxy visible hostname' => 'Hostname Visible',
> 'advproxy web browser' => 'Web browser',
> 'advproxy wednesday' => 'Mer',
> +'advproxy wpad title' => 'Web Proxy Auto-Discovery Protocol (WPAD) / Proxy Auto-Config (PAC)',
> +'advproxy wpad label dst_noproxy_url' => 'Excluded URL\'s (one per line)',
> +'advproxy wpad label dst_noproxy_ip' => 'Excluded IP-Subnets (one per line)',
> +'advproxy wpad example dst_noproxy_url' => 'e.g. *.ipfire.org*',
> +'advproxy wpad example dst_noproxy_ip' => 'e.g. 192.168.2.0/255.255.255.0',
> +'advproxy errmsg wpad invalid ip or mask' => 'WPAD: Invalid IP or subnet for excluded IP-subnet',
> +'advproxy wpad view pac' => 'Open PAC-File',
> 'again' => 'Again:',
> 'age second' => 'Secondi',
> 'age seconds' => 'Secondi',
> diff --git a/langs/nl/cgi-bin/nl.pl b/langs/nl/cgi-bin/nl.pl
> index 5fa89b1..a2b4633 100644
> --- a/langs/nl/cgi-bin/nl.pl
> +++ b/langs/nl/cgi-bin/nl.pl
> @@ -330,6 +330,13 @@
> 'advproxy visible hostname' => 'Zichtbare hostnaam',
> 'advproxy web browser' => 'Webbrowser',
> 'advproxy wednesday' => 'Woe',
> +'advproxy wpad title' => 'Web Proxy Auto-Discovery Protocol (WPAD) / Proxy Auto-Config (PAC)',
> +'advproxy wpad label dst_noproxy_url' => 'Excluded URL\'s (one per line)',
> +'advproxy wpad label dst_noproxy_ip' => 'Excluded IP-Subnets (one per line)',
> +'advproxy wpad example dst_noproxy_url' => 'e.g. *.ipfire.org*',
> +'advproxy wpad example dst_noproxy_ip' => 'e.g. 192.168.2.0/255.255.255.0',
> +'advproxy errmsg wpad invalid ip or mask' => 'WPAD: Invalid IP or subnet for excluded IP-subnet',
> +'advproxy wpad view pac' => 'Open PAC-File',
> 'again' => 'Nogmaals:',
> 'age second' => 'seconde',
> 'age seconds' => 'seconden',
> diff --git a/langs/pl/cgi-bin/pl.pl b/langs/pl/cgi-bin/pl.pl
> index 521381a..ab2ef42 100644
> --- a/langs/pl/cgi-bin/pl.pl
> +++ b/langs/pl/cgi-bin/pl.pl
> @@ -318,6 +318,13 @@
> 'advproxy visible hostname' => 'Widoczna nazwa hosta',
> 'advproxy web browser' => 'Przeglądarka WWW',
> 'advproxy wednesday' => 'Śr',
> +'advproxy wpad title' => 'Web Proxy Auto-Discovery Protocol (WPAD) / Proxy Auto-Config (PAC)',
> +'advproxy wpad label dst_noproxy_url' => 'Excluded URL\'s (one per line)',
> +'advproxy wpad label dst_noproxy_ip' => 'Excluded IP-Subnets (one per line)',
> +'advproxy wpad example dst_noproxy_url' => 'e.g. *.ipfire.org*',
> +'advproxy wpad example dst_noproxy_ip' => 'e.g. 192.168.2.0/255.255.255.0',
> +'advproxy errmsg wpad invalid ip or mask' => 'WPAD: Invalid IP or subnet for excluded IP-subnet',
> +'advproxy wpad view pac' => 'Open PAC-File',
> 'again' => 'Ponownie:',
> 'aktiv' => 'Aktywny',
> 'album' => 'Album',
> diff --git a/langs/ru/cgi-bin/ru.pl b/langs/ru/cgi-bin/ru.pl
> index 9ac46d4..1963468 100644
> --- a/langs/ru/cgi-bin/ru.pl
> +++ b/langs/ru/cgi-bin/ru.pl
> @@ -316,6 +316,13 @@
> 'advproxy visible hostname' => 'Видимое имя хоста',
> 'advproxy web browser' => 'Веб Браузер: ',
> 'advproxy wednesday' => 'Ср',
> +'advproxy wpad title' => 'Web Proxy Auto-Discovery Protocol (WPAD) / Proxy Auto-Config (PAC)',
> +'advproxy wpad label dst_noproxy_url' => 'Excluded URL\'s (one per line)',
> +'advproxy wpad label dst_noproxy_ip' => 'Excluded IP-Subnets (one per line)',
> +'advproxy wpad example dst_noproxy_url' => 'e.g. *.ipfire.org*',
> +'advproxy wpad example dst_noproxy_ip' => 'e.g. 192.168.2.0/255.255.255.0',
> +'advproxy errmsg wpad invalid ip or mask' => 'WPAD: Invalid IP or subnet for excluded IP-subnet',
> +'advproxy wpad view pac' => 'Open PAC-File',
> 'again' => 'Ещё раз:',
> 'aktiv' => 'Активен',
> 'album' => 'Альбом',
> diff --git a/langs/tr/cgi-bin/tr.pl b/langs/tr/cgi-bin/tr.pl
> index 1917b82..d23616d 100644
> --- a/langs/tr/cgi-bin/tr.pl
> +++ b/langs/tr/cgi-bin/tr.pl
> @@ -394,6 +394,13 @@
> 'advproxy visible hostname' => 'Ana bilgisayar adını göster',
> 'advproxy web browser' => 'İnternet tarayıcısı',
> 'advproxy wednesday' => 'Çar',
> +'advproxy wpad title' => 'Web Proxy Auto-Discovery Protocol (WPAD) / Proxy Auto-Config (PAC)',
> +'advproxy wpad label dst_noproxy_url' => 'Excluded URL\'s (one per line)',
> +'advproxy wpad label dst_noproxy_ip' => 'Excluded IP-Subnets (one per line)',
> +'advproxy wpad example dst_noproxy_url' => 'e.g. *.ipfire.org*',
> +'advproxy wpad example dst_noproxy_ip' => 'e.g. 192.168.2.0/255.255.255.0',
> +'advproxy errmsg wpad invalid ip or mask' => 'WPAD: Invalid IP or subnet for excluded IP-subnet',
> +'advproxy wpad view pac' => 'Open PAC-File',
> 'again' => 'Tekrar:',
> 'age second' => 'saniye',
> 'age seconds' => 'saniye',
> --
> 2.7.4
>
next prev parent reply other threads:[~2019-04-18 10:27 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-04-14 10:08 [PATCH] squid / WPAD: Add " Alexander Koch
2019-04-15 9:43 ` Michael Tremer
2019-04-15 20:12 ` Alexander Koch
2019-04-17 14:08 ` Michael Tremer
2019-04-17 23:54 ` [PATCH 1/2] squid / WPAD: Add GUI for " Alexander Koch
2019-04-17 23:54 ` [PATCH 2/2] apache / WPAD: Add correct MIME type for wpad.dat and proxy.pac Alexander Koch
2019-04-23 15:23 ` Alexander Koch
2019-04-24 10:55 ` Michael Tremer
2019-04-18 10:27 ` Michael Tremer [this message]
2019-04-18 1:41 ` [PATCH] squid / WPAD: Add exception-files for generation of proxy.pac Alexander Koch
2019-04-18 10:33 ` Michael Tremer
2019-04-21 21:56 ` [PATCH 1/2] squid / WPAD: Add GUI for " Alexander Koch
2019-04-21 21:56 ` [PATCH 2/2] squid / WPAD: Add Wiki-Link for required further adjustments to GUI Alexander Koch
2019-04-22 8:02 ` [PATCH 1/2] squid / WPAD: Add GUI for exception-files for generation of proxy.pac Matthias Fischer
2019-04-22 14:06 ` Tom Rymes
2019-04-22 15:10 ` Matthias Fischer
2019-04-22 18:46 ` Michael Tremer
2019-04-23 16:29 ` Matthias Fischer
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=11B054C6-E738-4642-9FE2-773D56FBFAC4@ipfire.org \
--to=michael.tremer@ipfire.org \
--cc=development@lists.ipfire.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox