• JavaScript 48.2%
  • TypeScript 38%
  • Shell 12.2%
  • HTML 0.7%
  • Dockerfile 0.5%
  • Other 0.4%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
egoreast db75973c8e
All checks were successful
CI / remote (push) Successful in 37s
CI / local (push) Has been skipped
CI / validate GitHub-hosted checks passed
CI / gate (push) Successful in 3s
Release / deploy (push) Successful in 36s
chore: bump version to 0.24.6
Signed-off-by: egoreast <egor.east@yandex.ru>
2026-12-04 13:30:13 +03:00
.claude docs(skills): mandate plan-protocol format before plan_save 2026-10-31 23:43:17 +03:00
.forgejo/workflows ci: bump forgejo runner to ubuntu-26.04 2026-12-02 13:47:47 +03:00
.github/workflows feat(ci): run Renovate on GitHub-hosted runners 2026-11-11 00:46:58 +03:00
.husky feat: enforce commitlint and DCO auto-sign via commit-msg hook 2026-10-08 00:02:31 +03:00
.opencode docs: fix workflow tool 2026-11-07 14:21:25 +03:00
.specify chore: add TDD/plan-implement workflow skills and spec-kit agent rules 2026-10-31 13:35:41 +03:00
actions/checks feat(ci): run checks on GitHub-hosted runners with local fallback 2026-11-11 00:46:57 +03:00
docs docs: run full verification once as a dedicated final task 2026-11-11 19:52:50 +03:00
editor chore(deps): update swaggerapi/swagger-editor docker tag to v5.10.1 2026-11-02 06:06:10 +00:00
scripts feat(ci): live run link in remote job (port from mobile) 2026-11-11 11:57:33 +03:00
.env.example feat: make BACKEND_API_HOSTNAME a required build arg substituted into openAPI.yaml 2026-10-08 10:37:12 +03:00
.gitattributes chore: gitattributes eol for opencode tools 2026-10-31 14:01:53 +03:00
.gitignore fix: un-ignore .env.example (caught by the .env.* glob) 2026-09-15 17:49:09 +03:00
AGENTS.md docs: run full verification once as a dedicated final task 2026-11-11 19:52:50 +03:00
AI_PROFILES.md feat(opencode): profile plugin with adaptive model failover 2026-09-21 15:52:24 +03:00
CHANGELOG.md chore: bump version to 0.24.6 2026-12-04 13:30:13 +03:00
CLAUDE.md chore: add TDD/plan-implement workflow skills and spec-kit agent rules 2026-10-31 13:35:41 +03:00
commitlint.config.mjs feat: enforce commitlint and DCO auto-sign via commit-msg hook 2026-10-08 00:02:31 +03:00
docker-compose.dev.yml feat: add self-hosted dev OpenAPI editor with save-to-disk 2026-08-04 13:17:31 +03:00
Dockerfile ci(deploy): switch release deploy to Forgejo container registry 2026-11-04 20:37:38 +03:00
index.html fix: rename Admin API to API 2026-08-14 12:06:15 +03:00
Makefile feat(deploy): add .env.example and load it in make prod-build 2026-09-15 17:48:42 +03:00
nginx.conf feat(deploy): bake BACKEND_API_HOSTNAME into the nginx CSP 2026-09-15 17:40:24 +03:00
openAPI.yaml chore: bump version to 0.24.6 2026-12-04 13:30:13 +03:00
package-lock.json chore: update dependencies 2026-12-02 12:30:34 +03:00
package.json chore: bump version to 0.24.6 2026-12-04 13:30:13 +03:00
README.md ci: pin VPS host key from the VPS_SSH_KNOWN_HOSTS secret 2026-10-26 22:13:30 +03:00
renovate.json ci(renovate): track the swagger-ui-dist version pinned in the Dockerfile 2026-09-08 14:30:38 +03:00

Docs service

Standalone Swagger UI + OpenAPI spec service for the API — Слово.Проповеди.

The service is a fully static nginx container: it serves the Swagger UI documentation UI and the openAPI.yaml specification file. It is independent of the admin backend — no Postgres, MinIO, or backend containers are required to run it.

Makefile shortcuts

Команды из этого README обёрнуты в Makefile — см. make help для полного списка целей (dev-редактор, прод-сборка, запуск, остановка).

What it serves

Endpoint Description
/ Swagger UI (interactive API documentation)
/openAPI.yaml The OpenAPI 3.2.0 specification (raw YAML)

Build the Docker image

docker build -t slovo-propovedi-docs .

The build downloads swagger-ui-dist (default 5.32.12, overridable via the SWAGGER_UI_VERSION build arg) and bundles it with the custom index.html, openAPI.yaml, and nginx.conf into a minimal nginx:alpine image. There is no Node.js runtime in the final image.

