From 5ad13ddfeb3f1fb01a51f354b80000306cdaed11 Mon Sep 17 00:00:00 2001 From: ElevenNotes Date: Fri, 21 Feb 2025 06:51:21 +0100 Subject: [PATCH] [feature] sql_get_all default sort by lastRequestTime DESC --- .dockerignore | 9 +++-- .gitattributes | 3 +- .github/workflows/docker.yml | 69 +++++++++++++++++++--------------- .gitignore | 4 +- .inputs | 4 -- rootfs/opt/py-kms/pykms_Sql.py | 2 +- 6 files changed, 48 insertions(+), 43 deletions(-) delete mode 100644 .inputs diff --git a/.dockerignore b/.dockerignore index a957046..ead0e71 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1,6 +1,7 @@ +# default .git* -*.md -LICENSE -img/ maintain/ -project* \ No newline at end of file +LICENSE +*.md +img/ +node_modules/ \ No newline at end of file diff --git a/.gitattributes b/.gitattributes index dfe0770..07764a7 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,2 +1 @@ -# Auto detect text files and perform LF normalization -* text=auto +* text eol=lf \ No newline at end of file diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 0b72b9a..de38192 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -53,6 +53,7 @@ jobs: - name: init / checkout uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 with: + ref: ${{ github.ref_name }} fetch-depth: 0 - name: init / inputs to env @@ -62,6 +63,7 @@ jobs: ${{ toJSON(github.event.inputs) }} EOF for KEY in $(cat .inputs | jq --raw-output 'keys[]' | tr '\n' ' '); do echo "input_$(echo ${KEY} | tr '[:upper:]' '[:lower:]')=$(cat .inputs | jq --raw-output '.'${KEY}'')" >> $GITHUB_ENV; done + rm -rf .inputs - name: init / .json to env uses: rgarcia-phi/json-to-variables@9835d537368468c4e4de5254dc3efeadda183793 @@ -231,6 +233,41 @@ jobs: draft: false prerelease: false + - name: github / checkout master + continue-on-error: true + run: | + git checkout master + + - name: github / create README.md + continue-on-error: true + if: env.WORKFLOW_GITHUB_README == 'true' + id: github-readme + uses: 11notes/action-docker-readme@v1 + with: + sarif_file: ${{ steps.grype-scan.outputs.sarif }} + + - name: github / commit & push + continue-on-error: true + if: steps.github-readme.outcome == 'success' + run: | + git config user.name "github-actions[bot]" + git config user.email "41898282+github-actions[bot]@users.noreply.github.com" + git add README.md + git commit -m "auto update README.md" + git push + + - name: docker / push README.md to docker hub + if: hashFiles('README.md') != '' + uses: christian-korneck/update-container-description-action@d36005551adeaba9698d8d67a296bd16fa91f8e8 + env: + DOCKER_USER: 11notes + DOCKER_PASS: ${{ secrets.DOCKER_TOKEN }} + with: + destination_container_repo: ${{ env.IMAGE }} + provider: dockerhub + short_description: ${{ env.json_readme_description }} + readme_file: 'README.md' + - name: github / update description and set repo defaults run: | curl --request PATCH \ @@ -245,34 +282,4 @@ jobs: "has_projects":false, "has_wiki":false }' \ - --fail - - - name: github / create README.md - continue-on-error: true - if: env.WORKFLOW_GITHUB_README == 'true' - id: github-readme - uses: 11notes/action-docker-readme@v1 - with: - sarif_file: ${{ steps.grype-scan.outputs.sarif }} - - - name: github / commit & push - continue-on-error: true - if: steps.github-readme.outcome == 'success' - run: | - git config user.name "github-actions[bot]" - git config user.email "41898282+github-actions[bot]@users.noreply.github.com" - git add . - git commit -m "auto update README.md" - git push - - - name: docker / push README.md to docker hub - if: hashFiles('README.md') != '' - uses: christian-korneck/update-container-description-action@d36005551adeaba9698d8d67a296bd16fa91f8e8 - env: - DOCKER_USER: 11notes - DOCKER_PASS: ${{ secrets.DOCKER_TOKEN }} - with: - destination_container_repo: ${{ env.IMAGE }} - provider: dockerhub - short_description: ${{ env.json_readme_description }} - readme_file: 'README.md' \ No newline at end of file + --fail \ No newline at end of file diff --git a/.gitignore b/.gitignore index 3cdab39..b411486 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,3 @@ -maintain/ \ No newline at end of file +# default +maintain/ +node_modules/ \ No newline at end of file diff --git a/.inputs b/.inputs deleted file mode 100644 index 4b7cc38..0000000 --- a/.inputs +++ /dev/null @@ -1,4 +0,0 @@ -{ - "readme": "true", - "release": "true" -} diff --git a/rootfs/opt/py-kms/pykms_Sql.py b/rootfs/opt/py-kms/pykms_Sql.py index cc986b5..580bca6 100644 --- a/rootfs/opt/py-kms/pykms_Sql.py +++ b/rootfs/opt/py-kms/pykms_Sql.py @@ -55,7 +55,7 @@ def sql_get_all(dbName): return None with sqlite3.connect(dbName) as con: cur = con.cursor() - cur.execute("SELECT * FROM clients") + cur.execute("SELECT * FROM clients ORDER BY lastRequestTime DESC") clients = [] for row in cur.fetchall(): clients.append({