use download/bounce instead of download.cgi
authorChristian Hofstaedtler <ch@grml.org>
Wed, 21 Dec 2011 00:07:43 +0000 (01:07 +0100)
committerChristian Hofstaedtler <ch@grml.org>
Wed, 21 Dec 2011 00:07:43 +0000 (01:07 +0100)
cgi-bin/download.cgi [deleted file]
cgi-bin/index.html [deleted file]
download/index.php
download/prerelease/index.php

diff --git a/cgi-bin/download.cgi b/cgi-bin/download.cgi
deleted file mode 100755 (executable)
index 57d1b20..0000000
+++ /dev/null
@@ -1,69 +0,0 @@
-#!/usr/bin/python
-
-current_version = "2010.04"
-mirror_url = "http://download.grml.org/"
-
-#### END OF CONFIGURATION ####
-
-import cgi, re
-
-safe_regex = re.compile('^[a-zA-Z0-9_]+$')
-
-def validate_input(value):
-       x = safe_regex.match(value)
-       if not x:
-               raise Exception("unsafe input found" + str(x))
-       return value
-
-def get_download_url(flavour, arch, filetype):
-       folder = ''
-       product = 'grml'
-       if arch == "amd64": product = 'grml64'
-       if flavour == 'full':
-               pass
-       else:
-               product += '-' + flavour
-
-       filetypes = {
-               'iso': '',
-               'bt': '.torrent',
-               'md5': '.md5',
-               'sha1': '.sha1',
-               'signature': '.sha1.asc'
-       }
-       fileext = filetypes[filetype]
-       if "rc" in current_version: 
-               folder = "devel/"
-
-       iso = product + '_' + current_version + '.iso' + fileext
-       return mirror_url + folder +  iso
-
-def run():
-       import cgitb
-       cgitb.enable()
-
-       try:
-               form = cgi.FieldStorage()
-               try:
-                       global current_version
-                       current_version = form['version'].value
-               except Exception:
-                       pass
-               flavour = validate_input(form['flavour'].value)
-               arch = validate_input(form['arch'].value)
-               filetype = "iso"
-               if "filetype" in form: filetype = validate_input(form['filetype'].value)
-
-               print "Status: 302"
-               print "Location: " + get_download_url(flavour, arch, filetype)
-               print
-       except Exception, e:
-               print "Content-Type: text/html"     # HTML is following
-               print                               # blank line, end of headers
-               print "<H1>Error</H1>"
-               print "Please select flavour and architecture."
-               print e
-
-if __name__ == "__main__":
-       run()
-
diff --git a/cgi-bin/index.html b/cgi-bin/index.html
deleted file mode 100644 (file)
index 257cc56..0000000
+++ /dev/null
@@ -1 +0,0 @@
-foo
index aa76259..3b273dd 100644 (file)
     </div>
 
     <div class="download_group" id="download_group1" style="display:none;">
-    <form method="post" action="/cgi-bin/download.cgi">
+    <form method="post" action="/download/bounce/">
     <input type="hidden" name="version" value="2011.05"/>
     <div class="download_panel" id="download_panel1"><div>
 
index fc342ea..0e11c7a 100644 (file)
@@ -90,7 +90,7 @@
     <p>Download the Grml flavour you need, then write it to a CD-R or an empty USB stick.</p>
 
     <div class="download_group" id="download_group1">
-    <form method="post" action="/cgi-bin/download.cgi">
+    <form method="post" action="/download/bounce/">
     <input type="hidden" name="version" value="2011.12-rc1"/>
     <div class="download_panel" id="download_panel1"><div>