Move panel name and version into .env, bump to Beta 0.2.0

The product name, the channel word "Alpha" and the version were scattered
across install.sh, the CLI banner, two spots in App.tsx and three
package.json files, so a rename or a bump meant editing strings in code.

They now live in one committed .env at the project root (BRAND, CHANNEL,
VERSION), shipped inside the release archive and read at runtime: the CLI
loads it after cli.env — so real env and machine settings still win — and
injects the three values into awg-ui, which serves them from GET /ui/brand
for the wordmark. awg-ui also parses the same file directly, so
`npm run server` in dev shows what production shows.

install.sh keeps its own VERSION and CHANNEL and says why: it prints the
banner and builds the release URL before the archive holding .env has been
downloaded. It writes BRAND into cli.env only when the operator passed one
explicitly, so the file stays the single source otherwise.

Version bumped to Beta 0.2.0 across .env, install.sh and the three
package.json files.
This commit is contained in:
2026-08-29 03:08:51 +03:00
parent 18972ed58f
commit 602c0416ba
11 changed files with 86 additions and 40 deletions
+13 -1
View File
@@ -52,7 +52,7 @@ AWG_GEN=auto bash <(curl -Ls https://git.ma7neko.ru/maeneko/forgetting/raw/branc
| `REPO_BASE` | `https://git.ma7neko.ru/maeneko/forgetting` | основной источник архива релиза |
| `REPO_FALLBACK` | `https://github.com/maeneko/forgetting` | запасной, если в основном релиза ещё нет |
| `ARCHIVE_URL` | — | полный URL архива, перекрывает оба варианта |
| `BRAND` | `Forgetting` | имя продукта в баннерах, systemd-юните и панели |
| `BRAND` | из `.env` | имя продукта в баннерах, systemd-юните и панели |
Путь релиза у Gitea и GitHub одинаковый (`<repo>/releases/download/v<версия>/awgcontrol-<версия>.tar.gz`),
так что подходит любой из них. Если архив не найден в основном источнике,
@@ -63,6 +63,18 @@ REPO_BASE=https://git.example.org/me/vpn BRAND="My VPN" \
bash <(curl -Ls https://git.example.org/me/vpn/raw/branch/main/install.sh)
```
Имя панели, канал и версия лежат в `.env` в корне проекта (едет в архиве
релиза, на сервере — `/opt/awg-control/.env`):
```env
BRAND=Forgetting
CHANNEL=Beta
VERSION=0.2.0
```
Оттуда их читают CLI (баннер меню) и панель (вордмарк, `GET /ui/brand`).
`BRAND=` при установке перекрывает значение из файла.
Сама панель и её API к домену не привязаны: работают по адресу того сервера,
куда установлены, внешних сервисов не требуют.
## Управление