feat: add a customizable message for local login#3168
Conversation
This PR adds the possibility to add a customizable message displayed on the local login form. This will be useful to display the username/password of the upcoming Seerr online demo.
📝 WalkthroughWalkthrough
ChangesOptional Login Message Banner
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes Poem
🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. 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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@next.config.ts`:
- Line 6: The loginMessage field in the env config is build-time only and won't
update in containerized deployments without a rebuild. Remove the loginMessage
entry from the env config in next.config.ts, then add loginMessage to the
PublicSettingsResponse interface and implement it in the /api/v1/settings/public
endpoint to make it runtime configurable. This will allow the setting to be
changed via the existing admin settings system without requiring a container
rebuild.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 37caf1c7-c31b-4cd0-b8b5-cffe8d7cddf3
📒 Files selected for processing (2)
next.config.tssrc/components/Login/LocalLogin.tsx
| const nextConfig: NextConfig = { | ||
| env: { | ||
| commitTag: process.env.COMMIT_TAG || 'local', | ||
| loginMessage: process.env.LOGIN_MESSAGE, |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
set -euo pipefail
# 1) Locate all sources/consumers of login message env.
rg -nP "LOGIN_MESSAGE|process\.env\.loginMessage|nextConfig|env:\s*\{" --type ts --type tsx --type js --type jsx
# 2) Check docs/container files for runtime env expectations.
fd -HI 'Dockerfile|docker-compose|compose|README|docs' || true
rg -nP "environment|env var|runtime|docker|COMMIT_TAG|LOGIN_MESSAGE" README* docs* Dockerfile* docker-compose* 2>/dev/null || true
# 3) Look for existing runtime settings pathways that could carry a login message.
rg -nP "currentSettings|publicSettings|runtimeConfig|/api/.*/settings" src server 2>/dev/null || trueRepository: seerr-team/seerr
Length of output: 88
🏁 Script executed:
#!/bin/bash
set -euo pipefail
# 1) First, locate next.config.ts and inspect it
echo "=== Locating next.config.ts ==="
fd -t f 'next\.config\.ts$' || echo "Not found with strict match"
# 2) Search for LOGIN_MESSAGE and loginMessage references (fix file type issue)
echo "=== Searching for LOGIN_MESSAGE usage ==="
rg -n "LOGIN_MESSAGE|loginMessage" -t ts -t js --no-heading 2>/dev/null || echo "Search completed"
# 3) Check for docker/deployment files
echo "=== Looking for Docker and deployment config ==="
fd -t f -e Dockerfile -e 'docker-compose.yml' -e 'docker-compose.yaml' -e '.env*' -e 'README*' . 2>/dev/null | head -20 || true
# 4) Check for runtime settings/config patterns
echo "=== Searching for runtime settings patterns ==="
rg -n "publicRuntimeConfig|serverRuntimeConfig|runtimeConfig|currentSettings|/api" -t ts -t js --max-count 20 2>/dev/null || echo "No runtime config patterns found"Repository: seerr-team/seerr
Length of output: 50372
🏁 Script executed:
#!/bin/bash
set -euo pipefail
# 1. Read next.config.ts to see full context
echo "=== next.config.ts content ==="
head -30 next.config.ts
# 2. Check PublicSettingsResponse interface
echo -e "\n=== PublicSettingsResponse interface ==="
fd -t f 'settingsInterfaces' | head -5 | xargs -I {} head -100 {}
# 3. Check if loginMessage exists in settings
echo -e "\n=== Looking for loginMessage in interfaces and database ==="
rg -n "loginMessage" -t ts -t js 2>/dev/null | head -20
# 4. Check Settings entity/table
echo -e "\n=== Looking for Settings entity definitions ==="
fd -t f -e ts 'Settings' src server | xargs grep -l "class Settings" 2>/dev/null || echo "No Settings class found"
fd -t f -e ts 'MainSettings\|PublicSettings' src server 2>/dev/null | head -5
# 5. Check routes for settings endpoints
echo -e "\n=== Settings routes (main settings endpoint) ==="
rg -A 10 "'/api/v1/settings/main'" server/routes -t ts 2>/dev/null | head -40Repository: seerr-team/seerr
Length of output: 3059
🏁 Script executed:
#!/bin/bash
set -euo pipefail
# Check if there are any environment variable documentation or examples
echo "=== Checking for docs and .env examples ==="
fd -t f '\.(env|md|txt)' . | grep -i -E '(env|readme|doc|example)' | head -20
# Check docker/deployment setup
echo -e "\n=== Checking for deployment documentation ==="
find . -maxdepth 2 -name 'Dockerfile*' -o -name 'docker-compose*' -o -name '.dockerignore' 2>/dev/null | xargs cat 2>/dev/null | head -60 || echo "No Docker files"
# Confirm PublicSettingsResponse is fetched at runtime
echo -e "\n=== Confirm runtime public settings endpoint ==="
rg -n "'/api/v1/settings/public'" src server -t ts -A 3 2>/dev/null | head -30Repository: seerr-team/seerr
Length of output: 4412
loginMessage is build-time only, not runtime configurable in containerized deployments.
Line 6 uses Next.js env config to expose LOGIN_MESSAGE, which inlines the value at build time. In Docker deployments, changing the LOGIN_MESSAGE environment variable won't take effect without a rebuild and restart. The codebase already has a runtime settings system via the /api/v1/settings/public API endpoint and PublicSettingsResponse interface; loginMessage should be added there if runtime admin configurability is required.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@next.config.ts` at line 6, The loginMessage field in the env config is
build-time only and won't update in containerized deployments without a rebuild.
Remove the loginMessage entry from the env config in next.config.ts, then add
loginMessage to the PublicSettingsResponse interface and implement it in the
/api/v1/settings/public endpoint to make it runtime configurable. This will
allow the setting to be changed via the existing admin settings system without
requiring a container rebuild.
There was a problem hiding this comment.
@seerr-team/seerr-core WDYT? The goal of this is not really to be a configurable setting for everyone, but rather to add the possibility to display a custom message in very particular cases (for the demo feature).
There was a problem hiding this comment.
Seems like the humans are having a chat. I'll hop back into my burrow for now. If you need me again, just tag @coderabbitai in a new comment, and I'll come hopping out!
seerr
|
||||||||||||||||||||||||||||
| Project |
seerr
|
| Branch Review |
feat/login-message
|
| Run status |
|
| Run duration | 02m 16s |
| Commit |
|
| Committer | Gauthier |
| View all properties for this run ↗︎ | |
| Test results | |
|---|---|
|
|
0
|
|
|
0
|
|
|
0
|
|
|
0
|
|
|
32
|
| View all changes introduced in this branch ↗︎ | |
Description
This PR adds the possibility to add a customizable message displayed on the local login form. This will be useful to display the username/password of the upcoming Seerr online demo.
Re #3017
How Has This Been Tested?
LOGIN_MESSAGE='Hello World!' pnpm devScreenshots / Logs (if applicable)
Checklist:
pnpm buildpnpm i18n:extractSummary by CodeRabbit