mirror of
https://github.com/lnbits/lnbits.git
synced 2025-04-09 04:18:11 +02:00
let poetry run lnbits recognize forwarded_ips for https (#1109)
This commit is contained in:
parent
22bb67a249
commit
0096ce8ad1
@ -1,9 +1,7 @@
|
||||
import time
|
||||
|
||||
import click
|
||||
import uvicorn
|
||||
|
||||
from lnbits.settings import HOST, PORT
|
||||
from lnbits.settings import FORWARDED_ALLOW_IPS, HOST, PORT
|
||||
|
||||
|
||||
@click.command(
|
||||
@ -14,10 +12,20 @@ from lnbits.settings import HOST, PORT
|
||||
)
|
||||
@click.option("--port", default=PORT, help="Port to listen on")
|
||||
@click.option("--host", default=HOST, help="Host to run LNBits on")
|
||||
@click.option(
|
||||
"--forwarded-allow-ips", default=FORWARDED_ALLOW_IPS, help="Allowed proxy servers"
|
||||
)
|
||||
@click.option("--ssl-keyfile", default=None, help="Path to SSL keyfile")
|
||||
@click.option("--ssl-certfile", default=None, help="Path to SSL certificate")
|
||||
@click.pass_context
|
||||
def main(ctx, port: int, host: str, ssl_keyfile: str, ssl_certfile: str):
|
||||
def main(
|
||||
ctx,
|
||||
port: int,
|
||||
host: str,
|
||||
forwarded_allow_ips: str,
|
||||
ssl_keyfile: str,
|
||||
ssl_certfile: str,
|
||||
):
|
||||
"""Launched with `poetry run lnbits` at root level"""
|
||||
# this beautiful beast parses all command line arguments and passes them to the uvicorn server
|
||||
d = dict()
|
||||
@ -37,6 +45,7 @@ def main(ctx, port: int, host: str, ssl_keyfile: str, ssl_certfile: str):
|
||||
"lnbits.__main__:app",
|
||||
port=port,
|
||||
host=host,
|
||||
forwarded_allow_ips=forwarded_allow_ips,
|
||||
ssl_keyfile=ssl_keyfile,
|
||||
ssl_certfile=ssl_certfile,
|
||||
**d
|
||||
|
@ -18,6 +18,8 @@ DEBUG = env.bool("DEBUG", default=False)
|
||||
HOST = env.str("HOST", default="127.0.0.1")
|
||||
PORT = env.int("PORT", default=5000)
|
||||
|
||||
FORWARDED_ALLOW_IPS = env.str("FORWARDED_ALLOW_IPS", default="127.0.0.1")
|
||||
|
||||
LNBITS_PATH = path.dirname(path.realpath(__file__))
|
||||
LNBITS_DATA_FOLDER = env.str(
|
||||
"LNBITS_DATA_FOLDER", default=path.join(LNBITS_PATH, "data")
|
||||
|
Loading…
x
Reference in New Issue
Block a user