From 52a3e858f3e16a6ec48ce15302dafeffe8089dbf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A9o=20Colombaro?= Date: Sat, 7 Dec 2024 19:21:00 +0000 Subject: [PATCH] Fix Cloudflare Wrangler usage --- .github/workflows/deploy.yml | 46 +++++++++++++++++++++++++----------- README.md | 1 + 2 files changed, 33 insertions(+), 14 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index ae5334e..9581472 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -13,6 +13,12 @@ jobs: - name: Checkout uses: actions/checkout@v4 + - name: Use Node.js LTS + uses: actions/setup-node@v4 + with: + node-version: lts/* + cache: npm + - name: Use Terraform uses: hashicorp/setup-terraform@v3 @@ -99,29 +105,41 @@ jobs: echo "sentry=false" >> $GITHUB_OUTPUT; fi - - name: Setup Sentry - uses: cloudflare/wrangler-action@v3.13.0 - if: ${{ steps.sentry-check.outputs.sentry == 'true' }} - with: - apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }} - accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} - command: --version - secrets: | - SENTRY_DSN - env: - SENTRY_DSN: ${{ secrets.SENTRY_DSN }} + # - name: Setup Sentry + # if: ${{ steps.sentry-check.outputs.sentry == 'true' }} + # uses: cloudflare/wrangler-action@v3.13.0 + # with: + # apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }} + # accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} + # command: --version + # secrets: | + # SENTRY_DSN + # env: + # SENTRY_DSN: ${{ secrets.SENTRY_DSN }} - name: Publish to Cloudflare Workers uses: cloudflare/wrangler-action@v3.13.0 with: apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }} accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} - secrets: | - CLOUDFLARE_API_TOKEN - CLOUDFLARE_ACCOUNT_ID + # secrets: | + # CLOUDFLARE_API_TOKEN + # CLOUDFLARE_ACCOUNT_ID + # env: + # CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }} + # CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} + + - name: Setup Cloudflare Workers + run: | + echo "$CLOUDFLARE_API_TOKEN" | npx wrangler secret put CLOUDFLARE_API_TOKEN + echo "$CLOUDFLARE_ACCOUNT_ID" | npx wrangler secret put CLOUDFLARE_ACCOUNT_ID + if [ "${{ secrets.SENTRY_DSN }}" != '' ]; then + echo "$SENTRY_DSN" | npx wrangler secret put SENTRY_DSN + fi env: CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }} CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} + SENTRY_DSN: ${{ secrets.SENTRY_DSN }} - name: Create a Sentry release uses: getsentry/action-release@v1 diff --git a/README.md b/README.md index 92d8388..4ccdd0d 100644 --- a/README.md +++ b/README.md @@ -63,6 +63,7 @@ All the used Cloudflare products offer a [free plan](https://www.cloudflare.com/ > [!WARNING] > Dispoflare has no user registration. +> You may need to setup Access Policy in [Cloudflare's Zero Trust](https://one.dash.cloudflare.com/) dashboard. Dispoflare uses [Zero Trust Access](https://www.cloudflare.com/products/zero-trust/access/) to handle user authentication. It assumes that your users will register with another identity provider (Zero Trust supports [many providers](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/) or your custom one that implements [Generic SAML 2.0](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/generic-saml/)).