diff --git a/droopy b/droopy
index 5945cda..2806f83 100755
--- a/droopy
+++ b/droopy
@@ -77,6 +77,7 @@ else:
import cgi
import os
+import os.path
import posixpath
import macpath
import ntpath
@@ -212,6 +213,8 @@ class HTTPUploadHandler(httpserver.BaseHTTPRequestHandler):
auth = ''
certfile = None
divpicture = '
'
+ staticfolder = os.environ.get("DROOPY_STATIC",
+ os.path.join(os.path.dirname(os.path.realpath(__file__)), "static"))
def get_case_insensitive_header(self, hdrname, default):
"Python 2 and 3 differ in header capitalisation!"
@@ -300,6 +303,9 @@ class HTTPUploadHandler(httpserver.BaseHTTPRequestHandler):
if self.picture != None and self.path == '/__droopy/picture':
# send the picture
self.send_file(self.picture)
+ # serve static files
+ elif self.path.startswith('/static'):
+ self.send_file(os.path.join(self.staticfolder, self.path.lstrip('/static/')))
# TODO Verify that this is path-injection proof
elif name in self.published_files():
localpath = os.path.join(self.directory, name)
@@ -486,7 +492,7 @@ a {color: #4499cc; text-decoration: none;}
letter-spacing: -2px; line-height: 50px; color: #aaa;}
#sending {display: none; font-style: italic;}
#sending .text {padding-top: 10px; color: #bbb; font-size: 0.8em;}
-#wrapform {height: 90px; padding-top:40px;}
+#wrapform {padding-top:40px;}
#progress {display: inline; border-collapse: separate; empty-cells: show;
border-spacing: 24px 0; padding: 0; vertical-align: bottom;}
#progress td {height: 17px; width: 17px; background-color: #eee;
@@ -519,6 +525,7 @@ maintmpl = '''
%(maintitle)s
''' + style + '''
+
+
+
%(linkurl)s