From mboxrd@z Thu Jan 1 00:00:00 1970 From: Michael Tremer To: development@lists.ipfire.org Subject: [PATCH 4/8] pakfire.cgi: Add UI to select repository Date: Tue, 11 Feb 2020 14:28:49 +0000 Message-ID: <20200211142853.8561-5-michael.tremer@ipfire.org> In-Reply-To: <20200211142853.8561-1-michael.tremer@ipfire.org> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1875375840926353506==" List-Id: --===============1875375840926353506== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Signed-off-by: Michael Tremer --- doc/language_issues.de | 5 +++++ doc/language_issues.en | 5 +++++ doc/language_issues.es | 5 +++++ doc/language_issues.fr | 5 +++++ doc/language_issues.it | 5 +++++ doc/language_issues.nl | 5 +++++ doc/language_issues.pl | 5 +++++ doc/language_issues.ru | 5 +++++ doc/language_issues.tr | 5 +++++ doc/language_missings | 40 +++++++++++++++++++++++++++++++++ html/cgi-bin/pakfire.cgi | 48 +++++++++++++++++++++++++++++++++++++++- langs/en/cgi-bin/en.pl | 5 +++++ 12 files changed, 137 insertions(+), 1 deletion(-) diff --git a/doc/language_issues.de b/doc/language_issues.de index 89a703fcb..361133708 100644 --- a/doc/language_issues.de +++ b/doc/language_issues.de @@ -829,6 +829,11 @@ WARNING: untranslated string: guardian no entries =3D un= known string WARNING: untranslated string: guardian service =3D unknown string WARNING: untranslated string: itlb multihit =3D iTLB MultiHit WARNING: untranslated string: not validating =3D Not validating +WARNING: untranslated string: pakfire invalid tree =3D Invalid repository se= lected +WARNING: untranslated string: pakfire tree =3D Repository +WARNING: untranslated string: pakfire tree stable =3D Stable +WARNING: untranslated string: pakfire tree testing =3D Testing +WARNING: untranslated string: pakfire tree unstable =3D Unstable WARNING: untranslated string: route config changed =3D unknown string WARNING: untranslated string: routing config added =3D unknown string WARNING: untranslated string: routing config changed =3D unknown string diff --git a/doc/language_issues.en b/doc/language_issues.en index 10c2f87ce..2fd69f430 100644 --- a/doc/language_issues.en +++ b/doc/language_issues.en @@ -1440,12 +1440,17 @@ WARNING: untranslated string: pakfire core update lev= el =3D Core-Update-Level WARNING: untranslated string: pakfire install description =3D Please choose = one or more items from the list below and
click the plus to install. WARNING: untranslated string: pakfire install package =3D You want to instal= l the following packages:=20 WARNING: untranslated string: pakfire installed addons =3D Installed Addons: +WARNING: untranslated string: pakfire invalid tree =3D Invalid repository se= lected WARNING: untranslated string: pakfire last core list update =3D Last core li= st update made WARNING: untranslated string: pakfire last package update =3D Last packages = list update made WARNING: untranslated string: pakfire last serverlist update =3D Last server= list update made WARNING: untranslated string: pakfire last update =3D Last update made WARNING: untranslated string: pakfire possible dependency =3D There may be = depending packages, here is a list of packages that need to be installed. WARNING: untranslated string: pakfire system state =3D System Status +WARNING: untranslated string: pakfire tree =3D Repository +WARNING: untranslated string: pakfire tree stable =3D Stable +WARNING: untranslated string: pakfire tree testing =3D Testing +WARNING: untranslated string: pakfire tree unstable =3D Unstable WARNING: untranslated string: pakfire uninstall description =3D Please choos= e one or more items from the list below and
click the minus to uninsta= ll. WARNING: untranslated string: pakfire uninstall package =3D You want to unin= stall the following packages:=20 WARNING: untranslated string: pakfire working =3D Pakfire is working ... Ple= ase wait until all operations have completed successfully. diff --git a/doc/language_issues.es b/doc/language_issues.es index b97d017c3..af006fcdf 100644 --- a/doc/language_issues.es +++ b/doc/language_issues.es @@ -1233,6 +1233,11 @@ WARNING: untranslated string: ovpn warning rfc3280 =3D= Your host certificate is no WARNING: untranslated string: p2p block =3D P2P networks WARNING: untranslated string: p2p block save notice =3D Please reload the fi= rewall ruleset in order to apply your changes. WARNING: untranslated string: pakfire ago =3D ago. +WARNING: untranslated string: pakfire invalid tree =3D Invalid repository se= lected +WARNING: untranslated string: pakfire tree =3D Repository +WARNING: untranslated string: pakfire tree stable =3D Stable +WARNING: untranslated string: pakfire tree testing =3D Testing +WARNING: untranslated string: pakfire tree unstable =3D Unstable WARNING: untranslated string: please reboot to apply your changes =3D Please= reboot to apply your changes WARNING: untranslated string: pptp netconfig =3D My Net Config WARNING: untranslated string: pptp peer =3D Peer diff --git a/doc/language_issues.fr b/doc/language_issues.fr index 8e9d7babb..928c37a46 100644 --- a/doc/language_issues.fr +++ b/doc/language_issues.fr @@ -861,6 +861,11 @@ WARNING: untranslated string: info messages =3D unknown = string WARNING: untranslated string: no data =3D unknown string WARNING: untranslated string: not validating =3D Not validating WARNING: untranslated string: pakfire ago =3D ago. +WARNING: untranslated string: pakfire invalid tree =3D Invalid repository se= lected +WARNING: untranslated string: pakfire tree =3D Repository +WARNING: untranslated string: pakfire tree stable =3D Stable +WARNING: untranslated string: pakfire tree testing =3D Testing +WARNING: untranslated string: pakfire tree unstable =3D Unstable WARNING: untranslated string: route config changed =3D unknown string WARNING: untranslated string: routing config added =3D unknown string WARNING: untranslated string: routing config changed =3D unknown string diff --git a/doc/language_issues.it b/doc/language_issues.it index a4ea5e618..6471e0d41 100644 --- a/doc/language_issues.it +++ b/doc/language_issues.it @@ -1013,6 +1013,11 @@ WARNING: untranslated string: ovpn error dh =3D The Di= ffie-Hellman parameter needs WARNING: untranslated string: ovpn error md5 =3D You host certificate uses M= D5 for the signature which is not accepted anymore.
Please update to the = latest IPFire version and generate a new root and host certificate.

