Feature Proposal - armbian-firstlogin add support for web setup fallback#9639
Feature Proposal - armbian-firstlogin add support for web setup fallback#9639Grippy98 wants to merge 1 commit intoarmbian:mainfrom
Conversation
📝 WalkthroughWalkthroughA conditional block was added to the armbian-firstlogin script that detects whether the armbian-web-config service is active and, if so, derives a Wi-Fi SSID from the system hostname and displays configuration instructions with a web URL to the user. Changes
Sequence Diagram(s)sequenceDiagram
participant Script as armbian-firstlogin Script
participant Systemctl as systemctl
participant FS as Filesystem (/etc/hostname)
participant User as User/Console
Script->>Systemctl: is-active --quiet armbian-web-config.service
alt Service is Active
Systemctl-->>Script: return success (exit 0)
Script->>FS: read /etc/hostname
FS-->>Script: hostname content
Script->>Script: derive WEB_SSID = hostname + "-armbiansetup"
Script->>User: print Wi-Fi SSID and web URL (http://10.42.0.1)
else Service is Inactive
Systemctl-->>Script: return failure (exit non-zero)
Note over Script: skip web config messaging
end
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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.
🧹 Nitpick comments (1)
packages/bsp/common/usr/lib/armbian/armbian-firstlogin (1)
766-771: Use a shared source of truth for web onboarding SSID/URL.Lines 767 and 770 hardcode assumptions about SSID format (
-armbiansetupsuffix) and AP IP address (http://10.42.0.1). If thearmbian-web-configservice defaults differ from these hardcoded values, first-login instructions become misleading. Consider reading these values from environment variables with current values as fallback defaults.🔧 Suggested refactor (backward-compatible defaults)
if systemctl is-active --quiet armbian-web-config.service; then - WEB_SSID="$(cat /etc/hostname)-armbiansetup" + WEB_HOSTNAME="$(hostnamectl --static 2>/dev/null || cat /etc/hostname)" + WEB_SSID="${ARMBIAN_WEB_CONFIG_SSID:-${WEB_HOSTNAME}-armbiansetup}" + WEB_URL="${ARMBIAN_WEB_CONFIG_URL:-http://10.42.0.1}" echo -e "\n\e[1m\e[96mWeb Configuration Available!\x1B[0m" echo -e "Connect to Wi-Fi SSID: \e[1m\e[92m${WEB_SSID}\x1B[0m" - echo -e "Then open \e[1mhttp://10.42.0.1\x1B[0m in your browser" + echo -e "Then open \e[1m${WEB_URL}\x1B[0m in your browser" echo -e "Or continue with CLI setup below...\n" fi🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@packages/bsp/common/usr/lib/armbian/armbian-firstlogin` around lines 766 - 771, The message hardcodes the SSID suffix and AP URL which can diverge from armbian-web-config defaults; change the logic that sets WEB_SSID and the printed URL to read from environment/config fallbacks instead of literals (e.g., use ARMBIAN_WEB_SSID_SUFFIX defaulting to "-armbiansetup" when computing WEB_SSID from /etc/hostname, and use ARMBIAN_WEB_CONFIG_URL defaulting to "http://10.42.0.1" for the printed address) and update the echo lines that reference WEB_SSID and the URL so the displayed values come from those variables; ensure this preserves current behavior when the env vars are unset and keep the check using systemctl is-active --quiet armbian-web-config.service.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@packages/bsp/common/usr/lib/armbian/armbian-firstlogin`:
- Around line 766-771: The message hardcodes the SSID suffix and AP URL which
can diverge from armbian-web-config defaults; change the logic that sets
WEB_SSID and the printed URL to read from environment/config fallbacks instead
of literals (e.g., use ARMBIAN_WEB_SSID_SUFFIX defaulting to "-armbiansetup"
when computing WEB_SSID from /etc/hostname, and use ARMBIAN_WEB_CONFIG_URL
defaulting to "http://10.42.0.1" for the printed address) and update the echo
lines that reference WEB_SSID and the URL so the displayed values come from
those variables; ensure this preserves current behavior when the env vars are
unset and keep the check using systemctl is-active --quiet
armbian-web-config.service.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 835a4093-72dc-471f-95e5-3b6a0b740a89
📒 Files selected for processing (1)
packages/bsp/common/usr/lib/armbian/armbian-firstlogin
Description
This includes a hook in armbian-firstlogin to eventually support web based user onboarding (if the service is enabled)
For what I'm prototyping/planning see -> https://github.com/Grippy98/armbian-web-config
This comes out of a need to have an easy setup page for some devices that have Wifi/Ethernet but maybe no display or easy way to connect to Serial.
Checklist:
Please delete options that are not relevant.
Summary by CodeRabbit