Browse Source

HTTPS option added since reverse proxy can be done over HTTP.

master
noirscape 1 year ago
parent
commit
cc47e63cc7
4 changed files with 13 additions and 2 deletions
  1. +2
    -0
      .gitignore
  2. +2
    -0
      config.py.example
  3. +6
    -2
      main.py
  4. +3
    -0
      templates/index.html

+ 2
- 0
.gitignore View File

@@ -3,3 +3,5 @@ elimage.db
*.bak
.*.swp
__pycache__/
config.py
venv

config.py → config.py.example View File

@@ -7,3 +7,5 @@ XHEADERS = True # you may set this to false if not behind another server
CLOUDFLARE = False

UPLOAD_PASSWORD = ''

HTTPS = False

+ 6
- 2
main.py View File

@@ -130,8 +130,12 @@ class IndexHandler(tornado.web.RequestHandler):
ext = guess_extension(ftype)
if ext:
f += ext
ret[file['filename']] = '%s/%s/%s' % (
self.request.full_url().rstrip('/'), d, f)
if HTTPS:
ret[file['filename']] = '%s/%s/%s' % (
("https" + "://" + self.request.host +self.request.uri).rstrip('/'), d, f)
else:
ret[file['filename']] = '%s/%s/%s' % (
("http" + "://" + self.request.host +self.request.uri).rstrip('/'), d, f)

if len(ret) > 1:
for item in ret.items():


+ 3
- 0
templates/index.html View File

@@ -29,6 +29,9 @@ URLS

<a href="https://github.com/Vim-cn/elimage">https://github.com/Vim-cn/elimage</a>

<a href="https://git.catgirlsin.space/noirscape/elimage">https://git.catgirlsin.space/noirscape/elimage</a>
Source of this fork.

TOOLS
<a href="elimage">elimage</a>: script to quickly paste your images



Loading…
Cancel
Save