diff --git a/.github/workflows/pages.yml b/.github/workflows/pages.yml new file mode 100644 index 0000000..aa2b09f --- /dev/null +++ b/.github/workflows/pages.yml @@ -0,0 +1,57 @@ +name: Deploy documentation + +on: + push: + branches: [main] + paths: + - "docs/site/**" + - "assets/logo/**" + - "assets/brand/**" + - "requirements-docs.txt" + - ".github/workflows/pages.yml" + workflow_dispatch: + +permissions: + contents: read + pages: write + id-token: write + +concurrency: + group: pages + cancel-in-progress: false + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Setup Python + uses: actions/setup-python@v5 + with: + python-version: "3.12" + cache: pip + cache-dependency-path: requirements-docs.txt + + - name: Install MkDocs + run: pip install -r requirements-docs.txt + + - name: Build site + run: mkdocs build --strict -f docs/site/mkdocs.yml + + - name: Upload Pages artifact + uses: actions/upload-pages-artifact@v3 + with: + path: site + + deploy: + needs: build + runs-on: ubuntu-latest + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + steps: + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v4 diff --git a/.gitignore b/.gitignore index dd3b88e..9c388a6 100644 --- a/.gitignore +++ b/.gitignore @@ -20,3 +20,6 @@ Thumbs.db # Env .env .env.* + +# MkDocs build output +/site/ diff --git a/README.md b/README.md index d1b3ebf..fcb9e2c 100644 --- a/README.md +++ b/README.md @@ -18,6 +18,8 @@

