Merge branch 'more_unit_tests' of https://github.com/lnbits/lnbits into more_unit_tests
This commit is contained in:
@@ -0,0 +1,29 @@
|
|||||||
|
name: bundle
|
||||||
|
on:
|
||||||
|
workflow_call:
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
bundle:
|
||||||
|
permissions:
|
||||||
|
contents: write
|
||||||
|
runs-on: ubuntu-24.04
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
ref: ${{ github.head_ref }}
|
||||||
|
- uses: lnbits/lnbits/.github/actions/prepare@dev
|
||||||
|
with:
|
||||||
|
python-version: "3.10"
|
||||||
|
node-version: "24.x"
|
||||||
|
npm: true
|
||||||
|
- run: make bundle
|
||||||
|
- name: Commit and push bundle changes
|
||||||
|
run: |
|
||||||
|
git config user.name "alan"
|
||||||
|
git config user.email "alan@lnbits.com"
|
||||||
|
git add lnbits/static
|
||||||
|
if git diff --cached --quiet; then
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
git commit -m "chore: make bundle [skip ci]"
|
||||||
|
git push
|
||||||
@@ -8,7 +8,6 @@ on:
|
|||||||
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
|
|
||||||
lint:
|
lint:
|
||||||
uses: ./.github/workflows/lint.yml
|
uses: ./.github/workflows/lint.yml
|
||||||
|
|
||||||
@@ -98,3 +97,7 @@ jobs:
|
|||||||
uses: ./.github/workflows/jmeter.yml
|
uses: ./.github/workflows/jmeter.yml
|
||||||
with:
|
with:
|
||||||
python-version: ${{ matrix.python-version }}
|
python-version: ${{ matrix.python-version }}
|
||||||
|
|
||||||
|
bundle:
|
||||||
|
needs: [ lint, test-api, test-wallets, test-unit, migration, openapi, regtest, jmeter ]
|
||||||
|
uses: ./.github/workflows/bundle.yml
|
||||||
|
|||||||
@@ -25,18 +25,11 @@ jobs:
|
|||||||
make: pyright
|
make: pyright
|
||||||
npm: true
|
npm: true
|
||||||
|
|
||||||
|
|
||||||
prettier:
|
prettier:
|
||||||
uses: ./.github/workflows/make.yml
|
uses: ./.github/workflows/make.yml
|
||||||
with:
|
with:
|
||||||
make: checkprettier
|
make: checkprettier
|
||||||
npm: true
|
npm: true
|
||||||
|
|
||||||
bundle:
|
|
||||||
uses: ./.github/workflows/make.yml
|
|
||||||
with:
|
|
||||||
make: checkbundle
|
|
||||||
npm: true
|
|
||||||
|
|
||||||
poetry:
|
poetry:
|
||||||
uses: ./.github/workflows/poetry.yml
|
uses: ./.github/workflows/poetry.yml
|
||||||
|
|||||||
@@ -1,3 +0,0 @@
|
|||||||
{% extends "base.html" %} {% from "macros.jinja" import window_vars with context
|
|
||||||
%} {% block scripts %} {{ window_vars(user) }} {% endblock %} {% block page %}{%
|
|
||||||
endblock %}
|
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
{% extends "public.html" %} {% from "macros.jinja" import window_vars with
|
|
||||||
context %} {% block scripts %} {{ window_vars() }} {% endblock %} {% block page
|
|
||||||
%} {% endblock %}
|
|
||||||
@@ -200,7 +200,7 @@ async def index(
|
|||||||
) -> HTMLResponse:
|
) -> HTMLResponse:
|
||||||
return template_renderer().TemplateResponse(
|
return template_renderer().TemplateResponse(
|
||||||
request,
|
request,
|
||||||
"index.html",
|
"base.html",
|
||||||
{
|
{
|
||||||
"user": user.json(),
|
"user": user.json(),
|
||||||
},
|
},
|
||||||
@@ -211,7 +211,7 @@ async def index(
|
|||||||
@generic_router.get("/node/public")
|
@generic_router.get("/node/public")
|
||||||
@generic_router.get("/first_install", dependencies=[Depends(check_first_install)])
|
@generic_router.get("/first_install", dependencies=[Depends(check_first_install)])
|
||||||
async def index_public(request: Request) -> HTMLResponse:
|
async def index_public(request: Request) -> HTMLResponse:
|
||||||
return template_renderer().TemplateResponse(request, "index.html", {"public": True})
|
return template_renderer().TemplateResponse(request, "base.html", {"public": True})
|
||||||
|
|
||||||
|
|
||||||
@generic_router.get("/uuidv4/{hex_value}")
|
@generic_router.get("/uuidv4/{hex_value}")
|
||||||
|
|||||||
@@ -55,7 +55,6 @@ def static_url_for(static: str, path: str) -> str:
|
|||||||
def template_renderer(additional_folders: list | None = None) -> Jinja2Templates:
|
def template_renderer(additional_folders: list | None = None) -> Jinja2Templates:
|
||||||
folders = [
|
folders = [
|
||||||
"lnbits/templates",
|
"lnbits/templates",
|
||||||
"lnbits/core/templates",
|
|
||||||
settings.extension_builder_working_dir_path.as_posix(),
|
settings.extension_builder_working_dir_path.as_posix(),
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|||||||
+1
-1
File diff suppressed because one or more lines are too long
@@ -10,6 +10,10 @@ window.PageAccount = {
|
|||||||
name: 'bitcoin',
|
name: 'bitcoin',
|
||||||
color: 'deep-orange'
|
color: 'deep-orange'
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
name: 'classic',
|
||||||
|
color: 'purple'
|
||||||
|
},
|
||||||
{
|
{
|
||||||
name: 'mint',
|
name: 'mint',
|
||||||
color: 'green'
|
color: 'green'
|
||||||
|
|||||||
@@ -82,9 +82,8 @@
|
|||||||
<!-- scripts libraries -->
|
<!-- scripts libraries -->
|
||||||
{% for url in INCLUDED_JS %}
|
{% for url in INCLUDED_JS %}
|
||||||
<script src="{{ static_url_for('static', url) }}"></script>
|
<script src="{{ static_url_for('static', url) }}"></script>
|
||||||
{% endfor %}
|
{% endfor %} {% if user %}
|
||||||
<!-- user init -->
|
<!-- user init -->
|
||||||
{% if user %}
|
|
||||||
<script>
|
<script>
|
||||||
window.g.user = LNbits.map.user(JSON.parse({{ user | tojson | safe }}));
|
window.g.user = LNbits.map.user(JSON.parse({{ user | tojson | safe }}));
|
||||||
{% if not public %}
|
{% if not public %}
|
||||||
@@ -92,6 +91,12 @@
|
|||||||
{% endif %}
|
{% endif %}
|
||||||
</script>
|
</script>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
<!-- app init -->
|
||||||
|
<script>
|
||||||
|
window.app = Vue.createApp({
|
||||||
|
el: '#vue'
|
||||||
|
})
|
||||||
|
</script>
|
||||||
<!-- scripts from extensions -->
|
<!-- scripts from extensions -->
|
||||||
{% block scripts %}{% endblock %}
|
{% block scripts %}{% endblock %}
|
||||||
<!-- components js -->
|
<!-- components js -->
|
||||||
|
|||||||
@@ -1,6 +1,4 @@
|
|||||||
{% extends "public.html" %} {% from "macros.jinja" import window_vars with
|
{% extends "base.html" %} {% block page_container %}
|
||||||
context %} {% block scripts %} {{ window_vars() }} {% endblock %} {% block
|
|
||||||
page_container %}
|
|
||||||
<lnbits-error
|
<lnbits-error
|
||||||
code="{{ status_code | safe }}"
|
code="{{ status_code | safe }}"
|
||||||
message="{{ message | safe }}"
|
message="{{ message | safe }}"
|
||||||
|
|||||||
@@ -1,9 +1,5 @@
|
|||||||
{% macro window_vars(user) -%}
|
{% macro window_vars(user) -%}
|
||||||
<script>
|
<script>
|
||||||
//Needed for Vue to create the app on first load (although called on every page, its only loaded once)
|
// deprecated dont use window_vars anymore
|
||||||
window.app = Vue.createApp({
|
|
||||||
el: '#vue',
|
|
||||||
mixins: [window.windowMixin]
|
|
||||||
})
|
|
||||||
</script>
|
</script>
|
||||||
{%- endmacro %}
|
{%- endmacro %}
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
[project]
|
[project]
|
||||||
name = "lnbits"
|
name = "lnbits"
|
||||||
version = "1.5.2-rc3"
|
version = "1.5.2"
|
||||||
requires-python = ">=3.10,<3.13"
|
requires-python = ">=3.10,<3.13"
|
||||||
description = "LNbits, free and open-source Lightning wallet and accounts system."
|
description = "LNbits, free and open-source Lightning wallet and accounts system."
|
||||||
authors = [{ name = "Alan Bits", email = "alan@lnbits.com" }]
|
authors = [{ name = "Alan Bits", email = "alan@lnbits.com" }]
|
||||||
|
|||||||
+2
-2
@@ -28,8 +28,7 @@ from lnbits.core.models.extensions_builder import (
|
|||||||
PublicPageFields,
|
PublicPageFields,
|
||||||
SettingsFields,
|
SettingsFields,
|
||||||
)
|
)
|
||||||
from lnbits.settings import settings
|
from lnbits.wallets import get_funding_source
|
||||||
from lnbits.wallets import get_funding_source, set_funding_source
|
|
||||||
|
|
||||||
|
|
||||||
class DbTestModel(BaseModel):
|
class DbTestModel(BaseModel):
|
||||||
@@ -182,6 +181,7 @@ def make_lnurl_pay_response(
|
|||||||
),
|
),
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
funding_source = get_funding_source()
|
funding_source = get_funding_source()
|
||||||
is_fake: bool = funding_source.__class__.__name__ == "FakeWallet"
|
is_fake: bool = funding_source.__class__.__name__ == "FakeWallet"
|
||||||
is_regtest: bool = not is_fake
|
is_regtest: bool = not is_fake
|
||||||
|
|||||||
Reference in New Issue
Block a user