A= ll OpenVPN clients needs then to be renewed!
WARNING: untranslated string: ovpn tls auth =3D TLS Channel Protection: WARNING: untranslated string: ovpn warning rfc3280 =3D Your host certificate= is not RFC3280 compliant.
Please update to the latest IPFire version and= generate as soon as possible a new root and host certificate.

All Op= enVPN clients needs then to be renewed!
+WARNING: untranslated string: pakfire invalid tree =3D Invalid repository se= lected +WARNING: untranslated string: pakfire tree =3D Repository +WARNING: untranslated string: pakfire tree stable =3D Stable +WARNING: untranslated string: pakfire tree testing =3D Testing +WARNING: untranslated string: pakfire tree unstable =3D Unstable WARNING: untranslated string: please reboot to apply your changes =3D Please= reboot to apply your changes WARNING: untranslated string: pptp netconfig =3D My Net Config WARNING: untranslated string: pptp peer =3D Peer diff --git a/doc/language_issues.nl b/doc/language_issues.nl index ca1dee9b5..cc6cbe966 100644 --- a/doc/language_issues.nl +++ b/doc/language_issues.nl @@ -1045,6 +1045,11 @@ WARNING: untranslated string: ovpn generating the root= and host certificates =3D G WARNING: untranslated string: ovpn ha =3D Hash algorithm WARNING: untranslated string: ovpn tls auth =3D TLS Channel Protection: WARNING: untranslated string: ovpn warning rfc3280 =3D Your host certificate= is not RFC3280 compliant.
Please update to the latest IPFire version and= generate as soon as possible a new root and host certificate.

All Op= enVPN clients needs then to be renewed!
+WARNING: untranslated string: pakfire invalid tree =3D Invalid repository se= lected +WARNING: untranslated string: pakfire tree =3D Repository +WARNING: untranslated string: pakfire tree stable =3D Stable +WARNING: untranslated string: pakfire tree testing =3D Testing +WARNING: untranslated string: pakfire tree unstable =3D Unstable WARNING: untranslated string: please reboot to apply your changes =3D Please= reboot to apply your changes WARNING: untranslated string: pptp netconfig =3D My Net Config WARNING: untranslated string: pptp peer =3D Peer diff --git a/doc/language_issues.pl b/doc/language_issues.pl index b97d017c3..af006fcdf 100644 --- a/doc/language_issues.pl +++ b/doc/language_issues.pl @@ -1233,6 +1233,11 @@ WARNING: untranslated string: ovpn warning rfc3280 =3D= Your host certificate is no WARNING: untranslated string: p2p block =3D P2P networks WARNING: untranslated string: p2p block save notice =3D Please reload the fi= rewall ruleset in order to apply your changes. WARNING: untranslated string: pakfire ago =3D ago. +WARNING: untranslated string: pakfire invalid tree =3D Invalid repository se= lected +WARNING: untranslated string: pakfire tree =3D Repository +WARNING: untranslated string: pakfire tree stable =3D Stable +WARNING: untranslated string: pakfire tree testing =3D Testing +WARNING: untranslated string: pakfire tree unstable =3D Unstable WARNING: untranslated string: please reboot to apply your changes =3D Please= reboot to apply your changes WARNING: untranslated string: pptp netconfig =3D My Net Config WARNING: untranslated string: pptp peer =3D Peer diff --git a/doc/language_issues.ru b/doc/language_issues.ru index b76c83e56..a8cdef8b4 100644 --- a/doc/language_issues.ru +++ b/doc/language_issues.ru @@ -1229,6 +1229,11 @@ WARNING: untranslated string: ovpn tls auth =3D TLS Ch= annel Protection: WARNING: untranslated string: ovpn warning rfc3280 =3D Your host certificate= is not RFC3280 compliant.
Please update to the latest IPFire version and= generate as soon as possible a new root and host certificate.

