Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

setup_uhttpd_portal hardcodes the GUEST portal docroot to the TollGate path — the brand token cannot select a re-brand guest portal

未关闭 适合新手
#1,122 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
2/5
预计耗时
1-3 小时
新手友好度
72/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
活跃
技术栈
shell
领域
backend

调研方向

阅读 packaging/files/etc/uci-defaults/99-tollgate-setup,尤其是第899行附近的 load_brand 和 setup_uhttpd_portal()。追踪 BRAND 和 BRAND_HOSTNAME 的设置方式,然后检查现有管理设置如何分配其 webroot。完成标准是:首次启动时保留或选择带品牌的访客 docroot,同时未带品牌的 TollGate 路径保持不变。

由索引模型根据 Issue 内容生成。

描述

What

packaging/files/etc/uci-defaults/99-tollgate-setup hardcodes the guest captive portal docroot:

setup_uhttpd_portal() {
    ...
    uci set uhttpd.portal.home='/etc/tollgate/tollgate-captive-portal-site'

/etc/tollgate/tollgate-captive-portal-site is the TollGate-branded guest portal. It is written
unconditionally, with no brand input — so a re-brand that ships its own guest portal still ends up
serving this one at :2051.

Why that contradicts this file's own contract

The file states the rule a few hundred lines above the offending line (around load_brand):

The brand is a build INPUT, never a literal in this repo: a re-brand ships its own image,
docroot and naming from its own organisation and passes its token here.

The hostname, both SSIDs, the nodogsplash gatewayname and the device code are all derived from
the brand token. The guest portal docroot is the one brand-derived path that is spelled as a
literal
, so the mechanism the comment describes cannot actually reach the guest portal.

This is the same shape as the :8090 admin writer that comment is proud of having removed: a
brand-neutral package still naming one brand's path.

Measured

  • setup_uhttpd_portal() at 99-tollgate-setup:899 on main (checked 2026-10-26) sets
    uhttpd.portal.home='/etc/tollgate/tollgate-captive-portal-site' with no case "$BRAND" and no
    uci -q get guard — it overwrites whatever a branded image installed.
  • BRAND / BRAND_HOSTNAME are already loaded by this point in the script.
  • The admin side does not have this problem: uhttpd.admin's webroot is written by the
    portal's own 92-tollgate-admin-setup, explicitly described in-file as "the only writer that
    knows the brand webroot".

Effect for a branded deployment

A distributor ships a branded guest portal (build-time brand injection, own webroot), installs the
package, and the first boot points uhttpd.portal.home back at the generic TollGate portal. The
guest sees the generic branding regardless of what was installed, and nothing logs a conflict —
the write simply wins.

Suggested shape

Either is fine; both keep the unbranded path byte-identical:

  1. Derive it like everything else, with the current path as the tollgate default, e.g.
    /etc/tollgate/${BRAND_TOKEN}-captive-portal-site, guarded by "only set it if that directory
    exists, else keep the current value".
  2. Or let the distribution own it the way it already owns uhttpd.admin: don't write
    uhttpd.portal.home when a brand token is present, and document the expected writer.

Option 1 keeps one writer; option 2 mirrors the existing admin split. A guard that skips the write
when the branded docroot already exists would also be enough to stop the overwrite.

Happy to send a PR for whichever shape you prefer — I have a branded deployment that this
currently blocks.

主要语言
Go
星标
12
派生
14
平均合并
3 天 21 小时
30 天内合并 PR
263

环境准备

  • 没有 Dockerfile 或 Docker Compose 文件
  • 没有 Pull Request 模板
  • 阅读贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

OpenTollGate/tollgate-module-basic-go 的其他 Issue

查看 OpenTollGate/tollgate-module-basic-go 的全部 Issue

相似的 Issue

更多 Go Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。