Fix use of docker volume
This commit is contained in:
parent
b9c7a14747
commit
a31ccd4ab9
|
@ -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;
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in New Issue