The backend API hostname is REQUIRED (no default): it is substituted into the __BACKEND_API_HOSTNAME__ placeholders in the nginx CSP and the openAPI.yaml servers URL, via the BACKEND_API_HOSTNAME build arg — the build fails without it.

# With a specific Swagger UI version and/or backend hostname
docker build --build-arg SWAGGER_UI_VERSION=5.32.12 --build-arg BACKEND_API_HOSTNAME=api.example.com \
  -t slovo-propovedi-docs .

# Or via the Makefile shortcut:
make prod-build SWAGGER_UI_VERSION=5.32.12 BACKEND_API_HOSTNAME=api.example.com

Run it locally

docker run --rm -p 8080:8080 slovo-propovedi-docs

Then open http://localhost:8080/ to browse the API documentation.

Quick sanity check:

curl -s http://localhost:8080/openAPI.yaml | head

How to update the spec

  1. Edit openAPI.yaml (OpenAPI 3.2.0, servers: http://localhost:3000 and https://api.example.com).

  2. Rebuild the image:

    docker build -t slovo-propovedi-docs .
    
  3. Restart the container with the new image.

Локальный редактор OpenAPI (только для разработки)

Для удобного редактирования openAPI.yaml (вместо правки файла вручную) есть отдельный dev-контейнер: официальный Swagger Editor v5 + кнопки Load from disk и Save to disk. Он не входит в прод-образ (см. Dockerfile) и существует только локально.

Самый простой способ запустить редактор — make:

make dev-up

Команда собирает и запускает dev-контейнер, ждёт, пока редактор станет готовым, и автоматически открывает его в браузере по адресу http://localhost:8081/ (в headless-окружениях без браузера она просто печатает сообщение о готовности). Редактор автоматически загрузит текущий openAPI.yaml. Кнопка Save to disk записывает содержимое редактора обратно в openAPI.yaml на диске (файл примонтирован как том). После сохранения проверьте diff и закоммитьте:

git diff openAPI.yaml
git add openAPI.yaml && git commit

Если браузер не открылся сам (или вы его закрыли) — откройте вручную:

make dev-open

Остановить dev-редактор:

make dev-down

Если предпочитаете сырые команды: под капотом make dev-up — это просто docker compose -f docker-compose.dev.yml up --build.

Продакшен-контейнер (Swagger UI на :8080) этим не затрагивается.

Изменения openAPI.yaml вне редактора (git pull, переключение веток и т.п.) идут через атомарную замену файла: работающий контейнер держит старый inode и отдаёт старую версию до перезапуска. Перезапустите dev-контейнер: make dev-restart (или make dev-down && make dev-up). Кнопка Save to disk не затронута — она пишет в тот же примонтированный файл.

Deployment

Production deployment is fully automated via Forgejo Actions.

How it works

  1. Push a commit to main → CI workflow validates openAPI.yaml.
  2. Tag a release (v*) and push → the Release workflow:
    • Waits for CI to pass on the tagged commit.
    • SSHes into the VPS, uploads scripts/vps-deploy.sh, and runs it.
    • The workflow transfers the source code to the VPS via tar+ssh, then runs scripts/vps-deploy.sh which builds the Docker image on the VPS via docker buildx, writes the Traefik labels + systemd unit, and restarts slovo-docs.service.
git tag v1.0.0
git push origin v1.0.0

Boundary. vps-deploy.sh owns only the slovo-docs container and its own slovo-docs Docker network. Shared infrastructure — Docker, the slovo user/group, the slovo-constrained buildx builder, Traefik (slovo-traefik.service) and the traefik network — is owned by the external slovo-propovedi-playbook and must be provisioned first (just setup-all). The script only verifies it and fails fast if anything is missing.

Required Forgejo secrets

Settings → Actions → Secrets.

Secret Description
VPS_SSH_PRIVATE_KEY SSH private key (ed25519) for root access to the VPS
VPS_SSH_KNOWN_HOSTS Pinned VPS host key: ssh-keyscan <VPS_HOST> output, verified against the server's fingerprints (see docs/ci-cd.md)
VPS_HOST VPS hostname or IP
VPS_SSH_USER SSH user on the VPS (root)

Required Forgejo variables

Settings → Actions → Variables.

Variable Description
DOCS_HOSTNAME Public hostname for the docs site (e.g. docs.example.com)

VPS prerequisites

The VPS must already be provisioned by the external slovo-propovedi-playbook (just setup-all) before the first deploy. The script verifies these and errors out if any is missing:

  • Docker is installed and running
  • slovo system user/group exists
  • Docker buildx builder slovo-constrained exists
  • Traefik reverse proxy is running (slovo-traefik.service)
  • the traefik Docker network exists

Repository layout

Dockerfile     # Multi-stage build: swagger-ui-dist + nginx
index.html     # Custom Swagger UI entry page
nginx.conf     # Server config: port 8080, YAML content type, CORS, security headers
openAPI.yaml   # The OpenAPI specification