istoreos / istoreos/quickstart

[Bug] Device management page never shows device hostnames (buildHostHintHostname regex bug)

Open Beginner friendly
#1 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
25
Forks
12
PR merge metrics
No merged PRs in 30d

Description

Bug 描述
设备管理页面中所有设备均不显示主机名。所有设备只显示 IP、MAC 和厂商信息,hostname 字段始终为空。

注意:此问题影响网络中的每一台设备,不是个别设备的问题。

根因分析
在 backend/service/lan_device_list_readers.go 中,buildHostHintHostname 函数使用了要求 hostname 中必须包含点号(.)的正则表达式。

该正则的设计意图是剥离域名后缀。但 ubus luci-rpc getHostHints 返回的是不带域名后缀的纯主机名,这些名称中不含点号。

因此正则表达式永远无法匹配,函数对所有设备都返回空字符串,所有设备的主机名都不显示。

建议修复
修改 buildHostHintHostname 函数,使其在正则匹配失败时回退返回原始名称。

环境信息
iStoreOS 24.10.5
quickstart v0.11.14new test value

Contributor guide

No contributing guide indexed for this repository

Research direction

Start in backend/service/lan_device_list_readers.go and inspect buildHostHintHostname, especially the hostname regex and its handling when matching fails. Verify the change preserves domain-suffix handling while allowing plain hostnames returned by ubus luci-rpc getHostHints; done means device management shows hostnames instead of empty values for all affected devices.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
backend, networking
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Quiet
Clarity
Clearly specified
Newbie friendliness
80/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.