Skip to content

fix(deploy): add runtime admin authentication fallback - #1637

Draft
tonicofonico wants to merge 2 commits into
AppFlowy-IO:mainfrom
tonicofonico:fix/i18n-and-docker-config
Draft

fix(deploy): add runtime admin authentication fallback#1637
tonicofonico wants to merge 2 commits into
AppFlowy-IO:mainfrom
tonicofonico:fix/i18n-and-docker-config

Conversation

@tonicofonico

@tonicofonico tonicofonico commented Aug 1, 2026

Copy link
Copy Markdown

Description

Add a Docker-runtime option for using browser-side authentication instead of the Admin frontend's authentication Server Actions:

APPFLOWY_ADMIN_DISABLE_SERVER_ACTIONS=false

The option is documented in deploy.env and passed to admin_frontend by Docker Compose. It remains disabled by default.

Problem

Behind some TLS-terminating reverse proxies, Server Action requests can lose the expected cookie or origin context and cause an authentication redirect loop.

The original version of this PR used NEXT_PUBLIC_DISABLE_SERVER_ACTIONS. That name is a build-time Next.js setting, so setting it when starting the prebuilt Admin image does not update the browser bundle.

Runtime behavior

This PR is paired with AppFlowy-Admin #67, which injects APPFLOWY_ADMIN_DISABLE_SERVER_ACTIONS into window.__APP_CONFIG__:

  • unset or false: continue using authentication Server Actions
  • true: use the existing browser-side authentication API fallback

This setting only changes Admin authentication behavior; it does not globally disable Next.js Server Actions.

Dependency

AppFlowy-Admin #67 must be merged and a compatible appflowyinc/admin_frontend image must be published before this PR is ready to merge.

Verification

  • docker compose --env-file deploy.env config --quiet
  • verified Compose renders the default as false and an explicit override as true
  • built the Admin image from feat: returns if user is new for both oauth and password login #67 and started it through this Compose service definition
  • verified the container receives APPFLOWY_ADMIN_DISABLE_SERVER_ACTIONS=true
  • verified /console/login exposes the runtime value to browser code

@sourcery-ai

sourcery-ai Bot commented Aug 1, 2026

Copy link
Copy Markdown
Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

This PR adds a configurable NEXT_PUBLIC_DISABLE_SERVER_ACTIONS environment variable to the admin_frontend Docker Compose deployment and documents it in the deploy.env template to support disabling Next.js Server Actions in certain reverse-proxy setups.

File-Level Changes

Change Details Files
Make NEXT_PUBLIC_DISABLE_SERVER_ACTIONS configurable for the admin_frontend service in Docker Compose.
  • Add NEXT_PUBLIC_DISABLE_SERVER_ACTIONS to the admin_frontend service environment block.
  • Default the variable to false when not explicitly set via NEXT_PUBLIC_DISABLE_SERVER_ACTIONS:-false expansion.
docker-compose.yml
Document the NEXT_PUBLIC_DISABLE_SERVER_ACTIONS environment variable in the deployment env template.
  • Add a new NEXT_PUBLIC_DISABLE_SERVER_ACTIONS entry to deploy.env.
  • Provide inline documentation or comments explaining its purpose and typical usage.
deploy.env

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@CLAassistant

CLAassistant commented Aug 1, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey - I've reviewed your changes and they look great!


Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@appflowy appflowy changed the title fix(deploy): add NEXT_PUBLIC_DISABLE_SERVER_ACTIONS option to admin_frontend docker-compose fix(deploy): add runtime admin authentication fallback Aug 4, 2026
@appflowy
appflowy marked this pull request as draft August 4, 2026 09:14

appflowy commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

Maintainer follow-up: I pushed 581c77d5 to replace the ineffective runtime NEXT_PUBLIC_DISABLE_SERVER_ACTIONS setting with APPFLOWY_ADMIN_DISABLE_SERVER_ACTIONS. The original NEXT_PUBLIC_* value is frozen when the Admin image is built and was not visible to browser code when set by Compose.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants