[PR #5149] [MERGED] feat(env): allow setting the initial URI path for the web panel #5794

Closed
opened 2026-11-02 04:04:07 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/MHSanaei/3x-ui/pull/5149
Author: @Ponywka
Created: 6/9/2026
Status: ✅ Merged
Merged: 6/11/2026
Merged by: @MHSanaei

Base: main ← Head: feature/default-uri-path


📝 Commits (3)

  • ac3c35f feat(env): allow setting the initial URI path for the web panel
  • 0145b53 Merge branch 'main' into feature/default-uri-path
  • e8065ed fix(setting): normalize and guard XUI_INIT_WEB_BASE_PATH default

📊 Changes

11 files changed (+27 additions, -9 deletions)

View changed files

📝 .env.example (+2 -1)
📝 CONTRIBUTING.md (+2 -0)
📝 README.ar_EG.md (+1 -0)
📝 README.es_ES.md (+1 -0)
📝 README.fa_IR.md (+1 -0)
📝 README.md (+1 -0)
📝 README.ru_RU.md (+1 -0)
📝 README.tr_TR.md (+1 -0)
📝 README.zh_CN.md (+1 -0)
📝 docker-compose.yml (+1 -0)
📝 internal/web/service/setting.go (+15 -8)

📄 Description

Summary

Adds support for configuring the initial URI path for the web panel via the XUI_INIT_WEB_BASE_PATH environment variable.

Why

This allows deployments to define the web panel base path during initial setup, which is useful when running the panel behind a reverse proxy or under a non-root URI path.

Type of change

  • Bug fix
  • New feature
  • Refactoring (no behavior change)
  • Documentation
  • Tests only
  • Build / CI / tooling
  • Other

Areas affected

  • Frontend (UI / panel pages)
  • Backend (API endpoints, login, settings)
  • Xray config generation
  • Subscription (share links / Clash / JSON)
  • Statistics / traffic counters
  • Database / migrations
  • Install / upgrade script
  • Docker image
  • Multi-node (sub-nodes)
  • Telegram bot

How was this tested?

Tested locally by starting the application with XUI_INIT_WEB_BASE_PATH set to a custom URI path and confirming that the initial web panel path is applied correctly.

Also verified that the default value remains / when the environment variable is not set.

Breaking changes

None

Checklist

  • I tested the change locally and confirmed the described behavior.
  • I added or updated tests for the new behavior (when applicable).
  • go build ./... and the test suite pass locally.
  • For frontend changes: npm run lint, npm run typecheck, and npm run build pass.
  • I updated the Wiki / README / API docs if user-facing behavior changed.
  • My commits follow the project's existing message style.
  • I have no unrelated changes mixed into this PR.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/MHSanaei/3x-ui/pull/5149 **Author:** [@Ponywka](https://github.com/Ponywka) **Created:** 6/9/2026 **Status:** ✅ Merged **Merged:** 6/11/2026 **Merged by:** [@MHSanaei](https://github.com/MHSanaei) **Base:** `main` ← **Head:** `feature/default-uri-path` --- ### 📝 Commits (3) - [`ac3c35f`](https://github.com/MHSanaei/3x-ui/commit/ac3c35f9d1a45b1dab3736826e0600a8d52fb749) feat(env): allow setting the initial URI path for the web panel - [`0145b53`](https://github.com/MHSanaei/3x-ui/commit/0145b53dfcb65f558f1f2c1b7f1faa490df2f7d9) Merge branch 'main' into feature/default-uri-path - [`e8065ed`](https://github.com/MHSanaei/3x-ui/commit/e8065ed9d7985315b483e38dbc7ca86e5d74e26d) fix(setting): normalize and guard XUI_INIT_WEB_BASE_PATH default ### 📊 Changes **11 files changed** (+27 additions, -9 deletions) <details> <summary>View changed files</summary> 📝 `.env.example` (+2 -1) 📝 `CONTRIBUTING.md` (+2 -0) 📝 `README.ar_EG.md` (+1 -0) 📝 `README.es_ES.md` (+1 -0) 📝 `README.fa_IR.md` (+1 -0) 📝 `README.md` (+1 -0) 📝 `README.ru_RU.md` (+1 -0) 📝 `README.tr_TR.md` (+1 -0) 📝 `README.zh_CN.md` (+1 -0) 📝 `docker-compose.yml` (+1 -0) 📝 `internal/web/service/setting.go` (+15 -8) </details> ### 📄 Description ## Summary Adds support for configuring the initial URI path for the web panel via the `XUI_INIT_WEB_BASE_PATH` environment variable. ## Why This allows deployments to define the web panel base path during initial setup, which is useful when running the panel behind a reverse proxy or under a non-root URI path. ## Type of change - [ ] Bug fix - [x] New feature - [ ] Refactoring (no behavior change) - [ ] Documentation - [ ] Tests only - [ ] Build / CI / tooling - [x] Other ## Areas affected - [ ] Frontend (UI / panel pages) - [x] Backend (API endpoints, login, settings) - [ ] Xray config generation - [ ] Subscription (share links / Clash / JSON) - [ ] Statistics / traffic counters - [ ] Database / migrations - [ ] Install / upgrade script - [x] Docker image - [ ] Multi-node (sub-nodes) - [ ] Telegram bot ## How was this tested? Tested locally by starting the application with `XUI_INIT_WEB_BASE_PATH` set to a custom URI path and confirming that the initial web panel path is applied correctly. Also verified that the default value remains / when the environment variable is not set. ## Breaking changes None ## Checklist - [x] I tested the change locally and confirmed the described behavior. - [x] I added or updated tests for the new behavior (when applicable). - [x] `go build ./...` and the test suite pass locally. - [x] For frontend changes: `npm run lint`, `npm run typecheck`, and `npm run build` pass. - [x] I updated the Wiki / README / API docs if user-facing behavior changed. - [x] My commits follow the project's existing message style. - [x] I have no unrelated changes mixed into this PR. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-02 04:04:07 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
MHSanaei/3x-ui#5794
No description provided.