Secret URL path for the panel
The panel port is open to the internet, and its login page and JS bundle gave it away to any scanner in one GET. The installer now generates a random UI_PREFIX: from outside the panel answers only under http://IP:PORT/<prefix>/ and gives Go's plain "404 page not found" to everything else. Loopback needs no prefix (CLI, local Prometheus, nginx on the same host); while a move code is out, POST /migrate/v1/import is let through without it, since the code carries no path. A reinstall with kept data keeps the prefix; UI_PREFIX=off or a custom value can be set before running the installer. A moved panel brings its prefix in UI_PREFIX_MOVED, so old bookmarks and API clients keep working through the relay. awg-ctrl status and credentials show the full panel address. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013bNGYiDst62wH3ZGTRPFLJ
This commit is contained in:
@@ -57,6 +57,24 @@ AWG_GEN=auto bash <(curl -Ls https://raw.githubusercontent.com/maeneko/forgettin
|
||||
`REPO_BASE`, `REPO_FALLBACK`, `ARCHIVE_URL`, `BRAND` перед запуском установщика
|
||||
(подробности — в комментариях `install.sh` и в `.env`).
|
||||
|
||||
### Секретный путь панели
|
||||
|
||||
Установщик выдаёт панели случайный путь: она открывается по `http://IP:PORT/<путь>/`, а на
|
||||
любой другой адрес отвечает `404 page not found`, как пустой веб-сервер. Порт панели открыт
|
||||
в интернет, и без пути сканер узнавал её по странице логина. Путь хранится в `UI_PREFIX`
|
||||
в `/opt/awg-control/cli/cli.env`; полный адрес показывают `awg-ctrl status` и
|
||||
`awg-ctrl credentials`. Внешнему API нужен тот же путь: `http://HOST:PORT/<путь>/api/v1/…`
|
||||
(в примерах ниже `HOST:PORT` — вместе с путём).
|
||||
|
||||
- При переустановке с сохранением данных путь остаётся прежним. Свой путь —
|
||||
`UI_PREFIX=<8–64 символа A–Z a–z 0–9 _ ->`, без пути — `UI_PREFIX=off` перед запуском
|
||||
установщика (или правка `cli.env` и `awg-ctrl restart`).
|
||||
- С этой же машины (loopback) путь не нужен: CLI, локальный Prometheus и nginx ниже
|
||||
ходят как раньше.
|
||||
- При переносе панели (вкладка «Перенос», `awg-ctrl migrate`) новая панель принимает и свой
|
||||
путь, и путь старой (`UI_PREFIX_MOVED`) — закладки и API через ретранслятор продолжают
|
||||
работать. Пока выдан код переноса, `POST /migrate/v1/import` принимается и без пути.
|
||||
|
||||
### Панель за nginx
|
||||
|
||||
Панель работает и в корне домена, и в любой подпапке — пути в ней относительные,
|
||||
|
||||
Reference in New Issue
Block a user