diff --git a/lnbits/__main__.py b/lnbits/__main__.py index 93e2181c6..aa6528991 100644 --- a/lnbits/__main__.py +++ b/lnbits/__main__.py @@ -5,7 +5,7 @@ from starlette.requests import Request from loguru import logger -from .commands import bundle_vendored, migrate_databases, transpile_scss +from .commands import migrate_databases from .settings import ( DEBUG, LNBITS_COMMIT, @@ -21,8 +21,6 @@ from .settings import ( uvloop.install() asyncio.create_task(migrate_databases()) -transpile_scss() -bundle_vendored() from .app import create_app diff --git a/lnbits/app.py b/lnbits/app.py index 9ab7c75d9..84df250fe 100644 --- a/lnbits/app.py +++ b/lnbits/app.py @@ -47,9 +47,9 @@ def create_app(config_object="lnbits.settings") -> FastAPI: configure_logger() app = FastAPI() - app.mount("/static", StaticFiles(directory="lnbits/static"), name="static") + app.mount("/static", StaticFiles(packages=[("lnbits", "static")]), name="static") app.mount( - "/core/static", StaticFiles(directory="lnbits/core/static"), name="core_static" + "/core/static", StaticFiles(packages=[("lnbits.core", "static")]), name="core_static" ) origins = ["*"] diff --git a/lnbits/extensions/bleskomat/__init__.py b/lnbits/extensions/bleskomat/__init__.py index cc89760e5..06b4a441e 100644 --- a/lnbits/extensions/bleskomat/__init__.py +++ b/lnbits/extensions/bleskomat/__init__.py @@ -9,7 +9,7 @@ db = Database("ext_bleskomat") bleskomat_static_files = [ { "path": "/bleskomat/static", - "app": StaticFiles(directory="lnbits/extensions/bleskomat/static"), + "app": StaticFiles(packages=[("lnbits", "extensions/bleskomat/static")]), "name": "bleskomat_static", } ] @@ -18,7 +18,7 @@ bleskomat_ext: APIRouter = APIRouter(prefix="/bleskomat", tags=["Bleskomat"]) def bleskomat_renderer(): - return template_renderer(["lnbits/extensions/bleskomat/templates"]) + return template_renderer([StaticFiles(packages=[("lnbits", "extensions/bleskomat/static/templates")])]) from .lnurl_api import * # noqa diff --git a/lnbits/extensions/copilot/__init__.py b/lnbits/extensions/copilot/__init__.py index 8a6342678..8634505f0 100644 --- a/lnbits/extensions/copilot/__init__.py +++ b/lnbits/extensions/copilot/__init__.py @@ -12,7 +12,7 @@ db = Database("ext_copilot") copilot_static_files = [ { "path": "/copilot/static", - "app": StaticFiles(directory="lnbits/extensions/copilot/static"), + "app": StaticFiles(packages=[("lnbits", "extensions/copilot/static")]), "name": "copilot_static", } ] @@ -20,7 +20,7 @@ copilot_ext: APIRouter = APIRouter(prefix="/copilot", tags=["copilot"]) def copilot_renderer(): - return template_renderer(["lnbits/extensions/copilot/templates"]) + return template_renderer([StaticFiles(packages=[("lnbits", "extensions/copilot/static/templates")])]) from .lnurl import * # noqa diff --git a/lnbits/extensions/discordbot/__init__.py b/lnbits/extensions/discordbot/__init__.py index ff60dd628..eb755bd1b 100644 --- a/lnbits/extensions/discordbot/__init__.py +++ b/lnbits/extensions/discordbot/__init__.py @@ -9,7 +9,7 @@ db = Database("ext_discordbot") discordbot_static_files = [ { "path": "/discordbot/static", - "app": StaticFiles(directory="lnbits/extensions/discordbot/static"), + "app": StaticFiles(packages=[("lnbits", "extensions/discordbot/static")]), "name": "discordbot_static", } ] @@ -18,7 +18,7 @@ discordbot_ext: APIRouter = APIRouter(prefix="/discordbot", tags=["discordbot"]) def discordbot_renderer(): - return template_renderer(["lnbits/extensions/discordbot/templates"]) + return template_renderer([StaticFiles(packages=[("lnbits", "extensions/discordbot/static/templates")])]) from .views import * # noqa diff --git a/lnbits/extensions/jukebox/__init__.py b/lnbits/extensions/jukebox/__init__.py index 702a6c67b..ee92ec6ae 100644 --- a/lnbits/extensions/jukebox/__init__.py +++ b/lnbits/extensions/jukebox/__init__.py @@ -12,7 +12,7 @@ db = Database("ext_jukebox") jukebox_static_files = [ { "path": "/jukebox/static", - "app": StaticFiles(directory="lnbits/extensions/jukebox/static"), + "app": StaticFiles(packages=[("lnbits", "extensions/jukebox/static")]), "name": "jukebox_static", } ] @@ -21,7 +21,7 @@ jukebox_ext: APIRouter = APIRouter(prefix="/jukebox", tags=["jukebox"]) def jukebox_renderer(): - return template_renderer(["lnbits/extensions/jukebox/templates"]) + return template_renderer([StaticFiles(packages=[("lnbits", "extensions/jukebox/static/templates")])]) from .tasks import wait_for_paid_invoices diff --git a/lnbits/extensions/livestream/__init__.py b/lnbits/extensions/livestream/__init__.py index 17fc2d3b8..fbfcf22af 100644 --- a/lnbits/extensions/livestream/__init__.py +++ b/lnbits/extensions/livestream/__init__.py @@ -12,7 +12,7 @@ db = Database("ext_livestream") livestream_static_files = [ { "path": "/livestream/static", - "app": StaticFiles(directory="lnbits/extensions/livestream/static"), + "app": StaticFiles(packages=[("lnbits", "extensions/livestream/static")]), "name": "livestream_static", } ] @@ -21,7 +21,7 @@ livestream_ext: APIRouter = APIRouter(prefix="/livestream", tags=["livestream"]) def livestream_renderer(): - return template_renderer(["lnbits/extensions/livestream/templates"]) + return template_renderer([StaticFiles(packages=[("lnbits", "extensions/livestream/static/templates")])]) from .lnurl import * # noqa diff --git a/lnbits/extensions/lnurlp/__init__.py b/lnbits/extensions/lnurlp/__init__.py index 409817481..02dbf2ceb 100644 --- a/lnbits/extensions/lnurlp/__init__.py +++ b/lnbits/extensions/lnurlp/__init__.py @@ -12,7 +12,7 @@ db = Database("ext_lnurlp") lnurlp_static_files = [ { "path": "/lnurlp/static", - "app": StaticFiles(directory="lnbits/extensions/lnurlp/static"), + "app": StaticFiles(packages=[("lnbits", "extensions/lnurlp/static")]), "name": "lnurlp_static", } ] @@ -21,7 +21,7 @@ lnurlp_ext: APIRouter = APIRouter(prefix="/lnurlp", tags=["lnurlp"]) def lnurlp_renderer(): - return template_renderer(["lnbits/extensions/lnurlp/templates"]) + return template_renderer([StaticFiles(packages=[("lnbits", "extensions/lnurlp/static/templates")])]) from .lnurl import * # noqa diff --git a/lnbits/extensions/offlineshop/__init__.py b/lnbits/extensions/offlineshop/__init__.py index a601c1b85..bacbf339f 100644 --- a/lnbits/extensions/offlineshop/__init__.py +++ b/lnbits/extensions/offlineshop/__init__.py @@ -9,7 +9,7 @@ db = Database("ext_offlineshop") offlineshop_static_files = [ { "path": "/offlineshop/static", - "app": StaticFiles(directory="lnbits/extensions/offlineshop/static"), + "app": StaticFiles(packages=[("lnbits", "extensions/offlineshop/static")]), "name": "offlineshop_static", } ] @@ -18,7 +18,7 @@ offlineshop_ext: APIRouter = APIRouter(prefix="/offlineshop", tags=["Offlineshop def offlineshop_renderer(): - return template_renderer(["lnbits/extensions/offlineshop/templates"]) + return template_renderer([StaticFiles(packages=[("lnbits", "extensions/offlineshop/static/templates")])]) from .lnurl import * # noqa diff --git a/lnbits/extensions/splitpayments/__init__.py b/lnbits/extensions/splitpayments/__init__.py index df6feb943..3edac442d 100644 --- a/lnbits/extensions/splitpayments/__init__.py +++ b/lnbits/extensions/splitpayments/__init__.py @@ -12,7 +12,7 @@ db = Database("ext_splitpayments") splitpayments_static_files = [ { "path": "/splitpayments/static", - "app": StaticFiles(directory="lnbits/extensions/splitpayments/static"), + "app": StaticFiles(packages=[("lnbits", "extensions/splitpayments/static")]), "name": "splitpayments_static", } ] @@ -22,7 +22,7 @@ splitpayments_ext: APIRouter = APIRouter( def splitpayments_renderer(): - return template_renderer(["lnbits/extensions/splitpayments/templates"]) + return template_renderer([StaticFiles(packages=[("lnbits", "extensions/splitpayments/static/templates")])]) from .tasks import wait_for_paid_invoices diff --git a/lnbits/extensions/withdraw/__init__.py b/lnbits/extensions/withdraw/__init__.py index 58ccfe7e8..187ee7c00 100644 --- a/lnbits/extensions/withdraw/__init__.py +++ b/lnbits/extensions/withdraw/__init__.py @@ -9,7 +9,7 @@ db = Database("ext_withdraw") withdraw_static_files = [ { "path": "/withdraw/static", - "app": StaticFiles(directory="lnbits/extensions/withdraw/static"), + "app": StaticFiles(packages=[("lnbits", "extensions/withdraw/static")]), "name": "withdraw_static", } ] @@ -19,7 +19,7 @@ withdraw_ext: APIRouter = APIRouter(prefix="/withdraw", tags=["withdraw"]) def withdraw_renderer(): - return template_renderer(["lnbits/extensions/withdraw/templates"]) + return template_renderer([StaticFiles(packages=[("lnbits", "extensions/withdraw/static/templates")])]) from .lnurl import * # noqa