Default-enable Team mode; support opt-out env parsing, update UI copy, add tests#15
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: bd2dd3bc68
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| def _enabled() -> bool: | ||
| return os.environ.get("ENGRAPHIS_TEAM_MODE", "").lower() in {"1", "true", "yes", "on"} | ||
| value = os.environ.get("ENGRAPHIS_TEAM_MODE", "").strip().lower() | ||
| return value not in {"0", "false", "no", "off"} |
There was a problem hiding this comment.
Keep setup closed until Team is active
With the default now returning true, attach() mounts the public /api/auth/setup route even on a no-license install where /api/auth/state reports enabled: false. Since setup() allows the first admin to be created without a Team license and /api/auth/setup is in the dashboard's public allow-list, anyone who can reach a default open dashboard can pre-seed an admin account; once a Team license/trial is later activated, setup is blocked and that account becomes the team owner. Gate setup on an active Team entitlement or keep auth routes unmounted until Team is actually active.
Useful? React with 👍 / 👎.
Motivation
Description
_enabled()inengraphis/routes/v2_team.pyto readENGRAPHIS_TEAM_MODE, normalize it withstrip().lower(), and treat the setting as opt-out by returningvalue not in {"0","false","no","off"}instead of only accepting explicit truthy values.engraphis/static/index.htmlto state that team mode is enabled by default and to instruct how to opt out (ENGRAPHIS_TEAM_MODE=0).tests/test_dashboard_v2.py:test_team_mode_env_opt_out_parsing(parameterized checks for various opt-out strings) andtest_team_mode_defaults_on_but_auth_wall_waits_for_team_license(verifies default-on behavior and auth state when no license).Testing
pytest, specifically exercisingtests/test_dashboard_v2.pyand the two new teststest_team_mode_env_opt_out_parsingandtest_team_mode_defaults_on_but_auth_wall_waits_for_team_license, and they passed.Codex Task