|
| 1 | +# Website: melisai.dev |
| 2 | + |
| 3 | +## Overview |
| 4 | + |
| 5 | +melisai.dev is the project website hosted on Kubernetes (Hetzner Cloud). It consists of a landing page, install script endpoint, and full documentation site built from the `doc/` directory of this repo. |
| 6 | + |
| 7 | +## Architecture |
| 8 | + |
| 9 | +``` |
| 10 | +melisai repo (this repo) hetzner-k8s-infra repo |
| 11 | +├── doc/en/*.md (22 chapters) ├── apps/melisai-site/ |
| 12 | +├── doc/ru/*.md (22 chapters) │ ├── docs/en/*.md ← copied from melisai/doc/en/ |
| 13 | +└── context/WEBSITE.md (this) │ ├── docs/ru/*.md ← copied from melisai/doc/ru/ |
| 14 | + │ ├── public/ |
| 15 | + │ │ ├── index.html ← landing page |
| 16 | + │ │ └── install.sh ← one-liner installer |
| 17 | + │ ├── mkdocs.yml ← mkdocs-material config |
| 18 | + │ ├── nginx.conf |
| 19 | + │ ├── Dockerfile ← multi-stage: mkdocs build + nginx |
| 20 | + │ ├── werf.yaml |
| 21 | + │ └── .helm/ ← Helm chart (app-template pattern) |
| 22 | + └── terraform/ |
| 23 | + ├── dns.tf ← hcloud_zone melisai.dev |
| 24 | + └── cert_manager.tf ← TLS cert for melisai.dev |
| 25 | +``` |
| 26 | + |
| 27 | +## Repos |
| 28 | + |
| 29 | +| Repo | URL | Purpose | |
| 30 | +|------|-----|---------| |
| 31 | +| **melisai** | `github.com/dmitriimaksimovdevelop/melisai` | Go binary, source code, docs source (doc/en, doc/ru) | |
| 32 | +| **hetzner-k8s-infra** | `github.com/dmitriimaksimovdevelop/hetzner-k8s-infra` | K8s infra, website app, DNS, TLS, CI/CD | |
| 33 | + |
| 34 | +## URLs |
| 35 | + |
| 36 | +| URL | What | |
| 37 | +|-----|------| |
| 38 | +| `https://melisai.dev` | Landing page | |
| 39 | +| `https://melisai.dev/install` | Install script (`curl -sSL https://melisai.dev/install \| sh`) | |
| 40 | +| `https://melisai.dev/docs/` | Documentation (English, mkdocs-material) | |
| 41 | +| `https://melisai.dev/docs/ru/` | Documentation (Russian) | |
| 42 | + |
| 43 | +## How to Update Documentation on the Website |
| 44 | + |
| 45 | +Documentation lives in **two places** and must be synced: |
| 46 | + |
| 47 | +### Source of truth: `melisai/doc/` |
| 48 | + |
| 49 | +All documentation is authored in this repo under `doc/en/` and `doc/ru/`. This is the canonical source. |
| 50 | + |
| 51 | +### Website copy: `hetzner-k8s-infra/apps/melisai-site/docs/` |
| 52 | + |
| 53 | +The infra repo contains a **copy** of the docs that mkdocs builds into HTML. |
| 54 | + |
| 55 | +### Update procedure |
| 56 | + |
| 57 | +1. Edit docs in `melisai/doc/en/` and/or `melisai/doc/ru/` |
| 58 | +2. Commit and push to melisai repo |
| 59 | +3. Copy updated files to infra repo: |
| 60 | + ```bash |
| 61 | + # From melisai repo root |
| 62 | + cp doc/en/*.md ../hetzner-k8s-infra/apps/melisai-site/docs/en/ |
| 63 | + cp doc/ru/*.md ../hetzner-k8s-infra/apps/melisai-site/docs/ru/ |
| 64 | + |
| 65 | + # Rename introduction to index.md (mkdocs convention) |
| 66 | + mv ../hetzner-k8s-infra/apps/melisai-site/docs/en/00-introduction.md \ |
| 67 | + ../hetzner-k8s-infra/apps/melisai-site/docs/en/index.md |
| 68 | + mv ../hetzner-k8s-infra/apps/melisai-site/docs/ru/00-introduction.md \ |
| 69 | + ../hetzner-k8s-infra/apps/melisai-site/docs/ru/index.md |
| 70 | + ``` |
| 71 | +4. If new chapters were added, update `nav:` section in `mkdocs.yml` |
| 72 | +5. Commit, push, and deploy via werf (GitHub Actions `workflow_dispatch`, app=melisai-site) |
| 73 | + |
| 74 | +### Future: automate sync |
| 75 | + |
| 76 | +TODO: Add a GitHub Action in melisai repo that on push to `doc/**`: |
| 77 | +- Copies docs to hetzner-k8s-infra via repository_dispatch or direct commit |
| 78 | +- Triggers werf deploy |
| 79 | + |
| 80 | +## Infrastructure Details |
| 81 | + |
| 82 | +### DNS (terraform/dns.tf) |
| 83 | + |
| 84 | +```hcl |
| 85 | +resource "hcloud_zone" "melisai" { |
| 86 | + name = "melisai.dev" |
| 87 | +} |
| 88 | +# A records: @, www → Traefik LB IP |
| 89 | +``` |
| 90 | + |
| 91 | +**Prerequisites:** melisai.dev nameservers must point to Hetzner DNS: |
| 92 | +- `hydrogen.ns.hetzner.com` |
| 93 | +- `oxygen.ns.hetzner.com` |
| 94 | +- `helium.ns.hetzner.de` |
| 95 | + |
| 96 | +### TLS (terraform/cert_manager.tf) |
| 97 | + |
| 98 | +Let's Encrypt via cert-manager, HTTP-01 challenge through Traefik Gateway API. |
| 99 | + |
| 100 | +Certificate covers: `melisai.dev`, `www.melisai.dev` |
| 101 | + |
| 102 | +### Deployment |
| 103 | + |
| 104 | +werf-based CI/CD: |
| 105 | +- Push to `apps/melisai-site/**` triggers deploy |
| 106 | +- Or: `workflow_dispatch` with `app=melisai-site` |
| 107 | +- Docker image: multi-stage (python mkdocs → nginx alpine) |
| 108 | +- Helm chart: app-template pattern (Deployment + Service) |
| 109 | +- HTTPRoute needed for Traefik Gateway API (not yet created — add to .helm/templates/) |
| 110 | + |
| 111 | +### Stack |
| 112 | + |
| 113 | +| Component | Version | Role | |
| 114 | +|-----------|---------|------| |
| 115 | +| mkdocs-material | latest | Static site generator for docs | |
| 116 | +| mkdocs-static-i18n | latest | EN/RU language support | |
| 117 | +| nginx | 1.27-alpine | Web server | |
| 118 | +| werf | v2 | CI/CD, image build, deploy | |
| 119 | +| cert-manager | 1.15.3 | TLS certificates | |
| 120 | +| Traefik | v3.1 | Ingress / Gateway API | |
| 121 | + |
| 122 | +## Landing Page |
| 123 | + |
| 124 | +`public/index.html` — standalone HTML with inline CSS (no build tools needed). Dark theme matching GitHub aesthetic. Features: |
| 125 | +- Hero with install one-liner (click to copy) |
| 126 | +- Stats bar (67 tools / 37 rules / 8 collectors / 10s) |
| 127 | +- Terminal demo with colored output |
| 128 | +- 9-block feature grid |
| 129 | +- Nav links to docs (EN/RU) and GitHub |
| 130 | + |
| 131 | +## Install Script |
| 132 | + |
| 133 | +`public/install.sh` — served at `/install` as `text/plain`. Features: |
| 134 | +- Detects OS (linux only) and arch (amd64/arm64) |
| 135 | +- Fetches latest release tag from GitHub API |
| 136 | +- Downloads tarball from GitHub Releases |
| 137 | +- Installs to /usr/local/bin (sudo if needed) |
| 138 | +- Cleanup via trap |
| 139 | + |
| 140 | +Depends on goreleaser producing `melisai_<version>_linux_<arch>.tar.gz` artifacts. |
| 141 | + |
| 142 | +## Checklist for New Releases |
| 143 | + |
| 144 | +When releasing a new version of melisai: |
| 145 | + |
| 146 | +1. [ ] Tag and push: `git tag v0.X.Y && git push --tags` |
| 147 | +2. [ ] goreleaser creates GitHub Release with binaries |
| 148 | +3. [ ] Install script automatically picks up latest release |
| 149 | +4. [ ] Update landing page stats if anomaly/tool counts changed |
| 150 | +5. [ ] Sync docs to infra repo if documentation changed |
| 151 | +6. [ ] Deploy site: `workflow_dispatch` app=melisai-site |
0 commit comments