+ Docs site + · Go module docs · v0.8.0 @@ -185,10 +187,28 @@ go run ./cmd/shiftlock-inspect readiness-report -format json Destructive recovery requires `--expected-owner`, `--expected-token`, `--reason`, and `--confirm` — never a blind force-unlock. +## Documentation site + +Human-oriented docs are published with MkDocs Material to GitHub Pages: + +**[https://theworker02.github.io/shiftlock/](https://theworker02.github.io/shiftlock/)** + +Sources live under [`docs/site/`](docs/site/). Preview locally: + +```bash +pip install -r requirements-docs.txt +mkdocs serve -f docs/site/mkdocs.yml +``` + +Deploy uses [`.github/workflows/pages.yml`](.github/workflows/pages.yml). In the +repo **Settings → Pages**, set the source to **GitHub Actions** (not a branch +folder). Site Python deps are in `requirements-docs.txt` only — not `go.mod`. + ## Documentation | Topic | Link | |-------|------| +| **Docs site** | **[theworker02.github.io/shiftlock](https://theworker02.github.io/shiftlock/)** | | Architecture | [docs/architecture.md](docs/architecture.md) | | Handoff protocol | [docs/handoff-protocol.md](docs/handoff-protocol.md) | | Fencing tokens | [docs/fencing-tokens.md](docs/fencing-tokens.md) | diff --git a/docs/site/README.md b/docs/site/README.md index 1e0a6b8..c021f2e 100644 --- a/docs/site/README.md +++ b/docs/site/README.md @@ -1,7 +1,24 @@ # ShiftLock Documentation Site -Markdown documentation hierarchy for Phase 6. Intended for MkDocs / similar static -generators later; until then browse these pages directly in the repository. +Published with **MkDocs Material** from this tree. Live site: +[https://theworker02.github.io/shiftlock/](https://theworker02.github.io/shiftlock/). + +## Local preview + +From the repository root (Python 3.10+): + +```bash +pip install -r requirements-docs.txt +mkdocs serve -f docs/site/mkdocs.yml +``` + +Build: + +```bash +mkdocs build --strict -f docs/site/mkdocs.yml +``` + +Site dependencies stay in `requirements-docs.txt` — never in `go.mod`. ## Navigation @@ -38,24 +55,25 @@ generators later; until then browse these pages directly in the repository. | Production Checklist | [production-checklist/](production-checklist/) | | API Reference | [api-reference/](api-reference/) | | Examples | [examples/](examples/) | +| Problem guides | [problems/](problems/) | -## Site goals +## Deploy -- Strong hierarchy and side navigation (not a card wall) -- Security warnings call out fail-closed defaults -- Backend capability tables and failure scenarios -- Copyable Go examples and CLI snippets -- Migration notes from Phase 5 +GitHub Actions workflow [`.github/workflows/pages.yml`](../../.github/workflows/pages.yml) +builds on pushes to `main` that touch docs/site (and related paths) and on +`workflow_dispatch`. -See also: +**GitHub Pages source must be GitHub Actions** (Settings → Pages → Build and +deployment → Source: GitHub Actions). -- [Security model](../security-model.md) -- [Threat model](../threat-model.md) -- [Dependency discipline](../dependency-discipline.md) -- [Phase 6 audit](../audits/phase-6-audit.md) +## Branding -## Future tooling +Theme colors follow [brand guidelines](../../assets/brand/brand-guidelines.md) +(Lock Cyan `#27C2D1`, Transfer Blue `#2D72E8`, Deep Navy `#0A1830`). Logos under +`assets/` are copies of `assets/logo/` for MkDocs `docs_dir` constraints. + +See also: -Planned: search, version selector, and branded MkDocs Material theme using -`assets/logo/shiftlock-horizontal.svg`. Content stubs are authoritative until -the generator is wired. +- [Security model](https://github.com/theworker02/shiftlock/blob/main/docs/security-model.md) +- [Threat model](https://github.com/theworker02/shiftlock/blob/main/docs/threat-model.md) +- [Dependency discipline](https://github.com/theworker02/shiftlock/blob/main/docs/dependency-discipline.md) diff --git a/docs/site/api-reference/index.md b/docs/site/api-reference/index.md index bc47ff7..8e99e59 100644 --- a/docs/site/api-reference/index.md +++ b/docs/site/api-reference/index.md @@ -1,5 +1,17 @@ # API Reference -Primary module: [pkg.go.dev/github.com/theworker02/shiftlock](https://pkg.go.dev/github.com/theworker02/shiftlock) +Published Go docs: -Key packages: `capability`, `guard`, `audit`, `supervise`, `election`, `barrier`, `configlock`, `control/*`, `security/*`. +- **Module:** [pkg.go.dev/github.com/theworker02/shiftlock](https://pkg.go.dev/github.com/theworker02/shiftlock) +- **Repository:** [github.com/theworker02/shiftlock](https://github.com/theworker02/shiftlock) + +Key packages: + +| Area | Packages | +|------|----------| +| Core | root module (`New`, `Coordinator`, `NewRuntime`) | +| Security | `capability`, `guard`, `security/*`, `configlock` | +| Control plane | `audit`, `control/*`, `supervise`, `election`, `barrier` | +| Backends | `backend/memory`, `backend/postgres`, `backend/redis`, `backend/kubernetes` | + +Start with [Quick Start](../quick-start/index.md) for copy-paste examples. diff --git a/docs/site/assets/shiftlock-horizontal.svg b/docs/site/assets/shiftlock-horizontal.svg new file mode 100644 index 0000000..e81df1f --- /dev/null +++ b/docs/site/assets/shiftlock-horizontal.svg @@ -0,0 +1,22 @@ + + ShiftLock Horizontal + + + + + + + + + + + + + + + ShiftLock + RUNTIME CONTROL + diff --git a/docs/site/assets/shiftlock-mark.svg b/docs/site/assets/shiftlock-mark.svg new file mode 100644 index 0000000..3dc45ed --- /dev/null +++ b/docs/site/assets/shiftlock-mark.svg @@ -0,0 +1,20 @@ + + ShiftLock Mark + + + + + + + + + + + + + + + + + diff --git a/docs/site/assets/shiftlock-white.svg b/docs/site/assets/shiftlock-white.svg new file mode 100644 index 0000000..5b9dd27 --- /dev/null +++ b/docs/site/assets/shiftlock-white.svg @@ -0,0 +1,10 @@ + + ShiftLock White + + + + + + + diff --git a/docs/site/index.md b/docs/site/index.md index ff33268..9e0008c 100644 --- a/docs/site/index.md +++ b/docs/site/index.md @@ -1,12 +1,45 @@ -# ShiftLock Docs +# ShiftLock -ShiftLock is a **security-first runtime coordination and control module** for -production Go systems. It protects who may perform sensitive work, when that -work may run, and how responsibility moves safely between instances. +![ShiftLock](assets/shiftlock-horizontal.svg){: .sl-hero-logo } -Start with [Quick Start](quick-start/index.md), then [Concepts](concepts/index.md). +**Security-first runtime coordination and control for Go.** + +ShiftLock protects who may perform sensitive work, when that work may run, and +how responsibility moves safely between instances — without a hosted control +plane. + +

