From 095c7933810e77556c88aa44743e8040a7bf2c83 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?dni=20=E2=9A=A1?= Date: Wed, 21 Jun 2023 09:42:14 +0200 Subject: [PATCH 01/77] fix openapi issue with exclusiveMaximum (#14) * fix openapi issue with exclusiveMaximum * dont change businesslogic --- models.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/models.py b/models.py index d3f8cd3..dd472a6 100644 --- a/models.py +++ b/models.py @@ -16,7 +16,7 @@ class CreatePayLinkData(BaseModel): min: float = Query(1, ge=0.01) max: float = Query(1, ge=0.01) currency: str = Query(None) - comment_chars: int = Query(0, ge=0, lt=800) + comment_chars: int = Query(0, ge=0, le=799) webhook_url: str = Query(None) webhook_headers: str = Query(None) webhook_body: str = Query(None) From 3730d51dce8d35d740f6bc53b31d84925b47816c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?dni=20=E2=9A=A1?= Date: Wed, 28 Jun 2023 15:02:09 +0200 Subject: [PATCH 02/77] add github release workflow --- .github/workflows/release.yml | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..3e1da5a --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,19 @@ +name: release github version +on: + push: + tags: + - "[0-9]+.[0-9]+.[0-9]+" +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Create GitHub Release + id: create_release + uses: actions/create-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + tag_name: ${{ github.ref }} + release_name: ${{ github.ref }} + draft: false + prerelease: false From a46058134f59775e613958822140c23ac2de1b0e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?dni=20=E2=9A=A1?= Date: Sat, 23 Sep 2023 22:47:13 +0200 Subject: [PATCH 03/77] [FEAT] add better release workflow (#21) --- .github/workflows/release.yml | 60 +++++++++++++++++++++++++++++------ 1 file changed, 50 insertions(+), 10 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 3e1da5a..7ec9b48 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,19 +1,59 @@ -name: release github version on: push: tags: - - "[0-9]+.[0-9]+.[0-9]+" + - "v[0-9]+.[0-9]+.[0-9]+" + jobs: - build: + + release: runs-on: ubuntu-latest steps: - - name: Create GitHub Release - id: create_release - uses: actions/create-release@v1 + - uses: actions/checkout@v3 + - name: Create github release env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + tag: ${{ github.ref_name }} + run: | + gh release create "$tag" --generate-notes + + pullrequest: + needs: [release] + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 with: - tag_name: ${{ github.ref }} - release_name: ${{ github.ref }} - draft: false - prerelease: false + token: ${{ secrets.EXT_GITHUB }} + repository: lnbits/lnbits-extensions + path: './lnbits-extensions' + + - name: setup git user + run: | + git config --global user.name "alan" + git config --global user.email "alan@lnbits.com" + + - name: Create pull request in extensions repo + env: + GH_TOKEN: ${{ secrets.EXT_GITHUB }} + repo_name: "${{ github.event.repository.name }}" + tag: "${{ github.ref_name }}" + branch: "update-${{ github.event.repository.name }}-${{ github.ref_name }}" + title: "[UPDATE] ${{ github.event.repository.name }} to ${{ github.ref_name }}" + body: "https://github.com/lnbits/${{ github.event.repository.name }}/releases/${{ github.ref_name }}" + archive: "https://github.com/lnbits/${{ github.event.repository.name }}/archive/refs/tags/${{ github.ref_name }}.zip" + run: | + cd lnbits-extensions + git checkout -b $branch + + # if there is another open PR + git pull origin $branch || echo "branch does not exist" + + sh util.sh update_extension $repo_name $tag + + git add -A + git commit -am "$title" + git push origin $branch + + # check if pr exists before creating it + gh config set pager cat + check=$(gh pr list -H $branch | wc -l) + test $check -ne 0 || gh pr create --title "$title" --body "$body" --repo lnbits/lnbits-extensions From ab6b53668ec5fbb82ae1b6a260db2a98e77a5823 Mon Sep 17 00:00:00 2001 From: Tiago Vasconcelos Date: Sun, 24 Sep 2023 19:18:36 +0100 Subject: [PATCH 04/77] Fix webhook (#12) * refactor html * don't exclude values on update --- static/js/index.js | 24 +-- templates/lnurlp/index.html | 377 ++++++++++-------------------------- 2 files changed, 102 insertions(+), 299 deletions(-) diff --git a/static/js/index.js b/static/js/index.js index e9951f1..4c09507 100644 --- a/static/js/index.js +++ b/static/js/index.js @@ -116,7 +116,6 @@ new Vue({ if (this.formDialog.fixedAmount) data.max = data.min if (data.currency === 'satoshis') data.currency = null if (isNaN(parseInt(data.comment_chars))) data.comment_chars = 0 - if (data.id) { this.updatePayLink(wallet, data) } else { @@ -131,33 +130,12 @@ new Vue({ } }, updatePayLink(wallet, data) { - let values = _.omit( - _.pick( - data, - 'description', - 'min', - 'max', - 'webhook_url', - 'success_text', - 'success_url', - 'comment_chars', - 'currency', - 'username', - 'zaps' - ), - (value, key) => - (key === 'webhook_url' || - key === 'success_text' || - key === 'success_url') && - (value === null || value === '') - ) - LNbits.api .request( 'PUT', '/lnurlp/api/v1/links/' + data.id, wallet.adminkey, - values + data ) .then(response => { this.payLinks = _.reject(this.payLinks, obj => obj.id === data.id) diff --git a/templates/lnurlp/index.html b/templates/lnurlp/index.html index 4b8202e..38f93c6 100644 --- a/templates/lnurlp/index.html +++ b/templates/lnurlp/index.html @@ -4,9 +4,7 @@
- New pay link + New pay link @@ -17,13 +15,7 @@
Pay links
- + {% raw %}