Verified Commit 29c25838 authored by Mattia Rizzolo's avatar Mattia Rizzolo
Browse files

reproducible: apache: use the correct variable to match possible existing files on disk



REQUEST_FILENAME may or may not be a full pathname, depending on when
it's expanded.

From the docs:
    REQUEST_FILENAME
    The full local filesystem path to the file or script matching the
    request, if this has already been determined by the server at the
    time REQUEST_FILENAME is referenced. Otherwise, such as when used in
    virtual host context, the same value as REQUEST_URI

Since we are using virtual hosts (like, uh, everybody since apache 2.2?!)
REQUEST_FILENAME is not much of use.

Signed-off-by: Mattia Rizzolo's avatarMattia Rizzolo <mattia@debian.org>
parent e8c9ac58
...@@ -5,8 +5,8 @@ RewriteCond %{REQUEST_URI} ^/$ ...@@ -5,8 +5,8 @@ RewriteCond %{REQUEST_URI} ^/$
RewriteRule ^/(.*) https://reproducible-builds.org/citests/ [R,L] RewriteRule ^/(.*) https://reproducible-builds.org/citests/ [R,L]
# drop the (old|ugly) /userContent/ directory from the url # drop the (old|ugly) /userContent/ directory from the url
RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} !-f
RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} !-d
RewriteCond %{REQUEST_URI} ^/userContent RewriteCond %{REQUEST_URI} ^/userContent
RewriteRule ^/userContent/(.*)$ /$1 [R=301,L] RewriteRule ^/userContent/(.*)$ /$1 [R=301,L]
...@@ -16,20 +16,20 @@ RewriteCond %{REQUEST_URI} ^/(static|stretch|testing|unstable|experimental|histo ...@@ -16,20 +16,20 @@ RewriteCond %{REQUEST_URI} ^/(static|stretch|testing|unstable|experimental|histo
RewriteRule ^/(.*) /debian/$1 [R=302,L] RewriteRule ^/(.*) /debian/$1 [R=302,L]
# redirect t.r-b.o/issues/$ISSUE → t.r-b.o/issues/unstable/$ISSUE # redirect t.r-b.o/issues/$ISSUE → t.r-b.o/issues/unstable/$ISSUE
RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} !-f
RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} !-d
RewriteCond /var/lib/jenkins/userContent/reproducible/debian/issues/unstable/$2 -f RewriteCond /var/lib/jenkins/userContent/reproducible/debian/issues/unstable/$2 -f
RewriteRule ^/(debian/|)issues/([a-z0-9.+-_]+) /debian/issues/unstable/$2 [R=302,L] RewriteRule ^/(debian/|)issues/([a-z0-9.+-_]+) /debian/issues/unstable/$2 [R=302,L]
# redirect t.r-b.o/$PKG → t.r-b.o/rb-pkg/unstable/amd64/$PKG.html # redirect t.r-b.o/$PKG → t.r-b.o/rb-pkg/unstable/amd64/$PKG.html
RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} !-f
RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} !-d
RewriteCond /var/lib/jenkins/userContent/reproducible/debian/rb-pkg/unstable/amd64/$2.html -f RewriteCond /var/lib/jenkins/userContent/reproducible/debian/rb-pkg/unstable/amd64/$2.html -f
RewriteRule ^/(debian/)([a-z0-9.+-]+) /debian/rb-pkg/unstable/amd64/$2.html [R=302,L] RewriteRule ^/(debian/)([a-z0-9.+-]+) /debian/rb-pkg/unstable/amd64/$2.html [R=302,L]
# redirect t.r-b.o/redirect/?SrcPkg=$PKG → t.r-b.o/rb-pkg/unstable/amd64/$PKG.html # redirect t.r-b.o/redirect/?SrcPkg=$PKG → t.r-b.o/rb-pkg/unstable/amd64/$PKG.html
RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} !-f
RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} !-d
RewriteCond %{QUERY_STRING} ^(\w+)=([a-z0-9.+-]+)$ RewriteCond %{QUERY_STRING} ^(\w+)=([a-z0-9.+-]+)$
RewriteCond /var/lib/jenkins/userContent/reproducible/debian/rb-pkg/unstable/amd64/%2.html -f RewriteCond /var/lib/jenkins/userContent/reproducible/debian/rb-pkg/unstable/amd64/%2.html -f
RewriteRule ^/redirect /debian/rb-pkg/unstable/amd64/%2.html? [R=302,L] RewriteRule ^/redirect /debian/rb-pkg/unstable/amd64/%2.html? [R=302,L]
...@@ -37,48 +37,48 @@ RewriteRule ^/redirect /debian/rb-pkg/unstable/amd64/%2.html? [R=302,L] ...@@ -37,48 +37,48 @@ RewriteRule ^/redirect /debian/rb-pkg/unstable/amd64/%2.html? [R=302,L]
# the following two rules are fallbacks for the previous two redirects and should only catch packages which are only in experimental # the following two rules are fallbacks for the previous two redirects and should only catch packages which are only in experimental
# redirect t.r-b.o/$PKG → t.r-b.o/rb-pkg/experimental/amd64/$PKG.html # redirect t.r-b.o/$PKG → t.r-b.o/rb-pkg/experimental/amd64/$PKG.html
RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} !-f
RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} !-d
RewriteCond /var/lib/jenkins/userContent/reproducible/debian/rb-pkg/experimental/amd64/$2.html -f RewriteCond /var/lib/jenkins/userContent/reproducible/debian/rb-pkg/experimental/amd64/$2.html -f
RewriteRule ^/(debian/|)([a-z0-9.+-]+) /debian/rb-pkg/experimental/amd64/$2.html [R=302,L] RewriteRule ^/(debian/|)([a-z0-9.+-]+) /debian/rb-pkg/experimental/amd64/$2.html [R=302,L]
# redirect t.r-b.o/redirect/?SrcPkg=$PKG → t.r-b.o/rb-pkg/experimental/amd64/$PKG.html # redirect t.r-b.o/redirect/?SrcPkg=$PKG → t.r-b.o/rb-pkg/experimental/amd64/$PKG.html
RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} !-f
RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} !-d
RewriteCond %{QUERY_STRING} ^(\w+)=([a-z0-9.+-]+)$ RewriteCond %{QUERY_STRING} ^(\w+)=([a-z0-9.+-]+)$
RewriteCond /var/lib/jenkins/userContent/reproducible/debian/rb-pkg/experimental/amd64/%2.html -f RewriteCond /var/lib/jenkins/userContent/reproducible/debian/rb-pkg/experimental/amd64/%2.html -f
RewriteRule ^/redirect /debian/rb-pkg/experimental/amd64/%2.html? [R=302,L] RewriteRule ^/redirect /debian/rb-pkg/experimental/amd64/%2.html? [R=302,L]
# redirect t.r-b.o/$suite/(amd64|arm64|armhf|i386)/$PKG → t.r-b.o/rb-pkg/$suite/$arch/$PKG.html # redirect t.r-b.o/$suite/(amd64|arm64|armhf|i386)/$PKG → t.r-b.o/rb-pkg/$suite/$arch/$PKG.html
RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} !-f
RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} !-d
RewriteCond /var/lib/jenkins/userContent/reproducible/debian/rb-pkg/$2/$3/$4.html -f RewriteCond /var/lib/jenkins/userContent/reproducible/debian/rb-pkg/$2/$3/$4.html -f
RewriteRule ^/(debian/|)(stretch|testing|unstable|experimental)/([a-z0-9]+)/([a-z0-9.+-]+) /debian/rb-pkg/$2/$3/$4.html [R=302,L] RewriteRule ^/(debian/|)(stretch|testing|unstable|experimental)/([a-z0-9]+)/([a-z0-9.+-]+) /debian/rb-pkg/$2/$3/$4.html [R=302,L]
# redirect t.r-b.o/rb-pkg/$PKG.html → t.r-b.o/rb-pkg/unstable/amd64/$PKG.html # redirect t.r-b.o/rb-pkg/$PKG.html → t.r-b.o/rb-pkg/unstable/amd64/$PKG.html
RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} !-f
RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} !-d
RewriteCond /var/lib/jenkins/userContent/reproducible/debian/rb-pkg/unstable/amd64/$2 -f RewriteCond /var/lib/jenkins/userContent/reproducible/debian/rb-pkg/unstable/amd64/$2 -f
RewriteRule ^/(debian/|)rb-pkg/([a-z0-9.+-]+) /debian/rb-pkg/unstable/amd64/$2 [R,L] RewriteRule ^/(debian/|)rb-pkg/([a-z0-9.+-]+) /debian/rb-pkg/unstable/amd64/$2 [R,L]
# the same for /dbd/ # the same for /dbd/
RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} !-f
RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} !-d
RewriteCond /var/lib/jenkins/userContent/reproducible/debian/dbd/unstable/amd64/$2 -f RewriteCond /var/lib/jenkins/userContent/reproducible/debian/dbd/unstable/amd64/$2 -f
RewriteRule ^/(debian/|)dbd/([a-z0-9.+-_]+) /debian/dbd/unstable/amd64/$2 [R,L] RewriteRule ^/(debian/|)dbd/([a-z0-9.+-_]+) /debian/dbd/unstable/amd64/$2 [R,L]
# the same for /rbuild/ # the same for /rbuild/
RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} !-f
RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} !-d
RewriteCond /var/lib/jenkins/userContent/reproducible/debian/rbuild/unstable/amd64/$2 -f RewriteCond /var/lib/jenkins/userContent/reproducible/debian/rbuild/unstable/amd64/$2 -f
RewriteRule ^/(debian/|)rbuild/([a-z0-9.+-_]+) /debian/rbuild/unstable/amd64/$2 [R,L] RewriteRule ^/(debian/|)rbuild/([a-z0-9.+-_]+) /debian/rbuild/unstable/amd64/$2 [R,L]
# the same for /buildinfo/ # the same for /buildinfo/
RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} !-f
RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} !-d
RewriteCond /var/lib/jenkins/userContent/reproducible/debian/buildinfo/unstable/amd64/$2 -f RewriteCond /var/lib/jenkins/userContent/reproducible/debian/buildinfo/unstable/amd64/$2 -f
RewriteRule ^/(debian/|)buildinfo/([a-z0-9.+-_]+) /debian/buildinfo/unstable/amd64/$2 [R,L] RewriteRule ^/(debian/|)buildinfo/([a-z0-9.+-_]+) /debian/buildinfo/unstable/amd64/$2 [R,L]
# redirect some t.r-b.o/index_*.html to the suite/arch relative one # redirect some t.r-b.o/index_*.html to the suite/arch relative one
RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} !-f
RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} !-d
RewriteCond %{REQUEST_URI} ^/(debian/|)index_reproducible.html$ [or] RewriteCond %{REQUEST_URI} ^/(debian/|)index_reproducible.html$ [or]
RewriteCond %{REQUEST_URI} ^/(debian/|)index_FTBR.html$ [or] RewriteCond %{REQUEST_URI} ^/(debian/|)index_FTBR.html$ [or]
RewriteCond %{REQUEST_URI} ^/(debian/|)index_FTBFS.html$ [or] RewriteCond %{REQUEST_URI} ^/(debian/|)index_FTBFS.html$ [or]
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment