> For the complete documentation index, see [llms.txt](https://docs.seedex.net/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.seedex.net/ru/developer-guide/seedex-box.md).

# seedex-box

Эта страница описывает, как устроен репозиторий seedex-openwrt и как его собирать и линтить.

## Требования

* Docker для сборки. В нём работает apk-tools, который собирает пакеты.
* shfmt 3.13 и shellcheck 0.11 для линта.
* Роутер на OpenWrt 25.x или новее с `apk`, чтобы установить сборку.
* По желанию — ключ подписи apk в `~/.seedex/apk-sign.key`. Без ключа пакеты не подписаны, и `install.sh` ставит их с `--allow-untrusted`.

## Структура проекта

`seedex-box/files/` содержит пакет роутера:

* `usr/bin/sdx`: команда: диспетчер, статус и help.
* `usr/bin/seedex-router-watchdog`: пробует туннели и переключает overlay.
* `usr/lib/seedex/common.sh`: общие помощники: UCI, наборы nftables, пробы и строки статуса.
* `usr/lib/seedex/service.sh`: общее для всех сервисов: записи, apply, enable и import.
* `usr/lib/seedex/vpn.sh`, `proxy.sh`, `router.sh` и `dns.sh`: по библиотеке на сервис.
* `usr/lib/seedex/link.sh`: линк: соединение, синхронизация, выбор и удалённые команды.
* `etc/init.d/seedex`: сервис-зонтик, который запускает остальные по порядку.
* `etc/init.d/seedex-*`: по procd-сервису на модуль.
* `etc/config/seedex-*`: документированные UCI-конфиги, по умолчанию пустые.
* `etc/hotplug.d/net/50-seedex-proxy`: подключает интерфейс proxy, когда sing-box его поднимает.

`seedex-box/package/` содержит скрипты apk для установки, обновления и удаления.

`luci-app-seedex/files/` содержит приложение для LuCI:

* `usr/libexec/rpcd/luci.seedex`: rpcd-бэкенд, с которым говорит LuCI. Он запускает `sdx`.
* `www/luci-static/resources/seedex/api.js`: JavaScript-клиент бэкенда и общие виджеты.
* `www/luci-static/resources/view/seedex/*.js`: по представлению на вкладку.

На верхнем уровне `build.sh` собирает пакеты, `install.sh` — скрипт, который запускают пользователи, `version` хранит версию.

## Сборка

Выполните команду:

```sh
make build
```

Команда собирает `seedex-box` и `luci-app-seedex` в `build/noarch/` вместе с индексом фида и кладёт публичный ключ в `build/keys/`.

Чтобы установить сборку на роутер, скопируйте `install.sh`, `build/keys` и `build/noarch` на роутер и выполните там `sh install.sh noarch/*.apk`.

## Линт

`make lint` прогоняет shfmt и shellcheck по всем shell-файлам.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.seedex.net/ru/developer-guide/seedex-box.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
