Fix use of docker volume

This commit is contained in:
dave 2017-02-07 23:25:57 -08:00
parent b9c7a14747
commit a31ccd4ab9
2 changed files with 3 additions and 2 deletions

View File

@ -11,6 +11,7 @@ server {
location /api {
proxy_pass http://127.0.0.1:3000;
client_max_body_size 16M;
}
#error_page 404 /404.html;

View File

@ -4,7 +4,7 @@ import os
import cgi
import tempfile
import subprocess
from shutil import copyfile
class Mountable(object):
"""
@ -72,7 +72,7 @@ class ImgHostApiV1(Mountable):
sha = subprocess.check_output(["sha512sum", theFile.file.name])
sha = sha.decode("UTF-8").split(" ")[0]
imgpath = os.path.join("i", "{}.{}".format(sha[0:8], ext))
os.link(theFile.file.name, os.path.join("ui", imgpath))
copyfile(theFile.file.name, os.path.join("ui", imgpath))
cherrypy.response.headers['Location'] = "/" + imgpath
cherrypy.response.status = 302