switch encryption key as build arg to se if that fixes build issues

This commit is contained in:
msukkari 2025-01-30 13:12:45 -08:00
parent f92acc0404
commit 92530a7ee0
2 changed files with 9 additions and 1 deletions

View file

@ -67,6 +67,7 @@ jobs:
build-args: | build-args: |
SOURCEBOT_VERSION=${{ github.ref_name }} SOURCEBOT_VERSION=${{ github.ref_name }}
POSTHOG_PAPIK=${{ secrets.POSTHOG_PAPIK }} POSTHOG_PAPIK=${{ secrets.POSTHOG_PAPIK }}
SOURCEBOT_ENCRYPTION_KEY=${{ secrets.STAGING_SOURCEBOT_ENCRYPTION_KEY }}
- name: Export digest - name: Export digest
run: | run: |

View file

@ -38,13 +38,17 @@ COPY --from=shared-libs-builder /app/packages/crypto ./packages/crypto
RUN yarn config set registry https://registry.npmjs.org/ RUN yarn config set registry https://registry.npmjs.org/
RUN yarn config set network-timeout 1200000 RUN yarn config set network-timeout 1200000
RUN yarn workspace @sourcebot/web install --frozen-lockfile RUN yarn workspace @sourcebot/web install --frozen-lockfile
ENV SOURCEBOT_ENCRYPTION_KEY=""
ENV NEXT_TELEMETRY_DISABLED=1 ENV NEXT_TELEMETRY_DISABLED=1
# @see: https://phase.dev/blog/nextjs-public-runtime-variables/ # @see: https://phase.dev/blog/nextjs-public-runtime-variables/
ARG NEXT_PUBLIC_SOURCEBOT_TELEMETRY_DISABLED=BAKED_NEXT_PUBLIC_SOURCEBOT_TELEMETRY_DISABLED ARG NEXT_PUBLIC_SOURCEBOT_TELEMETRY_DISABLED=BAKED_NEXT_PUBLIC_SOURCEBOT_TELEMETRY_DISABLED
ARG NEXT_PUBLIC_SOURCEBOT_VERSION=BAKED_NEXT_PUBLIC_SOURCEBOT_VERSION ARG NEXT_PUBLIC_SOURCEBOT_VERSION=BAKED_NEXT_PUBLIC_SOURCEBOT_VERSION
ENV NEXT_PUBLIC_POSTHOG_PAPIK=BAKED_NEXT_PUBLIC_POSTHOG_PAPIK ENV NEXT_PUBLIC_POSTHOG_PAPIK=BAKED_NEXT_PUBLIC_POSTHOG_PAPIK
# We declare SOURCEBOT_ENCRYPTION_KEY here since it's read during the build stage, since it's read in a server side component
ARG SOURCEBOT_ENCRYPTION_KEY
ENV SOURCEBOT_ENCRYPTION_KEY=$SOURCEBOT_ENCRYPTION_KEY
# @nocheckin: This was interfering with the the `matcher` regex in middleware.ts, # @nocheckin: This was interfering with the the `matcher` regex in middleware.ts,
# causing regular expressions parsing errors when making a request. It's unclear # causing regular expressions parsing errors when making a request. It's unclear
# why exactly this was happening, but it's likely due to a bad replacement happening # why exactly this was happening, but it's likely due to a bad replacement happening
@ -85,6 +89,9 @@ ARG SOURCEBOT_VERSION=unknown
ENV SOURCEBOT_VERSION=$SOURCEBOT_VERSION ENV SOURCEBOT_VERSION=$SOURCEBOT_VERSION
RUN echo "Sourcebot Version: $SOURCEBOT_VERSION" RUN echo "Sourcebot Version: $SOURCEBOT_VERSION"
# Redeclare SOURCEBOT_ENCRYPTION_KEY so that we have it in the runner
ARG SOURCEBOT_ENCRYPTION_KEY
ENV SOURCEBOT_TENANT_MODE=single ENV SOURCEBOT_TENANT_MODE=single
# Valid values are: debug, info, warn, error # Valid values are: debug, info, warn, error