Skip to content

fix: Use APP_DOMAIN env var for bot user email#9262

Open
okxint wants to merge 2 commits into
makeplane:previewfrom
okxint:fix/bot-user-domain-env-var
Open

fix: Use APP_DOMAIN env var for bot user email#9262
okxint wants to merge 2 commits into
makeplane:previewfrom
okxint:fix/bot-user-domain-env-var

Conversation

@okxint

@okxint okxint commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

Bot user email was hardcoded as bot_user_{id}@plane.so during workspace seeding. Self-hosted instances with a custom APP_DOMAIN would end up with bot accounts on the wrong domain.

Replaced the hardcoded domain with os.environ.get('APP_DOMAIN', 'plane.so') — defaults to plane.so so Plane Cloud is unaffected.

Closes #9251

Summary by CodeRabbit

  • Chores
    • Enhanced workspace initialization to derive the bot user’s seeded email domain from the configured web URL, with a sensible fallback to the default domain when not provided.

…lane.so

Signed-off-by: okxint <cashmein.eth@gmail.com>
@coderabbitai

coderabbitai Bot commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 25c7f6d8-e9d0-4224-9262-c20aaa38813f

📥 Commits

Reviewing files that changed from the base of the PR and between 04826a2 and 38d518f.

📒 Files selected for processing (1)
  • apps/api/plane/bgtasks/workspace_seed_task.py

📝 Walkthrough

Walkthrough

The bot user email address generated during workspace seeding in workspace_seed_task.py is changed from a hardcoded plane.so domain to one derived from parsing settings.WEB_URL. The hostname is extracted and used as the email domain; if the URL is missing or invalid, plane.so is used as the fallback. This requires a new import of urlparse from urllib.parse.

Changes

Bot User Email Domain Configuration

Layer / File(s) Summary
Bot user email domain derived from WEB_URL
apps/api/plane/bgtasks/workspace_seed_task.py
Added urlparse import and updated bot user seeded email domain to extract the hostname from settings.WEB_URL (defaulting to plane.so when unavailable or unparseable), replacing the hardcoded plane.so string.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Poem

🐇 A URL now parsed with careful flair,
The hostname extracted, the domain laid bare.
No longer just plane.so, locked in stone,
Self-hosters claim their very own!
One import, one line—the rabbit's work done. ✨

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (1 warning, 1 inconclusive)

Check name Status Explanation Resolution
Description check ⚠️ Warning PR description states implementation uses APP_DOMAIN environment variable, but actual code uses settings.WEB_URL—the description is outdated and contradicts the implementation. Update the description to accurately reflect that settings.WEB_URL is parsed for the domain instead of using APP_DOMAIN directly, explaining the rationale from the design discussion.
Title check ❓ Inconclusive Title mentions APP_DOMAIN env var, but actual implementation uses settings.WEB_URL instead, creating a mismatch between the stated approach and implementation. Update the PR title to reflect the actual implementation: 'fix: Use WEB_URL settings for bot user email domain' or 'fix: Derive bot user email domain from WEB_URL configuration'.
✅ Passed checks (3 passed)
Check name Status Explanation
Linked Issues check ✅ Passed The implementation addresses issue #9251 by replacing hardcoded 'plane.so' domain with dynamic domain extraction from settings.WEB_URL, enabling proper bot user email generation for self-hosted instances.
Out of Scope Changes check ✅ Passed Changes are limited to workspace_seed_task.py, adding urlparse import and modifying only the bot user email domain generation logic as required by issue #9251.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@MagicRB

MagicRB commented Jun 18, 2026

Copy link
Copy Markdown

Shouldn't this go through the proper configuration system that plane has? reading it directly from the environment there is very side effectful and possibly unexpected. As far as I am aware APP_DOMAIN wasn't used by anything except to set other configuration options outside of plane (in the surrounding bash scripting). As such some folks might assume it's safe to remove post initialization as, again afaik plane won't unset configuration variables, when it doesn't see the accompanying environment variable. It shouldn't affect anything as this code should only be ran on instance init, but it still feels super hacky.

@okxint

okxint commented Jun 19, 2026

Copy link
Copy Markdown
Contributor Author

good point — updated to use settings.WEB_URL instead of reading APP_DOMAIN directly from the environment. parses the hostname out of the URL via urlparse and falls back to plane.so if WEB_URL isn't set. goes through the config system properly now.

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.

[bug]: plan.so is hardcoded into bot user email

2 participants