Browse Source

trusted_downstream doesn't work well. add an address option

pull/12/merge
lilydjwg 3 years ago
parent
commit
f967c8172d
2 changed files with 2 additions and 3 deletions
  1. +0
    -1
      config.py
  2. +2
    -2
      main.py

+ 0
- 1
config.py View File

@@ -4,5 +4,4 @@ DEFAULT_PORT = 8888
DB = 'elimage.db'

XHEADERS = True # you may set this to false if not behind another server
TRUSTED_DOWNSTREAM = ['127.0.0.1']
CLOUDFLARE = False

+ 2
- 2
main.py View File

@@ -195,6 +195,7 @@ def main():
AsyncIOMainLoop().install()

define("port", default=DEFAULT_PORT, help="run on the given port", type=int)
define("address", default='', help="run on the given address", type=str)
define("datadir", default=DEFAULT_DATA_DIR, help="the directory to put uploaded data", type=str)
define("fork", default=False, help="fork after startup", type=bool)
define("cloudflare", default=False, help="check for Cloudflare IPs", type=bool)
@@ -227,9 +228,8 @@ def main():
http_server = tornado.httpserver.HTTPServer(
application,
xheaders=XHEADERS,
trusted_downstream=TRUSTED_DOWNSTREAM,
)
http_server.listen(options.port)
http_server.listen(options.port, address=options.address)

asyncio.get_event_loop().run_forever()



Loading…
Cancel
Save