From 775b1d9571ca8a999f9f3790c9bab9e4f941daae Mon Sep 17 00:00:00 2001 From: lda Date: Tue, 27 Aug 2024 09:47:25 -0400 Subject: [PATCH 01/16] Use hashtypes(c.f Cytoplasm#47) (#57) This makes Telodendria compatible with Telodendria/Cytoplasm#47. --- Please review the developer certificate of origin: 1. The contribution was created in whole or in part by me, and I have the right to submit it under the open source licenses of the Telodendria project; or 1. The contribution is based upon a previous work that, to the best of my knowledge, is covered under an appropriate open source license and I have the right under that license to submit that work with modifications, whether created in whole or in part by me, under the Telodendria project license; or 1. The contribution was provided directly to me by some other person who certified (1), (2), or (3), and I have not modified it. 1. I understand and agree that this project and the contribution are made public and that a record of the contribution—including all personal information I submit with it—is maintained indefinitely and may be redistributed consistent with this project or the open source licenses involved. - [x] I have read the Telodendria Project development certificate of origin, and I certify that I have permission to submit this patch under the conditions specified in it. Co-authored-by: Jordan Bancino Co-authored-by: LDA Reviewed-on: https://git.telodendria.io/Telodendria/Telodendria/pulls/57 Co-authored-by: lda Co-committed-by: lda --- src/User.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/User.c b/src/User.c index 3a38d34..2fdf751 100644 --- a/src/User.c +++ b/src/User.c @@ -384,7 +384,7 @@ UserCheckPassword(User * user, char *password) tmp = StrConcat(2, password, salt); hashBytes = Sha256(tmp); - hashedPwd = ShaToHex(hashBytes); + hashedPwd = ShaToHex(hashBytes, HASH_SHA256); Free(tmp); Free(hashBytes); @@ -415,7 +415,7 @@ UserSetPassword(User * user, char *password) salt = StrRandom(16); tmpstr = StrConcat(2, password, salt); hashBytes = Sha256(tmpstr); - hash = ShaToHex(hashBytes); + hash = ShaToHex(hashBytes, HASH_SHA256); JsonValueFree(HashMapSet(json, "salt", JsonValueString(salt))); JsonValueFree(HashMapSet(json, "password", JsonValueString(hash))); From 2fcd51e8106e6ef2d5aec7914ab7d049009d811c Mon Sep 17 00:00:00 2001 From: Jordan Bancino Date: Sat, 21 Sep 2024 15:20:05 -0400 Subject: [PATCH 02/16] Use Forgejo action runner. --- .../issue_template/bug_report.yaml | 0 .../issue_template/config.yaml | 0 .../issue_template/feature_request.yaml | 0 {.gitea => .forgejo}/pull_request_template.md | 0 .forgejo/workflows/compile.yaml | 22 ++++++++++++++ .gitea/workflows/compile.yaml | 29 ------------------- 6 files changed, 22 insertions(+), 29 deletions(-) rename {.gitea => .forgejo}/issue_template/bug_report.yaml (100%) rename {.gitea => .forgejo}/issue_template/config.yaml (100%) rename {.gitea => .forgejo}/issue_template/feature_request.yaml (100%) rename {.gitea => .forgejo}/pull_request_template.md (100%) create mode 100644 .forgejo/workflows/compile.yaml delete mode 100644 .gitea/workflows/compile.yaml diff --git a/.gitea/issue_template/bug_report.yaml b/.forgejo/issue_template/bug_report.yaml similarity index 100% rename from .gitea/issue_template/bug_report.yaml rename to .forgejo/issue_template/bug_report.yaml diff --git a/.gitea/issue_template/config.yaml b/.forgejo/issue_template/config.yaml similarity index 100% rename from .gitea/issue_template/config.yaml rename to .forgejo/issue_template/config.yaml diff --git a/.gitea/issue_template/feature_request.yaml b/.forgejo/issue_template/feature_request.yaml similarity index 100% rename from .gitea/issue_template/feature_request.yaml rename to .forgejo/issue_template/feature_request.yaml diff --git a/.gitea/pull_request_template.md b/.forgejo/pull_request_template.md similarity index 100% rename from .gitea/pull_request_template.md rename to .forgejo/pull_request_template.md diff --git a/.forgejo/workflows/compile.yaml b/.forgejo/workflows/compile.yaml new file mode 100644 index 0000000..f423547 --- /dev/null +++ b/.forgejo/workflows/compile.yaml @@ -0,0 +1,22 @@ +name: Compile Telodendria +run-name: Compile Telodendria on ${{ forgejo.actor }} +on: [push] + +jobs: + "Compile Telodendria": + strategy: + matrix: + os: [alpine] + arch: [aarch64] + runs-on: ["${{ matrix.os }}", "${{ matrix.arch }}"] + steps: + - name: Check out repository + uses: actions/checkout@v4 + with: + submodules: true + - name: Configure Telodendria + run: ./configure + - name: Configure & Build Cytoplasm + run: make cytoplasm + - name: Build Telodendria + run: make diff --git a/.gitea/workflows/compile.yaml b/.gitea/workflows/compile.yaml deleted file mode 100644 index 0c578a8..0000000 --- a/.gitea/workflows/compile.yaml +++ /dev/null @@ -1,29 +0,0 @@ -name: Compile Telodendria -run-name: Compile Telodendria on ${{ gitea.actor }} -on: [push] - -jobs: - "Compile Telodendria": - strategy: - matrix: - os: [debian-v12.4, alpine-v3.19, openbsd-v7.4, freebsd-v14.0, netbsd-v9.3] - arch: [x86, x86_64] - exclude: - # 32-bit OpenBSD does not behave well in QEMU. Even when using - # QEMU to emulate i386, it utilizes 100% of its CPU core and is - # still extremely sluggish. Thus, we don't have a working 32-bit - # OpenBSD runner, so exclude it from the matrix configuration. - - os: openbsd-v7.4 - arch: x86 - runs-on: ["${{ matrix.os }}", "${{ matrix.arch }}"] - steps: - - name: Check out repository - uses: actions/checkout@v3 - with: - submodules: true - - name: Configure Telodendria - run: ./configure - - name: Configure & Build Cytoplasm - run: make cytoplasm - - name: Build Telodendria - run: make From e083ece2ed8450df307110cb218aebc6eca7fe13 Mon Sep 17 00:00:00 2001 From: Jordan Bancino Date: Sat, 21 Sep 2024 15:21:11 -0400 Subject: [PATCH 03/16] Fast-forward Cytoplasm to latest master. --- Cytoplasm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cytoplasm b/Cytoplasm index 346b912..af4a142 160000 --- a/Cytoplasm +++ b/Cytoplasm @@ -1 +1 @@ -Subproject commit 346b912a0633cceac10780b8a103f6c89b5ba89f +Subproject commit af4a14226116719eb504f0213fa549bf1e967194 From 42223c94bb23dfce2fc002e536c2e00c4846a9dc Mon Sep 17 00:00:00 2001 From: Jordan Bancino Date: Sat, 21 Sep 2024 15:47:25 -0400 Subject: [PATCH 04/16] Basic work toward compiling on Darwin. --- Cytoplasm | 2 +- configure | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Cytoplasm b/Cytoplasm index af4a142..f7c51ee 160000 --- a/Cytoplasm +++ b/Cytoplasm @@ -1 +1 @@ -Subproject commit af4a14226116719eb504f0213fa549bf1e967194 +Subproject commit f7c51ee019c0cffdc200a4fd4f82ce7cd6e89d61 diff --git a/configure b/configure index 17bacfa..8233084 100755 --- a/configure +++ b/configure @@ -34,7 +34,7 @@ case "$(uname)" in # These systems typically use GCC. SCRIPT_ARGS="${SCRIPT_ARGS} --cc=gcc" ;; - OpenBSD|FreeBSD) + OpenBSD|FreeBSD|Darwin) # These systems typically use Clang. SCRIPT_ARGS="${SCRIPT_ARGS} --cc=clang" ;; From 21b830e51453fcc7792a1e3794b287e972034f7c Mon Sep 17 00:00:00 2001 From: Jordan Bancino Date: Sat, 21 Sep 2024 15:49:06 -0400 Subject: [PATCH 05/16] Cytoplasm submodule now clones over SSH. --- .gitmodules | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitmodules b/.gitmodules index d834568..d3b5e1f 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +1,3 @@ [submodule "Cytoplasm"] path = Cytoplasm - url = https://git.telodendria.io/Telodendria/Cytoplasm.git + url = git@telodendria.io/Telodendria/Cytoplasm.git From 46dcf8ab59514a3435d7c41c25204a653b5f43f4 Mon Sep 17 00:00:00 2001 From: Jordan Bancino Date: Sat, 21 Sep 2024 15:49:59 -0400 Subject: [PATCH 06/16] Fix submodule url. --- .gitmodules | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitmodules b/.gitmodules index d3b5e1f..7f62b2b 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +1,3 @@ [submodule "Cytoplasm"] path = Cytoplasm - url = git@telodendria.io/Telodendria/Cytoplasm.git + url = git@telodendria.io:Telodendria/Cytoplasm.git From 59e3a6d3e28d1e9ca96103ffa39e13067f975db2 Mon Sep 17 00:00:00 2001 From: Jordan Bancino Date: Sat, 21 Sep 2024 15:54:33 -0400 Subject: [PATCH 07/16] Okay nevermind, that breaks CI. --- .gitmodules | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitmodules b/.gitmodules index 7f62b2b..d834568 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +1,3 @@ [submodule "Cytoplasm"] path = Cytoplasm - url = git@telodendria.io:Telodendria/Cytoplasm.git + url = https://git.telodendria.io/Telodendria/Cytoplasm.git From 3304f8c08f9fea36172660b2ed6219db17b350e4 Mon Sep 17 00:00:00 2001 From: Jordan Bancino Date: Sat, 21 Sep 2024 16:23:19 -0400 Subject: [PATCH 08/16] Add release job. --- .forgejo/workflows/compile.yaml | 2 +- .forgejo/workflows/release.yaml | 39 +++++++++++++++++++++++++++++++++ Cytoplasm | 2 +- 3 files changed, 41 insertions(+), 2 deletions(-) create mode 100644 .forgejo/workflows/release.yaml diff --git a/.forgejo/workflows/compile.yaml b/.forgejo/workflows/compile.yaml index f423547..85ad6d9 100644 --- a/.forgejo/workflows/compile.yaml +++ b/.forgejo/workflows/compile.yaml @@ -1,6 +1,6 @@ name: Compile Telodendria run-name: Compile Telodendria on ${{ forgejo.actor }} -on: [push] +on: [push, pull_request] jobs: "Compile Telodendria": diff --git a/.forgejo/workflows/release.yaml b/.forgejo/workflows/release.yaml new file mode 100644 index 0000000..9bd4069 --- /dev/null +++ b/.forgejo/workflows/release.yaml @@ -0,0 +1,39 @@ +name: Release Telodendria +run-name: Release Telodendria on ${{ forgejo.actor }} +# on: +# tags: +# - 'v*' +# For testing only: +on: [push] + +jobs: + "Release Telodendria": + strategy: + matrix: + os: [alpine] + arch: [aarch64] + runs-on: ["${{ matrix.os }}", "${{ matrix.arch }}"] + steps: + - name: Determine release tag + id: tag + run: echo ::set-output name=TAG:${GITHUB_REF#refs/tags/} + - name: Check out repository + uses: actions/checkout@v4 + with: + submodules: true + - name: Archive submodules + run: git submodule foreach --recursive 'git archive --format tar --prefix=$displaypath/ -o submodule.tar HEAD' + - name: Archive repository + run: git archive --format -tar -o release.tar HEAD + - name: Produce release archive + run: | + TOPDIR=$(pwd) git submodule --quiet foreach --recursive 'cd $TOPDIR; tar --concatenate --file=release.tar $displaypath/submodule.tar; rm -fv $displaypath/submodule.tar' + gzip release.tar + mv release.tar.gz Telodendria-$RELEASE_TAG.tar.gz + env: + RELEASE_TAG: ${{steps.tag.outputs.TAG}} + - name: Upload artifact + uses: actions/upload-artifact@v3 + with: + name: Release + path: Telodendria-${{steps.tag.outputs.TAG}}.tar.gz diff --git a/Cytoplasm b/Cytoplasm index f7c51ee..63bd879 160000 --- a/Cytoplasm +++ b/Cytoplasm @@ -1 +1 @@ -Subproject commit f7c51ee019c0cffdc200a4fd4f82ce7cd6e89d61 +Subproject commit 63bd8791019cfaf7b782c4600464d8cd9240351c From 12e11f74a144ce2a4306290200c8ecc82c32f19a Mon Sep 17 00:00:00 2001 From: Jordan Bancino Date: Sat, 21 Sep 2024 16:26:57 -0400 Subject: [PATCH 09/16] Fix typo in Git command. --- .forgejo/workflows/release.yaml | 2 +- Cytoplasm | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.forgejo/workflows/release.yaml b/.forgejo/workflows/release.yaml index 9bd4069..9861348 100644 --- a/.forgejo/workflows/release.yaml +++ b/.forgejo/workflows/release.yaml @@ -24,7 +24,7 @@ jobs: - name: Archive submodules run: git submodule foreach --recursive 'git archive --format tar --prefix=$displaypath/ -o submodule.tar HEAD' - name: Archive repository - run: git archive --format -tar -o release.tar HEAD + run: git archive --format tar -o release.tar HEAD - name: Produce release archive run: | TOPDIR=$(pwd) git submodule --quiet foreach --recursive 'cd $TOPDIR; tar --concatenate --file=release.tar $displaypath/submodule.tar; rm -fv $displaypath/submodule.tar' diff --git a/Cytoplasm b/Cytoplasm index 63bd879..6827d4f 160000 --- a/Cytoplasm +++ b/Cytoplasm @@ -1 +1 @@ -Subproject commit 63bd8791019cfaf7b782c4600464d8cd9240351c +Subproject commit 6827d4fc39f5527b8836f6fe7dff35b1b97cb571 From 0e946b2422694697a512e750b00c9e46b7c7001c Mon Sep 17 00:00:00 2001 From: Jordan Bancino Date: Sat, 21 Sep 2024 16:32:15 -0400 Subject: [PATCH 10/16] Fix Release artifact --- .forgejo/workflows/release.yaml | 2 +- Cytoplasm | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.forgejo/workflows/release.yaml b/.forgejo/workflows/release.yaml index 9861348..1dc4ccf 100644 --- a/.forgejo/workflows/release.yaml +++ b/.forgejo/workflows/release.yaml @@ -35,5 +35,5 @@ jobs: - name: Upload artifact uses: actions/upload-artifact@v3 with: - name: Release + name: Telodendria-${{steps.tag.outputs.TAG}}.tar.gz path: Telodendria-${{steps.tag.outputs.TAG}}.tar.gz diff --git a/Cytoplasm b/Cytoplasm index 6827d4f..4f316ff 160000 --- a/Cytoplasm +++ b/Cytoplasm @@ -1 +1 @@ -Subproject commit 6827d4fc39f5527b8836f6fe7dff35b1b97cb571 +Subproject commit 4f316ff7b3a955b831ca4aefb8679ddf3396a7d0 From 8546ddb9098dc9950b4137fbe9981fd0db599c6f Mon Sep 17 00:00:00 2001 From: Jordan Bancino Date: Sat, 21 Sep 2024 16:35:18 -0400 Subject: [PATCH 11/16] Get the ref name properly. --- .forgejo/workflows/release.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.forgejo/workflows/release.yaml b/.forgejo/workflows/release.yaml index 1dc4ccf..678dfc2 100644 --- a/.forgejo/workflows/release.yaml +++ b/.forgejo/workflows/release.yaml @@ -16,7 +16,7 @@ jobs: steps: - name: Determine release tag id: tag - run: echo ::set-output name=TAG:${GITHUB_REF#refs/tags/} + run: echo ::set-output name=TAG:$(git rev-parse --abbrev-ref HEAD) - name: Check out repository uses: actions/checkout@v4 with: From c7433bb745fd3586694901c56ed454a8215decb4 Mon Sep 17 00:00:00 2001 From: Jordan Bancino Date: Sat, 21 Sep 2024 16:36:26 -0400 Subject: [PATCH 12/16] Order actions properly. --- .forgejo/workflows/release.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.forgejo/workflows/release.yaml b/.forgejo/workflows/release.yaml index 678dfc2..efb9b9b 100644 --- a/.forgejo/workflows/release.yaml +++ b/.forgejo/workflows/release.yaml @@ -14,13 +14,13 @@ jobs: arch: [aarch64] runs-on: ["${{ matrix.os }}", "${{ matrix.arch }}"] steps: - - name: Determine release tag - id: tag - run: echo ::set-output name=TAG:$(git rev-parse --abbrev-ref HEAD) - name: Check out repository uses: actions/checkout@v4 with: submodules: true + - name: Determine release tag + id: tag + run: echo ::set-output name=TAG:$(git rev-parse --abbrev-ref HEAD) - name: Archive submodules run: git submodule foreach --recursive 'git archive --format tar --prefix=$displaypath/ -o submodule.tar HEAD' - name: Archive repository From 505d01cea1ede3f506dfa5cae34aff0fa97fd60c Mon Sep 17 00:00:00 2001 From: Jordan Bancino Date: Sat, 21 Sep 2024 16:52:41 -0400 Subject: [PATCH 13/16] Hopefully finalize the release logic. --- .forgejo/workflows/release.yaml | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/.forgejo/workflows/release.yaml b/.forgejo/workflows/release.yaml index efb9b9b..aab796e 100644 --- a/.forgejo/workflows/release.yaml +++ b/.forgejo/workflows/release.yaml @@ -1,10 +1,7 @@ name: Release Telodendria run-name: Release Telodendria on ${{ forgejo.actor }} -# on: -# tags: -# - 'v*' -# For testing only: -on: [push] + +on: [tag] jobs: "Release Telodendria": @@ -18,9 +15,6 @@ jobs: uses: actions/checkout@v4 with: submodules: true - - name: Determine release tag - id: tag - run: echo ::set-output name=TAG:$(git rev-parse --abbrev-ref HEAD) - name: Archive submodules run: git submodule foreach --recursive 'git archive --format tar --prefix=$displaypath/ -o submodule.tar HEAD' - name: Archive repository @@ -29,11 +23,19 @@ jobs: run: | TOPDIR=$(pwd) git submodule --quiet foreach --recursive 'cd $TOPDIR; tar --concatenate --file=release.tar $displaypath/submodule.tar; rm -fv $displaypath/submodule.tar' gzip release.tar - mv release.tar.gz Telodendria-$RELEASE_TAG.tar.gz - env: - RELEASE_TAG: ${{steps.tag.outputs.TAG}} + mkdir release + mv release.tar.gz release/Telodendria-$GITHUB_REF_NAME.tar.gz - name: Upload artifact uses: actions/upload-artifact@v3 with: - name: Telodendria-${{steps.tag.outputs.TAG}}.tar.gz - path: Telodendria-${{steps.tag.outputs.TAG}}.tar.gz + name: Telodendria-$GITHUB_REF_NAME.tar.gz + path: release/Telodendria-$GITHUB_REF_NAME.tar.gz + - name: Publish release + uses: actions/forgejo-release@v3 + with: + tag: $GITHUB_REF_NAME + title: "Telodendria $GITHUB_REF_NAME" + release-dir: release/ + release-notes: "docs/CHANGELOG.md" + direction: upload + prerelease: true From 66c237727b8dfe558b9c82b90701700658a37e54 Mon Sep 17 00:00:00 2001 From: Jordan Bancino Date: Sat, 21 Sep 2024 16:55:55 -0400 Subject: [PATCH 14/16] Apparently on: [tags] doesn't work. --- .forgejo/workflows/release.yaml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.forgejo/workflows/release.yaml b/.forgejo/workflows/release.yaml index aab796e..4094b34 100644 --- a/.forgejo/workflows/release.yaml +++ b/.forgejo/workflows/release.yaml @@ -1,7 +1,10 @@ name: Release Telodendria run-name: Release Telodendria on ${{ forgejo.actor }} -on: [tag] +on: + push: + tags: + - 'v*' jobs: "Release Telodendria": From 5041e0c991c8b4a4f9ce9a46e85e356095a89b54 Mon Sep 17 00:00:00 2001 From: Jordan Bancino Date: Sat, 21 Sep 2024 16:59:42 -0400 Subject: [PATCH 15/16] Let's try again. --- .forgejo/workflows/compile.yaml | 7 ++++++- .forgejo/workflows/release.yaml | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/.forgejo/workflows/compile.yaml b/.forgejo/workflows/compile.yaml index 85ad6d9..003dd27 100644 --- a/.forgejo/workflows/compile.yaml +++ b/.forgejo/workflows/compile.yaml @@ -1,6 +1,11 @@ name: Compile Telodendria run-name: Compile Telodendria on ${{ forgejo.actor }} -on: [push, pull_request] +on: + push: + branches: + - 'ma*' + pull_request: + types: [opened, synchronize, reopened] jobs: "Compile Telodendria": diff --git a/.forgejo/workflows/release.yaml b/.forgejo/workflows/release.yaml index 4094b34..d2cf7c5 100644 --- a/.forgejo/workflows/release.yaml +++ b/.forgejo/workflows/release.yaml @@ -34,7 +34,7 @@ jobs: name: Telodendria-$GITHUB_REF_NAME.tar.gz path: release/Telodendria-$GITHUB_REF_NAME.tar.gz - name: Publish release - uses: actions/forgejo-release@v3 + uses: actions/forgejo-release@v1 with: tag: $GITHUB_REF_NAME title: "Telodendria $GITHUB_REF_NAME" From 71491ab6fcb936beca649c5e93939062a56eb18a Mon Sep 17 00:00:00 2001 From: Jordan Bancino Date: Sat, 21 Sep 2024 17:03:14 -0400 Subject: [PATCH 16/16] Update to release v2. --- .forgejo/workflows/release.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.forgejo/workflows/release.yaml b/.forgejo/workflows/release.yaml index d2cf7c5..cf81217 100644 --- a/.forgejo/workflows/release.yaml +++ b/.forgejo/workflows/release.yaml @@ -34,7 +34,7 @@ jobs: name: Telodendria-$GITHUB_REF_NAME.tar.gz path: release/Telodendria-$GITHUB_REF_NAME.tar.gz - name: Publish release - uses: actions/forgejo-release@v1 + uses: actions/forgejo-release@v2 with: tag: $GITHUB_REF_NAME title: "Telodendria $GITHUB_REF_NAME"