[Qa-jenkins-scm] [jenkins.debian.net] 01/01: reproducible: correctly use mod_rewrite to stop using javascript for the form
Holger Levsen
holger at moszumanska.debian.org
Fri Aug 21 15:39:32 UTC 2015
This is an automated email from the git hooks/post-receive script.
holger pushed a commit to branch master
in repository jenkins.debian.net.
commit c51d60fcbd478ae77260357eb3c57efd4e61e7cf
Author: Holger Levsen <holger at layer-acht.org>
Date: Fri Aug 21 17:39:19 2015 +0200
reproducible: correctly use mod_rewrite to stop using javascript for the form
---
bin/reproducible_common.sh | 2 +-
hosts/jenkins/etc/apache2/sites-available/jenkins.debian.net | 7 ++++---
2 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/bin/reproducible_common.sh b/bin/reproducible_common.sh
index 75f608f..6a34133 100755
--- a/bin/reproducible_common.sh
+++ b/bin/reproducible_common.sh
@@ -240,7 +240,7 @@ write_page_header() {
write_page "</ul>"
if [ "$1" = "$MAINVIEW" ] ; then
LATEST=$(sqlite3 -init $INIT ${PACKAGES_DB} "SELECT s.name FROM results AS r JOIN sources AS s ON r.package_id = s.id WHERE r.status IN ('unreproducible') AND s.suite = 'unstable' AND s.architecture = 'amd64' AND s.id NOT IN (SELECT package_id FROM notes) ORDER BY build_date DESC LIMIT 23"|sort -R|head -1)
- write_page "https://reproducible.debian.net/<form action=\"https://reproducible.debian.net\" method=\"GET\">"
+ write_page "<form action=\"https://reproducible.debian.net/redirect\" method=\"GET\">https://reproducible.debian.net/"
write_page "<input type=\"text\" name=\"SrcPkg\" placeholder=\"Type my friend..\" value=\"$LATEST\" />"
write_page "<input type=\"submit\" value=\"submit source package name\" />"
write_page "</form>"
diff --git a/hosts/jenkins/etc/apache2/sites-available/jenkins.debian.net b/hosts/jenkins/etc/apache2/sites-available/jenkins.debian.net
index 4345120..ea37777 100644
--- a/hosts/jenkins/etc/apache2/sites-available/jenkins.debian.net
+++ b/hosts/jenkins/etc/apache2/sites-available/jenkins.debian.net
@@ -186,12 +186,13 @@ Use common-debian-service-https-redirect reproducible.debian.net
RewriteCond /var/lib/jenkins/userContent/reproducible/rb-pkg/unstable/amd64/$1.html -f
RewriteRule ^/([a-z0-9.+-]+) /rb-pkg/unstable/amd64/$1.html [R=302,L]
- # redirect rb.d.n/reproducible.html?SrcPkg=$PKG → rb.d.n/rb-pkg/unstable/amd64/$PKG.html
+ # redirect rb.d.n/redirect/?SrcPkg=$PKG → rb.d.n/rb-pkg/unstable/amd64/$PKG.html
RewriteCond %{HTTP_HOST} reproducible\.debian\.net
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
- RewriteCond /var/lib/jenkins/userContent/reproducible/rb-pkg/unstable/amd64/$1.html -f
- RewriteRule ^/reproducible.html?SrcPkg=([a-z0-9.+-]+) /rb-pkg/unstable/amd64/$1.html [R=302,L]
+ RewriteCond %{QUERY_STRING} ^(\w+)=([a-z0-9.+-]+)$
+ RewriteCond /var/lib/jenkins/userContent/reproducible/rb-pkg/unstable/amd64/%2.html -f
+ RewriteRule ^/redirect /rb-pkg/unstable/amd64/%2.html? [R=302,L]
# redirect rb.d.n/$PKG → rb.d.n/rb-pkg/experimental/amd64/$PKG.html
# (this is the fallback for the previous redirect and should only catch packages which are only in experimental)
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/qa/jenkins.debian.net.git
More information about the Qa-jenkins-scm
mailing list