Fix use of docker volume
This commit is contained in:
parent
b9c7a14747
commit
a31ccd4ab9
|
@ -11,6 +11,7 @@ server {
|
||||||
|
|
||||||
location /api {
|
location /api {
|
||||||
proxy_pass http://127.0.0.1:3000;
|
proxy_pass http://127.0.0.1:3000;
|
||||||
|
client_max_body_size 16M;
|
||||||
}
|
}
|
||||||
|
|
||||||
#error_page 404 /404.html;
|
#error_page 404 /404.html;
|
||||||
|
|
|
@ -4,7 +4,7 @@ import os
|
||||||
import cgi
|
import cgi
|
||||||
import tempfile
|
import tempfile
|
||||||
import subprocess
|
import subprocess
|
||||||
|
from shutil import copyfile
|
||||||
|
|
||||||
class Mountable(object):
|
class Mountable(object):
|
||||||
"""
|
"""
|
||||||
|
@ -72,7 +72,7 @@ class ImgHostApiV1(Mountable):
|
||||||
sha = subprocess.check_output(["sha512sum", theFile.file.name])
|
sha = subprocess.check_output(["sha512sum", theFile.file.name])
|
||||||
sha = sha.decode("UTF-8").split(" ")[0]
|
sha = sha.decode("UTF-8").split(" ")[0]
|
||||||
imgpath = os.path.join("i", "{}.{}".format(sha[0:8], ext))
|
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.headers['Location'] = "/" + imgpath
|
||||||
cherrypy.response.status = 302
|
cherrypy.response.status = 302
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue