- Go 98.4%
- Python 1.2%
- Shell 0.4%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
|
|
||
| .forgejo | ||
| apps | ||
| ci | ||
| cmd/yawn | ||
| core | ||
| deploy | ||
| fleet | ||
| forgejo | ||
| internal/install | ||
| oidc | ||
| pipeline | ||
| proxmox | ||
| route | ||
| wiki | ||
| workflow | ||
| workload | ||
| xyops | ||
| .gitignore | ||
| CHANGELOG.md | ||
| go.mod | ||
| LICENSE | ||
| README.md | ||
| release.json | ||
| VERSION | ||
| yawn.json | ||
john/cdk
A small, strongly typed Go kit for infrastructure as code, in the style of the
AWS CDK. Programs build an App of Stacks of Resources; Synth
writes plain OpenTofu configuration to .yawn/. OpenTofu still does all
planning, applying and state.
- Library, not a service. Repositories depend on this module and own their programs. john/arch runs them in CD.
.yawn/is built in CI only. It is gitignored and never committed.- Standard library only. No third-party Go dependencies.
- Deterministic. The same program always writes the same bytes.
- Nothing left to defaults. Constructs write every setting explicitly.
Usage guidance lives in the wiki. This repository does not maintain standalone example applications; consumers own their stack programs.
Packages
| Package | Provides |
|---|---|
core |
App, Stack, Resource, Provider, Synth, manifest.json, enforced state encryption, S3Backend, attached data documents |
forgejo |
NewRepository, Protect, Provider (pinned svalabs/forgejo 1.7.0), UnreadSettings |
proxmox |
Proxmox VE LXC containers (bpg/proxmox 0.122.0): import or create, destroy refused, Container.Fleet() identity |
fleet |
Which Proxmox container runs which service (fleet.json), identity checks and drift reports for push deploys |
xyops |
xyOps objects (john/xyops 0.1.2-dev.9): NewEvent, NewPlugin (custom Event Plugins), NewSecret (records and grants, never values), CheckInlineScripts, plan ID guard |
workflow |
Native xyOps workflows: NewXyopsWorkflow (validated graph) and NewPipeline (plan → changes? → approval → deploy, run queue; Task or PluginTask steps) (design) |
oidc |
Verifies Forgejo Actions ID tokens (RS256, JWKS, claim policy, replay guard) |
ci |
Generated Forgejo workflows from yawn.json, the task runner, and xyOps requests (guide) |
cmd/yawn |
run, tasks, ci, request, digest, version, providers, oidc-verify, fleet-check, fleet-diff, plan-guard, app-verify, bootstrap |
yawn release binaries (linux amd64/arm64, static) and their SHA256SUMS are
attached to every release from 0.3.0-dev.21; generated workflows install them
by checksum.
Design: deploy control plane, also published to the repository wiki on each release.
.yawn/ layout
.yawn/
manifest.json # typed, data-only summary (stacks, providers, resources, imports, notes)
<stack>/main.tf.json # the stack's OpenTofu configuration
<stack>/encryption.tf # enforced client-side encryption of state and plans
<stack>/.terraform.lock.hcl # provider hashes from the release pins
fleet.json # optional attached document: the declared fleet
manifest.json is data only, so a consumer such as john/arch can read it
without running repository code. Its manifest_version is 1; consumers must
refuse versions they do not understand.
Safety rules
- Repositories are never deleted.
prevent_destroyis set, and a forced destroy archives the repository instead. - No hidden defaults. Every writable provider attribute is either written or listed as creation-only. A test compares the constructs against the provider's schema, so a provider upgrade that adds a setting fails the build until the construct handles it.
- Mandatory choices. Visibility must be chosen, and a protected branch must have at least one required check.
- Exact provider pins. Exact versions, HTTPS release URLs, and SHA-256 plus
OpenTofu
h1hashes.yawn providerschecks both hashes, and the generated lock file makes OpenTofu check them again. - No secrets in output or state. Credentials come from the environment
(
FORGEJO_API_TOKEN,AWS_ACCESS_KEY_ID/AWS_SECRET_ACCESS_KEY,TF_VAR_*). Literal values for token, password or secret settings are refused, and the state passphrase must be an ephemeral variable so it never reaches a plan. - Unread settings are explicit. svalabs/forgejo does not read some
repository settings back, so UI changes to them are invisible to plans;
forgejo.UnreadSettingslists them for a separate drift check. - Atomic synth. A failed synth leaves the previous
.yawn/untouched.
Development
Go 1.27.4 and OpenTofu 1.13.9 are pinned in .forgejo/scripts/tools.py.
.forgejo/scripts/check.sh TOOLS runs gofmt, module verification, vet, tests
(including synthesis, schema and runtime coverage), and govulncheck.
Consumer repositories validate their actual synthesized stacks with OpenTofu;
this repository no longer runs example-based provider integration validation.
Update golden files with go test ./core -update and review the diff.
History
v0.2.0-dev.1 targeted Gitea through a fork of its provider and Gitea's state
registry. Forgejo has neither, so 0.3.0 moves to svalabs/forgejo and S3 state;
the gitea package is removed.
Up to v0.1.0-dev.1 this repository held HCL modules (Caddy edge, SSO,
oauth2-proxy, Peekaping status sites). They had no consumers and are retired
from main; the tag keeps them.
Releases
Versioned with john/release: change
VERSION and CHANGELOG.md in a PR, and merging tags the commit. Consumers pin
a tag in go.mod.