All Op= enVPN clients needs then to be renewed!
WARNING: untranslated string: p2p block =3D P2P networks WARNING: untranslated string: p2p block save notice =3D Please reload the fi= rewall ruleset in order to apply your changes. +WARNING: untranslated string: pakfire invalid tree =3D Invalid repository se= lected +WARNING: untranslated string: pakfire tree =3D Repository +WARNING: untranslated string: pakfire tree stable =3D Stable +WARNING: untranslated string: pakfire tree testing =3D Testing +WARNING: untranslated string: pakfire tree unstable =3D Unstable WARNING: untranslated string: please reboot to apply your changes =3D Please= reboot to apply your changes WARNING: untranslated string: pptp netconfig =3D My Net Config WARNING: untranslated string: pptp peer =3D Peer diff --git a/doc/language_issues.tr b/doc/language_issues.tr index ef28f6ac8..c6c6ad599 100644 --- a/doc/language_issues.tr +++ b/doc/language_issues.tr @@ -923,6 +923,11 @@ WARNING: untranslated string: ovpn error dh =3D The Diff= ie-Hellman parameter needs WARNING: untranslated string: ovpn error md5 =3D You host certificate uses M= D5 for the signature which is not accepted anymore.
Please update to the = latest IPFire version and generate a new root and host certificate.

A= ll OpenVPN clients needs then to be renewed!
WARNING: untranslated string: ovpn tls auth =3D TLS Channel Protection: WARNING: untranslated string: ovpn warning rfc3280 =3D Your host certificate= is not RFC3280 compliant.
Please update to the latest IPFire version and= generate as soon as possible a new root and host certificate.

