Initialize D-071 source registry and terra deployment
This commit is contained in:
commit
52391e802b
15 changed files with 249 additions and 0 deletions
6
.env.example
Normal file
6
.env.example
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
# Use an immutable image digest; terra may use a verified local Caddy image ID.
|
||||
CADDY_IMAGE=caddy@sha256:REPLACE_WITH_VERIFIED_DIGEST
|
||||
PUBLIC_ROOT=/opt/archipelago/data/public
|
||||
LISTEN_ADDRESS=127.0.0.1
|
||||
LISTEN_PORT=8098
|
||||
MIRROR_NETWORK=mirror_default
|
||||
5
.gitignore
vendored
Normal file
5
.gitignore
vendored
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
.env
|
||||
data/
|
||||
keys/
|
||||
*.secret
|
||||
*.log
|
||||
40
README.md
Normal file
40
README.md
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
# Archipelago infrastructure
|
||||
|
||||
Accepted deployment: terra, https://mirror.nw-sys.ru/archipelago/ (D-071).
|
||||
Source registries: `Archipelago/core`, `Archipelago/purposes`; contracts: `Archipelago/rfc`.
|
||||
|
||||
## Standalone web deployment
|
||||
|
||||
1. Copy `.env.example` to `.env`, set an immutable Caddy image and `PUBLIC_ROOT`.
|
||||
2. Create public `iso`, `ostree/layers`, `ostree/images`, `v1` directories.
|
||||
3. Initialize `PUBLIC_ROOT/releases.json` from `deploy/releases.empty.json` only on
|
||||
a fresh deployment. Never overwrite a populated catalog during code deployment.
|
||||
4. `docker compose up -d web` serves the complete `/archipelago/` prefix on localhost
|
||||
port 8098. Put your HTTPS reverse proxy in front; no mirror dependency is required.
|
||||
|
||||
## Existing terra mirror
|
||||
|
||||
Run `docker compose -f compose.yaml -f compose.mirror.yaml up -d web`, then as root
|
||||
run `python3 deploy/integrate-mirror.py`. The helper backs up and validates Caddy,
|
||||
inserts an explicit `/archipelago/` route before the existing fallback, reloads and
|
||||
restores the original configuration on reload failure. Existing `/archlinux` and
|
||||
rsync routes are preserved. The web container mounts public artifacts read-only
|
||||
and never receives a Docker socket, signing key, private staging or build workspace.
|
||||
|
||||
The homepage is public; private experimental ISOs must not be copied into public
|
||||
storage. The initial empty catalog accurately represents the lack of eligible
|
||||
testing/stable releases. Source-only Material You-inspired styling and original
|
||||
artwork require no remote fonts, scripts or upstream logo redistribution.
|
||||
|
||||
## Remaining pipeline work
|
||||
|
||||
The existing CLI ISO experiment is not yet a YAML-driven, independently built layer
|
||||
pipeline. Required sequence: strict Layer parser and locks → independent layer
|
||||
build → artifact upload → image composition from registry → ISO from exact image →
|
||||
validation/reproducibility → signed publication. Add builder/validator/publisher
|
||||
services only with a verified worker isolation profile; do not deploy a cron job
|
||||
that advertises missing CLI commands as successful work.
|
||||
|
||||
Registry-backed CLI update and PackageKit/GNOME Software/KDE Discover integration
|
||||
follow the staged transaction contract in RFC-0009 and D-071. Public signing keys,
|
||||
release wire schemas and complete update/reapplication evidence remain required.
|
||||
9
compose.mirror.yaml
Normal file
9
compose.mirror.yaml
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
services:
|
||||
web:
|
||||
networks:
|
||||
mirror:
|
||||
aliases: [archipelago-web]
|
||||
networks:
|
||||
mirror:
|
||||
external: true
|
||||
name: ${MIRROR_NETWORK:-mirror_default}
|
||||
26
compose.yaml
Normal file
26
compose.yaml
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
name: archipelago
|
||||
services:
|
||||
web:
|
||||
image: ${CADDY_IMAGE:?Set a pinned Caddy image digest or local image ID}
|
||||
restart: unless-stopped
|
||||
command: [caddy, run, --config, /etc/caddy/Caddyfile, --adapter, caddyfile]
|
||||
read_only: true
|
||||
security_opt: [no-new-privileges:true]
|
||||
cap_drop: [ALL]
|
||||
# The existing Caddy binary carries this file capability even on port 8080.
|
||||
cap_add: [NET_BIND_SERVICE]
|
||||
tmpfs: [/tmp, /config, /data]
|
||||
ports:
|
||||
- "${LISTEN_ADDRESS:-127.0.0.1}:${LISTEN_PORT:-8098}:8080"
|
||||
volumes:
|
||||
- ./deploy/Caddyfile:/etc/caddy/Caddyfile:ro
|
||||
- ./portal:/srv/portal:ro
|
||||
- ${PUBLIC_ROOT:?Set public artifact root}:/srv/artifacts:ro
|
||||
networks: [web]
|
||||
healthcheck:
|
||||
test: [CMD, wget, -q, -O, /dev/null, http://127.0.0.1:8080/archipelago/healthz]
|
||||
interval: 30s
|
||||
timeout: 5s
|
||||
retries: 3
|
||||
networks:
|
||||
web: {}
|
||||
43
deploy/Caddyfile
Normal file
43
deploy/Caddyfile
Normal file
|
|
@ -0,0 +1,43 @@
|
|||
{
|
||||
admin off
|
||||
auto_https off
|
||||
}
|
||||
:8080 {
|
||||
header {
|
||||
X-Content-Type-Options nosniff
|
||||
Referrer-Policy strict-origin-when-cross-origin
|
||||
Content-Security-Policy "default-src 'self'; style-src 'self'; script-src 'self'; img-src 'self'; object-src 'none'; base-uri 'self'; frame-ancestors 'none'"
|
||||
}
|
||||
redir /archipelago /archipelago/ 308
|
||||
handle /archipelago/healthz {
|
||||
respond "ok" 200
|
||||
}
|
||||
handle_path /archipelago/iso/* {
|
||||
root * /srv/artifacts/iso
|
||||
file_server
|
||||
}
|
||||
handle_path /archipelago/ostree/* {
|
||||
root * /srv/artifacts/ostree
|
||||
header Cache-Control "no-cache"
|
||||
file_server
|
||||
}
|
||||
handle_path /archipelago/v1/* {
|
||||
root * /srv/artifacts/v1
|
||||
header Cache-Control "no-cache"
|
||||
file_server
|
||||
}
|
||||
handle /archipelago/releases.json {
|
||||
root * /srv/artifacts
|
||||
rewrite * /releases.json
|
||||
header Cache-Control "no-cache"
|
||||
file_server
|
||||
}
|
||||
handle_path /archipelago/* {
|
||||
root * /srv/portal
|
||||
header Cache-Control "no-cache"
|
||||
file_server
|
||||
}
|
||||
handle {
|
||||
respond "Not found" 404
|
||||
}
|
||||
}
|
||||
21
deploy/bootstrap-git.sh
Normal file
21
deploy/bootstrap-git.sh
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
#!/bin/sh
|
||||
# Initial publication only; subsequent changes use ordinary reviewed Git commits.
|
||||
set -eu
|
||||
base=${1:-/opt/archipelago/src}
|
||||
export GIT_SSH_COMMAND=${GIT_SSH_COMMAND:-'ssh -i /opt/archipelago/keys/source-deploy -o BatchMode=yes -o ConnectTimeout=15 -o IdentitiesOnly=yes -o StrictHostKeyChecking=accept-new'}
|
||||
for name in core purposes infrastructure; do
|
||||
repo="$base/$name"
|
||||
if test -d "$repo/.git" && git -C "$repo" rev-parse --verify HEAD >/dev/null 2>&1; then
|
||||
echo "Already initialized: $repo; use ordinary Git workflow" >&2
|
||||
continue
|
||||
fi
|
||||
git -C "$repo" init -b main
|
||||
git -C "$repo" config user.name 'Archipelago automation'
|
||||
git -C "$repo" config user.email 'archipelago@nw-sys.ru'
|
||||
if ! git -C "$repo" remote get-url origin >/dev/null 2>&1; then
|
||||
git -C "$repo" remote add origin "ssh://git@git.fasoley.net:2222/Archipelago/$name.git"
|
||||
fi
|
||||
git -C "$repo" add .
|
||||
git -C "$repo" commit -m 'Initialize D-071 source registry and terra deployment'
|
||||
git -C "$repo" push -u origin main
|
||||
done
|
||||
39
deploy/integrate-mirror.py
Normal file
39
deploy/integrate-mirror.py
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
#!/usr/bin/env python3
|
||||
"""Explicit root deployment helper on terra; validates and backs up mirror config."""
|
||||
from pathlib import Path
|
||||
import os
|
||||
import subprocess
|
||||
import sys
|
||||
import time
|
||||
|
||||
config = Path(sys.argv[1] if len(sys.argv) > 1 else '/opt/mirror/caddy/Caddyfile')
|
||||
original = config.read_text()
|
||||
snippet = (Path(__file__).parent / 'mirror-route.caddy').read_text()
|
||||
marker = ' # Preserve the existing non-Arch mirror frontend.'
|
||||
if '# BEGIN ARCHIPELAGO' in original:
|
||||
raise SystemExit('Archipelago route already exists; review changes explicitly')
|
||||
if original.count(marker) != 1:
|
||||
raise SystemExit('Unknown mirror configuration: expected exactly one fallback marker')
|
||||
candidate = original.replace(marker, snippet + '\n' + marker)
|
||||
temporary = config.with_name('Caddyfile.archipelago-candidate')
|
||||
temporary.write_text(candidate)
|
||||
try:
|
||||
# Candidate is copied into the running container only for validation; live file
|
||||
# remains untouched until Caddy accepts it with the real modules/environment.
|
||||
subprocess.run(['docker','cp',str(temporary),'mirror-caddy:/tmp/archipelago-Caddyfile'],check=True)
|
||||
subprocess.run(['docker','exec','mirror-caddy','caddy','validate','--config','/tmp/archipelago-Caddyfile','--adapter','caddyfile'],check=True)
|
||||
backup = config.with_name(f'Caddyfile.before-archipelago-{time.time_ns()}')
|
||||
backup.write_bytes(config.read_bytes())
|
||||
# Keep the inode: the existing Docker bind mount targets this file.
|
||||
with config.open('w') as stream:
|
||||
stream.write(candidate)
|
||||
stream.flush()
|
||||
os.fsync(stream.fileno())
|
||||
result = subprocess.run(['docker','exec','mirror-caddy','caddy','reload','--config','/etc/caddy/Caddyfile','--adapter','caddyfile'])
|
||||
if result.returncode:
|
||||
config.write_text(original)
|
||||
subprocess.run(['docker','exec','mirror-caddy','caddy','reload','--config','/etc/caddy/Caddyfile','--adapter','caddyfile'],check=True)
|
||||
raise SystemExit('Reload failed; original mirror configuration restored')
|
||||
print(f'Integrated /archipelago/; backup: {backup}')
|
||||
finally:
|
||||
temporary.unlink(missing_ok=True)
|
||||
8
deploy/mirror-route.caddy
Normal file
8
deploy/mirror-route.caddy
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
# BEGIN ARCHIPELAGO (managed by infrastructure/deploy/integrate-mirror.py)
|
||||
handle /archipelago {
|
||||
redir /archipelago/ 308
|
||||
}
|
||||
handle /archipelago/* {
|
||||
reverse_proxy archipelago-web:8080
|
||||
}
|
||||
# END ARCHIPELAGO
|
||||
1
deploy/releases.empty.json
Normal file
1
deploy/releases.empty.json
Normal file
|
|
@ -0,0 +1 @@
|
|||
{"version":1,"releases":[]}
|
||||
6
deploy/terra.env
Normal file
6
deploy/terra.env
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
# Verified existing local Caddy image with required modules on terra.
|
||||
CADDY_IMAGE=sha256:7253722b5f5084a8b1c490f5bf9e63bfb8386b923a4a9d223b1d111519ad57f3
|
||||
PUBLIC_ROOT=/opt/archipelago/data/public
|
||||
LISTEN_ADDRESS=127.0.0.1
|
||||
LISTEN_PORT=8098
|
||||
MIRROR_NETWORK=mirror_default
|
||||
20
portal/index.html
Normal file
20
portal/index.html
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
<!doctype html>
|
||||
<html lang="ru">
|
||||
<head>
|
||||
<meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<meta name="theme-color" content="#d9e8e1">
|
||||
<meta name="description" content="Archipelago — декларативная Linux-система на базе Arch Linux с управлением образами через OSTree.">
|
||||
<title>Archipelago — система из выбранных слоёв</title>
|
||||
<link rel="icon" href="./mark.svg" type="image/svg+xml">
|
||||
<link rel="stylesheet" href="./style.css"><script src="./portal.js" defer></script>
|
||||
</head>
|
||||
<body>
|
||||
<header class="navigation"><a class="brand" href="./"><img src="./mark.svg" alt="" width="38" height="38">Archipelago</a><nav aria-label="Навигация"><a href="#downloads">Образы</a><a href="https://git.fasoley.net/Archipelago/rfc">Документация ↗</a><a href="https://git.fasoley.net/Archipelago">Исходники ↗</a></nav></header>
|
||||
<main>
|
||||
<section class="hero"><div><p class="eyebrow">ARCH LINUX · OSTREE · DECLARATIVE</p><h1>Ваша система.<br><span>Ваш набор слоёв.</span></h1><p class="intro">Archipelago объединяет экосистему Arch Linux с декларативной композицией и управляемыми образами ОС. От минимального Core до рабочего стола — с явными обновлениями и возможностью отката.</p><a class="button" href="#downloads">Выбрать образ <span aria-hidden="true">↓</span></a><a class="text-link" href="https://git.fasoley.net/Archipelago/rfc">Изучить архитектуру ↗</a></div><div class="islands" aria-hidden="true"><div class="island top">Purpose<span>GNOME / KDE</span></div><div class="island middle">Managed Overlays<span>Ваши возможности</span></div><div class="island base">Arch Core<span>Arch Linux + OSTree</span></div></div></section>
|
||||
<section class="features" aria-label="Принципы"><article><span class="number">01</span><h2>Описывайте намерение</h2><p>Версионированные YAML-манифесты определяют состав системы. Точные входы сборки закрепляются отдельно.</p></article><article><span class="number">02</span><h2>Обновляйте целиком</h2><p>Новый deployment готовится отдельно. Текущая система продолжает работать до вашей явной перезагрузки.</p></article><article><span class="number">03</span><h2>Расширяйте локально</h2><p>Host Extensions предназначены для локальных пакетов и аппаратных адаптаций. Такие композиции находятся вне официальной поддержки.</p></article></section>
|
||||
<section id="downloads" class="downloads"><div class="section-heading"><div><p class="eyebrow">ISO PORTAL</p><h2>Начните с Core</h2></div><span class="pill">Проект в разработке</span></div><p>Публичные образы появляются после обязательных проверок и подтверждения воспроизводимости. Экспериментальные лабораторные сборки не являются релизами testing/stable.</p><div id="release-list" aria-live="polite"><p>Проверяем каталог релизов…</p></div><noscript><p>Для просмотра каталога включите JavaScript. <a href="./releases.json">Каталог JSON</a>.</p></noscript><div class="planned"><span>Core · x86_64 · UEFI</span><span>GNOME · планируется</span><span>KDE Plasma · планируется</span></div></section>
|
||||
<section class="about"><p class="eyebrow">OPEN BY DESIGN</p><h2>Архитектура обсуждается открыто</h2><p>Контракты, решения и исходники доступны в организации Archipelago. Готовность отдельных компонентов подтверждается проверками, а не только наличием спецификации.</p><a class="text-link" href="https://git.fasoley.net/Archipelago/rfc">RFC и реестр контрактов ↗</a></section>
|
||||
</main>
|
||||
<footer><a class="brand" href="./">Archipelago</a><p>Независимый проект на базе <a href="https://archlinux.org/">Arch Linux</a>. Не является официальным проектом Arch Linux и не подразумевает его одобрения. Название и товарные знаки Arch Linux принадлежат их правообладателям. Графический знак Archipelago — самостоятельная иллюстрация.</p><a href="https://archlinux.org/trademark-policy/">Политика товарных знаков Arch Linux ↗</a></footer>
|
||||
</body></html>
|
||||
1
portal/mark.svg
Normal file
1
portal/mark.svg
Normal file
|
|
@ -0,0 +1 @@
|
|||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64"><rect width="64" height="64" rx="22" fill="#cee9dd"/><path d="M13 45 28 14h8l15 31H40l-8-18-8 18Z" fill="#1b6758"/><path d="M14 50h36" stroke="#387ba1" stroke-width="4" stroke-linecap="round"/><circle cx="32" cy="44" r="4" fill="#387ba1"/></svg>
|
||||
|
After Width: | Height: | Size: 306 B |
23
portal/portal.js
Normal file
23
portal/portal.js
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
"use strict";
|
||||
(async () => {
|
||||
const list = document.querySelector("#release-list");
|
||||
const message = text => { const p = document.createElement("p"); p.className = "empty"; p.textContent = text; list.replaceChildren(p); };
|
||||
try {
|
||||
const response = await fetch("./releases.json", {cache: "no-store"});
|
||||
if (!response.ok) throw new Error("catalog unavailable");
|
||||
const catalog = await response.json();
|
||||
if (catalog.version !== 1 || !Array.isArray(catalog.releases)) throw new Error("unknown catalog");
|
||||
if (!catalog.releases.length) { message("Публичных ISO пока нет. Идут экспериментальные проверки Core; релизы появятся здесь после прохождения всех обязательных критериев."); return; }
|
||||
const cards = catalog.releases.map(release => {
|
||||
if (!['testing','stable'].includes(release.channel) || !/^[0-9a-f]{64}$/.test(release.sha256)) throw new Error("invalid release");
|
||||
const url = new URL(release.url, location.href);
|
||||
if (url.origin !== location.origin || !url.pathname.startsWith('/archipelago/iso/')) throw new Error("invalid artifact URL");
|
||||
const card = document.createElement('article'); card.className = 'release';
|
||||
const title = document.createElement('h3'); title.textContent = `${release.variant} · ${release.architecture} · ${release.channel}`;
|
||||
const link = document.createElement('a'); link.href = url.href; link.textContent = `Скачать ISO · ${release.version}`;
|
||||
const hash = document.createElement('p'); const code = document.createElement('code'); code.textContent = `SHA-256: ${release.sha256}`; hash.append(code);
|
||||
card.append(title,link,hash); return card;
|
||||
});
|
||||
list.replaceChildren(...cards);
|
||||
} catch { message("Каталог релизов временно недоступен. Непроверенные ссылки на скачивание не отображаются."); }
|
||||
})();
|
||||
1
portal/style.css
Normal file
1
portal/style.css
Normal file
|
|
@ -0,0 +1 @@
|
|||
:root{color-scheme:light dark;--bg:#f5f7f2;--ink:#182c29;--muted:#4d625b;--surface:#e4ece6;--accent:#1b6758;--soft:#cee9dd;--line:#c2d0c7;font-family:Inter,ui-sans-serif,system-ui,-apple-system,"Segoe UI",sans-serif}*{box-sizing:border-box}html{scroll-behavior:smooth}body{margin:0;background:var(--bg);color:var(--ink)}a{color:inherit;text-underline-offset:.25em}a:focus-visible{outline:3px solid var(--accent);outline-offset:6px}main,.navigation,footer{max-width:1200px;margin:auto;padding:24px 40px}.navigation{display:flex;align-items:center;justify-content:space-between;gap:24px}.brand{display:flex;align-items:center;gap:10px;font-weight:750;font-size:22px;text-decoration:none;letter-spacing:-.7px}nav{display:flex;gap:24px;font-size:14px}nav a{text-decoration:none}.hero{display:grid;grid-template-columns:1.5fr 1fr;align-items:center;gap:50px;padding:70px 0 80px}.eyebrow{letter-spacing:.16em;font-size:11px;font-weight:750;color:var(--accent)}h1{font-size:clamp(40px,5.5vw,68px);letter-spacing:-3px;line-height:1.08;margin:22px 0}h1 span{color:var(--accent)}.intro{font-size:18px;line-height:1.75;color:var(--muted);max-width:630px}.button{display:inline-flex;gap:32px;align-items:center;background:var(--accent);color:#fff;border-radius:36px;padding:18px 24px;text-decoration:none;font-weight:650;margin:20px 22px 12px 0}.text-link{font-size:14px;font-weight:650}.islands{display:grid;gap:18px;transform:rotate(-6deg);padding:22px}.island{border-radius:36px;padding:34px;text-align:center;font-size:23px;font-weight:750;box-shadow:0 14px 0 #163c2910}.island span{display:block;margin-top:8px;font-size:12px;letter-spacing:.04em;font-weight:450}.top{background:#d8e5ff;color:#253956;margin-left:30px}.middle{background:#f2dfbb;color:#4c3d24;margin-right:25px}.base{background:var(--soft);color:#234f40}.features{display:grid;grid-template-columns:repeat(3,1fr);gap:18px}.features article{background:var(--surface);padding:28px;border-radius:28px}.number{display:inline-grid;place-items:center;width:38px;height:38px;border:1px solid var(--line);border-radius:50%;font-size:12px}h2{font-size:25px;line-height:1.2;letter-spacing:-.7px}.features p,.downloads p,.about p,footer p{color:var(--muted);line-height:1.7}.features h2{font-size:20px}.downloads{margin:65px 0;padding:36px;border:1px solid var(--line);border-radius:36px}.section-heading{display:flex;align-items:center;justify-content:space-between;gap:20px}.section-heading h2{font-size:34px;margin:8px 0}.pill{background:var(--soft);color:var(--accent);padding:10px 16px;border-radius:30px;font-size:12px;white-space:nowrap}.empty{background:var(--surface);border-radius:20px;padding:24px;margin:28px 0}.planned{display:flex;flex-wrap:wrap;gap:10px}.planned span{font-size:12px;border:1px solid var(--line);border-radius:20px;padding:8px 12px}.release{background:var(--surface);border-radius:24px;padding:24px;margin:20px 0}.release code{overflow-wrap:anywhere;font-size:12px}.release a{display:inline-block;margin:8px 16px 8px 0}.about{max-width:730px;padding-bottom:65px}.about h2{font-size:35px}footer{border-top:1px solid var(--line);padding-top:32px;padding-bottom:40px;font-size:12px}footer p{max-width:850px}@media(max-width:800px){main,.navigation,footer{padding-left:22px;padding-right:22px}.navigation{align-items:flex-start;flex-direction:column}nav{gap:16px;flex-wrap:wrap}.hero{grid-template-columns:1fr;padding:35px 0;gap:16px}.islands{max-width:420px;margin:auto;width:100%}.island{padding:22px}.features{grid-template-columns:1fr}h1{letter-spacing:-2px}.downloads{padding:24px;margin:40px 0}.section-heading{align-items:flex-start;flex-direction:column}}@media(prefers-color-scheme:dark){:root{--bg:#101c19;--ink:#e1ece5;--muted:#b4c7bc;--surface:#20312b;--accent:#98d5b9;--soft:#274a3c;--line:#3c5347}.button{background:#a8dfc5;color:#173f31}.base{color:#cbefdc}.top{background:#334560;color:#e2eaff}.middle{background:#514735;color:#f6e6c7}}@media(prefers-reduced-motion:reduce){html{scroll-behavior:auto}.islands{transform:none}}
|
||||
Loading…
Add table
Reference in a new issue