Skip to content

Feature Proposal - armbian-firstlogin add support for web setup fallback#9639

Open
Grippy98 wants to merge 1 commit intoarmbian:mainfrom
Grippy98:web-onboarding
Open

Feature Proposal - armbian-firstlogin add support for web setup fallback#9639
Grippy98 wants to merge 1 commit intoarmbian:mainfrom
Grippy98:web-onboarding

Conversation

@Grippy98
Copy link
Copy Markdown
Contributor

@Grippy98 Grippy98 commented Apr 7, 2026

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.

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • My changes generate no new warnings
  • Any dependent changes have been merged and published in downstream modules

Summary by CodeRabbit

  • New Features
    • First login now displays Wi-Fi network details and provides a web configuration URL when the web configuration service is active.

@Grippy98 Grippy98 requested a review from a team as a code owner April 7, 2026 15:30
@Grippy98 Grippy98 requested review from TRSx80 and mhoffrog and removed request for a team April 7, 2026 15:30
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Apr 7, 2026

📝 Walkthrough

Walkthrough

A 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

Cohort / File(s) Summary
Web Configuration Detection
packages/bsp/common/usr/lib/armbian/armbian-firstlogin
Added conditional logic to check if armbian-web-config.service is active; when active, derives WEB_SSID from /etc/hostname with -armbiansetup suffix and prints user-facing Wi-Fi SSID and web configuration URL (http://10.42.0.1) to stdout.

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
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Poem

🐰 A little hop through conditionals so neat,
Where web-config awakens, the setup's complete!
From hostname to SSID, a suffix we append,
Users now know their Wi-Fi, round every bend! 🌐✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: adding web setup fallback support to armbian-firstlogin. It is specific, concise, and directly reflects the primary functionality introduced in the changeset.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ 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.

@github-actions github-actions bot added size/small PR with less then 50 lines 05 Milestone: Second quarter release Needs review Seeking for review BSP Board Support Packages labels Apr 7, 2026
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

🧹 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 (-armbiansetup suffix) and AP IP address (http://10.42.0.1). If the armbian-web-config service 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

📥 Commits

Reviewing files that changed from the base of the PR and between 28862c7 and 9f31576.

📒 Files selected for processing (1)
  • packages/bsp/common/usr/lib/armbian/armbian-firstlogin

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

Labels

05 Milestone: Second quarter release BSP Board Support Packages Needs review Seeking for review size/small PR with less then 50 lines

Development

Successfully merging this pull request may close these issues.

1 participant