!!! warning "Opt-in security" Advanced control-plane features are **opt-in**. `shiftlock.New` / Coordinator APIs remain unchanged. Deny privileged operations by default when security subsystems are enabled. + +## What it is + +| It is | It is not | +|-------|-----------| +| Ownership handoff + fencing for Go processes | A hosted control plane | +| An opt-in runtime supervisor & security layer | A Kubernetes-only framework | +| A shared fabric around DBs, queues, APIs, files | A replacement for those systems | +| Importable as a normal Go module | A SaaS product | + +```bash +go get github.com/theworker02/shiftlock@latest +``` + +Module path: [`github.com/theworker02/shiftlock`](https://pkg.go.dev/github.com/theworker02/shiftlock). + +## Next steps + +1. [Introduction](introduction/index.md) — positioning and package layout +2. [Quick Start](quick-start/index.md) — install, run examples, first coordinator +3. [Concepts](concepts/index.md) — claims, fencing, capabilities, lockdown +4. [API Reference](api-reference/index.md) — packages on pkg.go.dev diff --git a/docs/site/introduction/index.md b/docs/site/introduction/index.md index 8189b3a..4755968 100644 --- a/docs/site/introduction/index.md +++ b/docs/site/introduction/index.md @@ -1,11 +1,39 @@ # Introduction -ShiftLock coordinates **ownership**, **fencing**, and (optionally) a **runtime control plane** for Go services. +ShiftLock is a **security-first runtime coordination and control module** for +production Go systems. It coordinates **ownership**, **fencing**, and (optionally) +a **runtime control plane** so sensitive work has a clear owner, a monotonic +fencing token, and a safe handoff path between instances. -It is not a hosted SaaS control plane, remote shell, or SIEM. Import it as a normal module: +It is not a hosted SaaS control plane, remote shell, or SIEM. Import it as a +normal module: ```go import "github.com/theworker02/shiftlock" ``` -Core stays lightweight (stdlib). Advanced packages live under `capability/`, `guard/`, `audit/`, `control/`, `supervise/`, `election/`, `security/`. +| | | +|---|---| +| **Module** | [`github.com/theworker02/shiftlock`](https://pkg.go.dev/github.com/theworker02/shiftlock) | +| **Repository** | [github.com/theworker02/shiftlock](https://github.com/theworker02/shiftlock) | +| **Package docs** | [pkg.go.dev](https://pkg.go.dev/github.com/theworker02/shiftlock) | + +## Design stance + +- **Core stays lightweight** — stdlib-first; no third-party requires in the root + `go.mod`. +- **Advanced packages are opt-in** — `capability/`, `guard/`, `audit/`, `control/`, + `supervise/`, `election/`, `security/`, and resource/workflow adapters. +- **Fail closed when enabled** — privileged operations default to deny once + security subsystems are turned on. +- **Coordinator APIs stay stable** — `shiftlock.New` and the Phase 5 Coordinator + surface remain unchanged when you adopt Phase 6 runtime features. + +## What ShiftLock decides + +Graceful shutdown stops an old process. ShiftLock decides who may perform +protected work next — with fencing tokens so a stale process cannot keep acting +after losing ownership — and optionally extends that model to supervisors, +workflows, databases, queues, and APIs. + +Continue with [Quick Start](../quick-start/index.md) or [Concepts](../concepts/index.md). diff --git a/docs/site/mkdocs.yml b/docs/site/mkdocs.yml index 140fb9f..52ee061 100644 --- a/docs/site/mkdocs.yml +++ b/docs/site/mkdocs.yml @@ -1,47 +1,116 @@ site_name: ShiftLock site_description: Security-first runtime coordination and control for Go +site_url: https://theworker02.github.io/shiftlock/ +site_author: theworker02 repo_url: https://github.com/theworker02/shiftlock +repo_name: theworker02/shiftlock +edit_uri: edit/main/docs/site/ +copyright: Copyright © ShiftLock contributors — Apache License 2.0 +docs_dir: . +site_dir: ../../site + theme: name: material - logo: ../../assets/logo/shiftlock-mark.svg - favicon: ../../assets/logo/shiftlock-mark.svg + logo: assets/shiftlock-white.svg + favicon: assets/shiftlock-mark.svg palette: - primary: teal - accent: cyan + - media: "(prefers-color-scheme: light)" + scheme: default + primary: custom + accent: custom + toggle: + icon: material/brightness-7 + name: Switch to dark mode + - media: "(prefers-color-scheme: dark)" + scheme: slate + primary: custom + accent: custom + toggle: + icon: material/brightness-4 + name: Switch to light mode + features: + - navigation.instant + - navigation.tracking + - navigation.sections + - navigation.expand + - navigation.top + - search.suggest + - search.highlight + - content.code.copy + - toc.follow + font: + text: Source Sans 3 + code: JetBrains Mono + nav: - Home: index.md - - Introduction: introduction/index.md - - Quick Start: quick-start/index.md - - Concepts: concepts/index.md - - Ownership: ownership/index.md - - Fencing: fencing/index.md - - Handoffs: handoffs/index.md - - Supervisor: supervisor/index.md - - Leader Election: leader-election/index.md - - Scheduling: scheduling/index.md - - Barriers: barriers/index.md - - Quorum: quorum/index.md - - Capabilities: capabilities/index.md - - Security Policies: security-policies/index.md - - Maintenance: maintenance/index.md - - Lockdown: lockdown/index.md - - Configuration: configuration/index.md - - Audit: audit/index.md - - Recovery: recovery/index.md - - Backends: backends/index.md - - Integrations: integrations/index.md - - Kubernetes: kubernetes/index.md - - systemd: systemd/index.md - - Windows: windows/index.md - - CLI: cli/index.md - - TUI: tui/index.md - - Operations: operations/index.md - - Threat Model: threat-model/index.md - - Security Hardening: security-hardening/index.md - - Production Checklist: production-checklist/index.md - - API Reference: api-reference/index.md - - Examples: examples/index.md + - Getting started: + - Introduction: introduction/index.md + - Quick Start: quick-start/index.md + - Concepts: concepts/index.md + - Core coordination: + - Ownership: ownership/index.md + - Fencing: fencing/index.md + - Handoffs: handoffs/index.md + - Runtime control: + - Supervisor: supervisor/index.md + - Leader Election: leader-election/index.md + - Scheduling: scheduling/index.md + - Barriers: barriers/index.md + - Quorum: quorum/index.md + - Capabilities: capabilities/index.md + - Security Policies: security-policies/index.md + - Maintenance: maintenance/index.md + - Lockdown: lockdown/index.md + - Configuration: configuration/index.md + - Audit: audit/index.md + - Recovery: recovery/index.md + - Platforms & tooling: + - Backends: backends/index.md + - Integrations: integrations/index.md + - Kubernetes: kubernetes/index.md + - systemd: systemd/index.md + - Windows: windows/index.md + - CLI: cli/index.md + - TUI: tui/index.md + - Operations: operations/index.md + - Security & production: + - Threat Model: threat-model/index.md + - Security Hardening: security-hardening/index.md + - Production Checklist: production-checklist/index.md + - Reference: + - API Reference: api-reference/index.md + - Examples: examples/index.md + - Problem guides: problems/index.md + +extra_css: + - stylesheets/extra.css + +extra: + social: + - icon: fontawesome/brands/github + link: https://github.com/theworker02/shiftlock + name: GitHub + - icon: fontawesome/brands/golang + link: https://pkg.go.dev/github.com/theworker02/shiftlock + name: Go package docs + +plugins: + - search + +# Repo-facing index; not part of the published nav tree. +exclude_docs: | + README.md + markdown_extensions: - admonition + - attr_list + - md_in_html + - pymdownx.details + - pymdownx.superfences + - pymdownx.highlight: + anchor_linenums: true + - pymdownx.inlinehilite + - tables - toc: permalink: true diff --git a/docs/site/operations/index.md b/docs/site/operations/index.md index ab1654f..ba0f158 100644 --- a/docs/site/operations/index.md +++ b/docs/site/operations/index.md @@ -1,3 +1,12 @@ # Operations -See `docs/operations.md` for runbooks. Production checklist: [production-checklist](../production-checklist/). +Operator runbooks and production guidance: + +- CLI: `go run ./cmd/shiftlock` and `go run ./cmd/shiftlock-inspect` +- Destructive recovery requires `--expected-owner`, `--expected-token`, `--reason`, and `--confirm` +- Prefer readiness reports and audit timelines over blind force-unlock + +Repository runbook: +[docs/operations.md](https://github.com/theworker02/shiftlock/blob/main/docs/operations.md). + +See also the [Production Checklist](../production-checklist/index.md). diff --git a/docs/site/problems/index.md b/docs/site/problems/index.md index 30725ab..d9f900e 100644 --- a/docs/site/problems/index.md +++ b/docs/site/problems/index.md @@ -1,14 +1,13 @@ # Problems -Operational problem guides for the resource fabric: +Operational problem guides for the resource fabric live in the repository under +[`docs/problems/`](https://github.com/theworker02/shiftlock/tree/main/docs/problems). -| Problem | Doc | -|---------|-----| -| Prevent two schedulers from running | [prevent-dual-schedulers](../../../problems/prevent-dual-schedulers.md) | -| Coordinate a database migration | [database-migration](../../../problems/database-migration.md) | -| Pause a queue during maintenance | [queue-pause](../../../problems/queue-pause.md) | -| Fail over to a backup API provider | [api-failover](../../../problems/api-failover.md) | -| Rebuild a cache without partial activation | [cache-rebuild](../../../problems/cache-rebuild.md) | -| Sync edge state after reconnect | [edge-sync](../../../problems/edge-sync.md) | - -Full index: [`docs/problems/`](../../../problems/index.md). +| Problem | Guide | +|---------|-------| +| Prevent two schedulers from running | [prevent-dual-schedulers](https://github.com/theworker02/shiftlock/blob/main/docs/problems/prevent-dual-schedulers.md) | +| Coordinate a database migration | [database-migration](https://github.com/theworker02/shiftlock/blob/main/docs/problems/database-migration.md) | +| Pause a queue during maintenance | [queue-pause](https://github.com/theworker02/shiftlock/blob/main/docs/problems/queue-pause.md) | +| Fail over to a backup API provider | [api-failover](https://github.com/theworker02/shiftlock/blob/main/docs/problems/api-failover.md) | +| Rebuild a cache without partial activation | [cache-rebuild](https://github.com/theworker02/shiftlock/blob/main/docs/problems/cache-rebuild.md) | +| Sync edge state after reconnect | [edge-sync](https://github.com/theworker02/shiftlock/blob/main/docs/problems/edge-sync.md) | diff --git a/docs/site/production-checklist/index.md b/docs/site/production-checklist/index.md index 0e6f23a..90e48ef 100644 --- a/docs/site/production-checklist/index.md +++ b/docs/site/production-checklist/index.md @@ -1,3 +1,13 @@ # Production Checklist -Canonical checklist: [docs/production-checklist.md](../../production-checklist.md). +Before running ShiftLock in production: + +- Pick a durable backend (PostgreSQL, Redis with AOF, or Kubernetes leases) — not memory +- Persist fencing tokens with every protected write +- Enable audit when using the opt-in runtime control plane +- Run `shiftlock security scan -production` in CI +- Prefer signed/config-locked configuration in production profiles +- Treat lockdown and maintenance as distinct: lockdown is fail-closed and stronger + +Canonical checklist in the repository: +[docs/production-checklist.md](https://github.com/theworker02/shiftlock/blob/main/docs/production-checklist.md). diff --git a/docs/site/quick-start/index.md b/docs/site/quick-start/index.md index b576143..49201e6 100644 --- a/docs/site/quick-start/index.md +++ b/docs/site/quick-start/index.md @@ -1,26 +1,79 @@ # Quick Start +Install the module and try the examples: + ```bash go get github.com/theworker02/shiftlock@latest + go run ./examples/singleton-worker +go run ./examples/runtime-supervisor go run ./examples/secure-control-plane ``` -Coordinator (Phase 5): +Full package reference: [pkg.go.dev/github.com/theworker02/shiftlock](https://pkg.go.dev/github.com/theworker02/shiftlock). +Source and releases: [github.com/theworker02/shiftlock](https://github.com/theworker02/shiftlock). + +## Coordinator (core) ```go -coord, err := shiftlock.New(shiftlock.Config{ - Service: "billing", InstanceID: "pod-a", Backend: memory.New(), LeaseTTL: 15 * time.Second, -}) +package main + +import ( + "context" + "time" + + "github.com/theworker02/shiftlock" + "github.com/theworker02/shiftlock/backend/memory" +) + +func main() { + be := memory.New() + defer be.Close() + + coord, err := shiftlock.New(shiftlock.Config{ + Service: "billing", + InstanceID: "pod-a", + Backend: be, + LeaseTTL: 15 * time.Second, + }) + if err != nil { + panic(err) + } + defer coord.Close() + + _ = coord.Run(context.Background(), shiftlock.Worker{ + Name: "billing-reconciler", + Run: func(ctx context.Context, ownership *shiftlock.Lease) error { + // Persist ownership.FencingToken() with every protected write. + <-ctx.Done() + return nil + }, + }) +} ``` -Runtime (Phase 6, opt-in): +## Runtime (opt-in) ```go rt, err := shiftlock.NewRuntime(shiftlock.RuntimeConfig{ - Config: shiftlock.Config{Service: "billing", InstanceID: "pod-a", Backend: be, LeaseTTL: 15 * time.Second}, - SecurityProfile: shiftlock.ProfileStandard, - EnableSupervisor: true, EnableAudit: true, EnableCapabilities: true, EnableLockdown: true, + Config: shiftlock.Config{ + Service: "billing", + InstanceID: "pod-a", + Backend: be, + LeaseTTL: 15 * time.Second, + }, + SecurityProfile: shiftlock.ProfileStandard, + EnableSupervisor: true, + EnableAudit: true, + EnableCapabilities: true, + EnableLockdown: true, }) +if err != nil { + panic(err) +} defer rt.Close() ``` + +Existing `shiftlock.New` / Coordinator APIs stay unchanged when you enable the +runtime. See [Concepts](../concepts/index.md) next, or jump to +[API Reference](../api-reference/index.md). diff --git a/docs/site/security-hardening/index.md b/docs/site/security-hardening/index.md index 75a9523..d519432 100644 --- a/docs/site/security-hardening/index.md +++ b/docs/site/security-hardening/index.md @@ -1,9 +1,13 @@ # Security Hardening -Canonical model: [docs/security-model.md](../../security-model.md). +Canonical model: +[docs/security-model.md](https://github.com/theworker02/shiftlock/blob/main/docs/security-model.md). -- Deny privileged by default +- Deny privileged operations by default when security subsystems are enabled - Require signed config in production - Bounded queues / anti-replay caches - No shell exec by default - Run `shiftlock security scan -production` in CI + +See also [Threat Model](../threat-model/index.md) and the +[Production Checklist](../production-checklist/index.md). diff --git a/docs/site/stylesheets/extra.css b/docs/site/stylesheets/extra.css new file mode 100644 index 0000000..da03041 --- /dev/null +++ b/docs/site/stylesheets/extra.css @@ -0,0 +1,73 @@ +/* ShiftLock brand palette — see assets/brand/brand-guidelines.md */ +:root, +[data-md-color-scheme="default"] { + --md-primary-fg-color: #0a1830; + --md-primary-fg-color--light: #1a2f4d; + --md-primary-fg-color--dark: #050c18; + --md-primary-bg-color: #f4fafc; + --md-primary-bg-color--light: #ffffff; + --md-accent-fg-color: #27c2d1; + --md-accent-fg-color--transparent: #27c2d133; + --md-accent-bg-color: #ffffff; + --md-default-bg-color: #f4fafc; + --md-typeset-a-color: #2d72e8; + --md-footer-bg-color: #0a1830; + --md-footer-bg-color--dark: #050c18; +} + +[data-md-color-scheme="slate"] { + --md-primary-fg-color: #0a1830; + --md-primary-fg-color--light: #1a2f4d; + --md-primary-fg-color--dark: #050c18; + --md-accent-fg-color: #27c2d1; + --md-accent-fg-color--transparent: #27c2d133; + --md-default-bg-color: #161b22; + --md-typeset-a-color: #27c2d1; + --md-footer-bg-color: #0a1830; +} + +.md-header { + background: linear-gradient(105deg, #0a1830 0%, #0a1830 55%, #1a2f4d 100%); +} + +.md-tabs { + background-color: #0a1830; +} + +.md-typeset h1 { + color: #0a1830; + font-weight: 700; +} + +[data-md-color-scheme="slate"] .md-typeset h1 { + color: #f4fafc; +} + +.md-typeset .admonition.warning, +.md-typeset details.warning { + border-color: #e5a93d; +} + +.md-typeset .warning > .admonition-title, +.md-typeset .warning > summary { + background-color: #e5a93d1a; +} + +.md-typeset .admonition.danger, +.md-typeset details.danger { + border-color: #d84a4a; +} + +.sl-hero-logo { + display: block; + max-width: 280px; + margin: 0.5rem 0 1.25rem; +} + +.sl-links { + display: flex; + flex-wrap: wrap; + gap: 0.75rem 1.25rem; + margin: 1rem 0 1.5rem; + font-weight: 600; +} diff --git a/docs/site/threat-model/index.md b/docs/site/threat-model/index.md index 827a238..7423613 100644 --- a/docs/site/threat-model/index.md +++ b/docs/site/threat-model/index.md @@ -1,5 +1,16 @@ -# Threat Model (site) +# Threat Model -Canonical document: [docs/threat-model.md](../../threat-model.md). +Canonical document: +[docs/threat-model.md](https://github.com/theworker02/shiftlock/blob/main/docs/threat-model.md). -Trust the backend store and deploying operator. Library callers are not cryptographically authenticated unless you bind principals via capabilities / mTLS at the application edge. +Trust the backend store and the deploying operator. Library callers are not +cryptographically authenticated unless you bind principals via capabilities or +mTLS at the application edge. + +ShiftLock focuses on: + +- Preventing stale owners from acting after losing a claim (fencing) +- Fail-closed privileged operations when security features are enabled +- Tamper-evident audit when the audit subsystem is opted in + +Continue with [Security Hardening](../security-hardening/index.md). diff --git a/requirements-docs.txt b/requirements-docs.txt new file mode 100644 index 0000000..b275e92 --- /dev/null +++ b/requirements-docs.txt @@ -0,0 +1,3 @@ +# Documentation site only — keep out of go.mod +mkdocs>=1.6,<2 +mkdocs-material>=9.5,<10