From d683fe818ecf36acdbdffc7a059c94a573b6c8e6 Mon Sep 17 00:00:00 2001 From: Marco Cawthorne Date: Mon, 10 Feb 2025 22:20:10 -0800 Subject: [PATCH] fix filesize field transfer, remove fteqw dep --- .forgejo/workflows/construct.yaml | 13 +++++-------- Makefile | 9 ++++----- decl-to-pkg.sh | 2 +- start.sh | 2 +- 4 files changed, 11 insertions(+), 15 deletions(-) diff --git a/.forgejo/workflows/construct.yaml b/.forgejo/workflows/construct.yaml index f9c3e27..32f6035 100644 --- a/.forgejo/workflows/construct.yaml +++ b/.forgejo/workflows/construct.yaml @@ -13,20 +13,17 @@ jobs: - name: dependencies run: | - apt update - apt install -y \ - imagemagick wget + apt-get update + apt-get install -y openssl - name: setup env run: | - echo $PRIVATE_KEY > private-key.pem - echo $PUBLIC_KEY > public-key.pem + echo $PRIVATE_KEY64 | base64 --decode > private-key.pem env: - PRIVATE_KEY: ${{ secrets.PRIVATE_KEY }} - PUBLIC_KEY: ${{ secrets.PUBLIC_KEY }} + PRIVATE_KEY64: ${{ secrets.PRIVATE_KEY64 }} - name: construct pkglists - run: make && rm private-key.pem public-key.pem + run: make env: AUTH_HOST: ${{ secrets.AUTH_HOST }} diff --git a/Makefile b/Makefile index 0d5b694..ddb45bc 100644 --- a/Makefile +++ b/Makefile @@ -1,17 +1,16 @@ - ENGINE_URL=https://code.idtech.space/fte/fteqw ENGINE_CLBUILD=m-dbg all: list -list: fteqw64 +list: ./start.sh +index: fteqw64 + ./index.sh + fteqw64: if [ ! -d ThirdParty/fteqw ];then mkdir -p ThirdParty; git clone --depth 1 $(ENGINE_URL) ThirdParty/fteqw;else cd ./ThirdParty/fteqw && git pull;fi cd ThirdParty/fteqw/engine && $(MAKE) makelibs ARCH=x86_64 cd ThirdParty/fteqw/engine && $(MAKE) $(ENGINE_CLBUILD) ARCH=x86_64 install -m 0777 ./ThirdParty/fteqw/engine/debug/fteqw ./fteqw64 - -index: - ./index.sh diff --git a/decl-to-pkg.sh b/decl-to-pkg.sh index a4d1485..7de7d97 100755 --- a/decl-to-pkg.sh +++ b/decl-to-pkg.sh @@ -171,7 +171,7 @@ fi if [ -f "index/$PKGNAME/size" ] then - SIZE="$(head -n 1 index/$PKGNAME/size)" + FILESIZE="$(head -n 1 index/$PKGNAME/size)" else echo "skipping due to missing index/$PKGNAME/size" exit 1 diff --git a/start.sh b/start.sh index 0710462..25695a0 100755 --- a/start.sh +++ b/start.sh @@ -25,7 +25,7 @@ do OUTPUT="$(basename "$PKGLIST")" echo "version 2" > tmplist0 cat "$PKGLIST" >> tmplist0 - SIG=$(./fteqw64 -privkey ./private-key.pem -pubkey ./public-key.pem -certhost $AUTH_HOST -sign2 tmplist0) + SIG=$(openssl dgst -sha512 -sign ./private-key.pem tmplist0 | openssl enc -A -base64) head -n 1 tmplist0 > "$OUTPUT" echo "signature \"$AUTH_HOST\" \"$SIG\"" >> "$OUTPUT" tail -n +2 tmplist0 >> "$OUTPUT"