diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 39412a86..776fbf76 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -106,4 +106,4 @@ jobs: FLUX_TOKEN: ${{ secrets.FLUX_TOKEN }} FLUX_WEBHOOK_URL: ${{ secrets.FLUX_WEBHOOK_URL }} run: | - curl --disable --silent --show-error --location --max-time 30 --header "X-Signature: sha1=$(printf "{}" | openssl dgst -sha1 -r -hmac "${FLUX_TOKEN}"| awk '{print $1}')" --data "{}" "${FLUX_WEBHOOK_URL}" + curl --disable --silent --show-error --location --max-time 30 --header "X-Signature: sha256=$(printf "{}" | openssl dgst -sha256 -r -hmac "${FLUX_TOKEN}"| awk '{print $1}')" --data "{}" "${FLUX_WEBHOOK_URL}" diff --git a/Makefile b/Makefile index e6740152..0c1553bb 100644 --- a/Makefile +++ b/Makefile @@ -26,7 +26,7 @@ help: Makefile name: @printf "$(APP_NAME)" -## version: Output last commit sha1 +## version: Output last commit sha .PHONY: version version: @printf "$(shell git rev-parse --short HEAD)" diff --git a/cmd/fibr/templates/upload-form.html b/cmd/fibr/templates/upload-form.html index ab0845aa..4cb10af3 100644 --- a/cmd/fibr/templates/upload-form.html +++ b/cmd/fibr/templates/upload-form.html @@ -42,11 +42,11 @@ } /** - * Compute the sha1 on input. + * Compute the sha on input. * @param {Object} data Data to hash - * @return {Promise} Promise that will resolve the sha1 string + * @return {Promise} Promise that will resolve the sha string */ - async function sha1(data) { + async function sha(data) { const buffer = await crypto.subtle.digest( 'SHA-256', new TextEncoder('utf-8').encode(data), @@ -60,7 +60,7 @@ * @return {Promise} Promise that will resolve the message id. */ async function fileMessageId(file) { - const hash = await sha1( + const hash = await sha( JSON.stringify({ name: file.name, size: file.size,