introduce baseurl and remove force_https (#1549)

* introduce baseurl and remove force_https

* calle's suggestions
This commit is contained in:
dni ⚡ 2023-02-28 13:45:43 +01:00 committed by GitHub
parent f943ca7d51
commit 6f194fe2f8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 5 additions and 20 deletions

View File

@ -48,7 +48,6 @@ LNBITS_EXTENSIONS_DEFAULT_INSTALL="tpos"
LNBITS_DATA_FOLDER="./data"
# LNBITS_DATABASE_URL="postgres://user:password@host:port/databasename"
LNBITS_FORCE_HTTPS=false
LNBITS_SERVICE_FEE="0.0"
# value in millisats
LNBITS_RESERVE_FEE_MIN=2000

View File

@ -174,8 +174,8 @@ kill_timeout = 30
[env]
HOST="127.0.0.1"
PORT=5000
LNBITS_FORCE_HTTPS=true
FORWARDED_ALLOW_IPS="*"
LNBITS_BASEURL="https://mylnbits.lnbits.org/"
LNBITS_DATA_FOLDER="/data"
${PUT_YOUR_LNBITS_ENV_VARS_HERE}

View File

@ -283,6 +283,7 @@ def register_startup(app: FastAPI):
def log_server_info():
logger.info("Starting LNbits")
logger.info(f"Baseurl: {settings.lnbits_baseurl}")
logger.info(f"Host: {settings.host}")
logger.info(f"Port: {settings.port}")
logger.info(f"Debug: {settings.debug}")

View File

@ -437,7 +437,7 @@ async def check_admin_settings():
for key, value in settings.dict(exclude_none=True).items():
logger.debug(f"{key}: {value}")
admin_url = f"{'https' if settings.lnbits_force_https else 'http'}://{settings.host}:{settings.port}/wallet?usr={settings.super_user}"
admin_url = f"{settings.lnbits_baseurl}wallet?usr={settings.super_user}"
logger.success(f"✔️ Access super user account at: {admin_url}")
# callback for saas

View File

@ -33,22 +33,7 @@
<br />
</div>
<div class="col-12 col-md-6">
<p>Miscelaneous</p>
<q-item tag="label" v-ripple>
<q-item-section>
<q-item-label>Force HTTPS</q-item-label>
<q-item-label caption>Prefer secure URLs</q-item-label>
</q-item-section>
<q-item-section avatar>
<q-toggle
size="md"
v-model="formData.lnbits_force_https"
checked-icon="check"
color="green"
unchecked-icon="clear"
/>
</q-item-section>
</q-item>
<p>Miscellaneous</p>
<q-item tag="label" v-ripple>
<q-item-section>
<q-item-label>Hide API</q-item-label>

View File

@ -88,7 +88,7 @@ class ThemesSettings(LNbitsSettings):
class OpsSettings(LNbitsSettings):
lnbits_force_https: bool = Field(default=False)
lnbits_baseurl: str = Field(default="http://127.0.0.1/")
lnbits_reserve_fee_min: int = Field(default=2000)
lnbits_reserve_fee_percent: float = Field(default=1.0)
lnbits_service_fee: float = Field(default=0)