All Op= enVPN clients needs then to be renewed!
+WARNING: untranslated string: pakfire invalid tree =3D Invalid repository se= lected +WARNING: untranslated string: pakfire tree =3D Repository +WARNING: untranslated string: pakfire tree stable =3D Stable +WARNING: untranslated string: pakfire tree testing =3D Testing +WARNING: untranslated string: pakfire tree unstable =3D Unstable WARNING: untranslated string: please reboot to apply your changes =3D Please= reboot to apply your changes WARNING: untranslated string: processor vulnerability mitigations =3D Proces= sor Vulnerability Mitigations WARNING: untranslated string: ptr =3D PTR diff --git a/doc/language_missings b/doc/language_missings index 40724a80b..a427f5706 100644 --- a/doc/language_missings +++ b/doc/language_missings @@ -63,6 +63,11 @@ < notes < not validating < okay +< pakfire invalid tree +< pakfire tree +< pakfire tree stable +< pakfire tree testing +< pakfire tree unstable < quick control < shaping add options < show areas @@ -705,6 +710,11 @@ < ovpn warning rfc3280 < p2p block < p2p block save notice +< pakfire invalid tree +< pakfire tree +< pakfire tree stable +< pakfire tree testing +< pakfire tree unstable < please reboot to apply your changes < pptp netconfig < pptp peer @@ -942,6 +952,11 @@ < dns use protocol for dns queries < not validating < okay +< pakfire invalid tree +< pakfire tree +< pakfire tree stable +< pakfire tree testing +< pakfire tree unstable < standard < strict < working @@ -1182,6 +1197,11 @@ < ovpn error md5 < ovpn tls auth < ovpn warning rfc3280 +< pakfire invalid tree +< pakfire tree +< pakfire tree stable +< pakfire tree testing +< pakfire tree unstable < please reboot to apply your changes < pptp netconfig < pptp peer @@ -1564,6 +1584,11 @@ < ovpn reneg sec < ovpn tls auth < ovpn warning rfc3280 +< pakfire invalid tree +< pakfire tree +< pakfire tree stable +< pakfire tree testing +< pakfire tree unstable < please reboot to apply your changes < pptp netconfig < pptp peer @@ -2285,6 +2310,11 @@ < ovpn warning rfc3280 < p2p block < p2p block save notice +< pakfire invalid tree +< pakfire tree +< pakfire tree stable +< pakfire tree testing +< pakfire tree unstable < please reboot to apply your changes < pptp netconfig < pptp peer @@ -3121,6 +3151,11 @@ < ovpn warning rfc3280 < p2p block < p2p block save notice +< pakfire invalid tree +< pakfire tree +< pakfire tree stable +< pakfire tree testing +< pakfire tree unstable < please reboot to apply your changes < pptp netconfig < pptp peer @@ -3429,6 +3464,11 @@ < ovpn error md5 < ovpn tls auth < ovpn warning rfc3280 +< pakfire invalid tree +< pakfire tree +< pakfire tree stable +< pakfire tree testing +< pakfire tree unstable < please reboot to apply your changes < processor vulnerability mitigations < ptr diff --git a/html/cgi-bin/pakfire.cgi b/html/cgi-bin/pakfire.cgi index f785b2594..dacbe11f4 100644 --- a/html/cgi-bin/pakfire.cgi +++ b/html/cgi-bin/pakfire.cgi @@ -143,7 +143,19 @@ END system("$command"); system("/bin/sleep 1"); } elsif ($cgiparams{'ACTION'} eq "$Lang::tr{'save'}") { - &General::writehash("${General::swroot}/pakfire/settings", \%pakfiresetting= s); + $pakfiresettings{"TREE"} =3D $cgiparams{"TREE"}; + + # Check for valid input + if ($pakfiresettings{"TREE"} !~ m/^(stable|testing|unstable)$/) { + $errormessage .=3D $Lang::tr{'pakfire invalid tree'}; + } + + unless ($errormessage) { + &General::writehash("${General::swroot}/pakfire/settings", \%pakfiresettin= gs); + + # Update lists + system("/usr/local/bin/pakfire update --force --no-colors &>/dev/null &"); + } } =20 &General::readhash("${General::swroot}/pakfire/settings", \%pakfiresettings); @@ -151,6 +163,12 @@ END my %selected=3D(); my %checked=3D(); =20 +$selected{"TREE"} =3D (); +$selected{"TREE"}{"stable"} =3D ""; +$selected{"TREE"}{"testing"} =3D ""; +$selected{"TREE"}{"unstable"} =3D ""; +$selected{"TREE"}{$pakfiresettings{"TREE"}} =3D "selected"; + # DPC move error message to top so it is seen! if ($errormessage) { &Header::openbox('100%', 'left', $Lang::tr{'error messages'}); @@ -263,6 +281,34 @@ print < END =20 +&Header::closebox(); +&Header::openbox("100%", "center", "$Lang::tr{'settings'}"); + +print < + + + + + + + + + + + +
$Lang::tr{'pakfire tree'} + +
 
+ +
+ +END + &Header::closebox(); &Header::closebigbox(); &Header::closepage(); diff --git a/langs/en/cgi-bin/en.pl b/langs/en/cgi-bin/en.pl index 1f81108f1..a68c8f411 100644 --- a/langs/en/cgi-bin/en.pl +++ b/langs/en/cgi-bin/en.pl @@ -1982,6 +1982,7 @@ 'pakfire install description' =3D> 'Please choose one or more items from the= list below and
click the plus to install.', 'pakfire install package' =3D> 'You want to install the following packages: = ', 'pakfire installed addons' =3D> 'Installed Addons:', +'pakfire invalid tree' =3D> 'Invalid repository selected', 'pakfire last core list update' =3D> 'Last core list update made', 'pakfire last package update' =3D> 'Last packages list update made', 'pakfire last serverlist update' =3D> 'Last server list update made', @@ -1989,6 +1990,10 @@ 'pakfire possible dependency' =3D> ' There may be depending packages, here i= s a list of packages that need to be installed.', 'pakfire register' =3D> 'Register at pakfire-server:', 'pakfire system state' =3D> 'System Status', +'pakfire tree' =3D> 'Repository', +'pakfire tree stable' =3D> 'Stable', +'pakfire tree testing' =3D> 'Testing', +'pakfire tree unstable' =3D> 'Unstable', 'pakfire uninstall description' =3D> 'Please choose one or more items from t= he list below and
click the minus to uninstall.', 'pakfire uninstall package' =3D> 'You want to uninstall the following packag= es: ', 'pakfire update daily' =3D> 'Search for updates daily:', --=20 2.20.1 --===============1875375840926353506==--