Implements novox/hq ADR 0109, 0110 and 0111 in the catalogue. package-registry becomes npm-package-registry throughout (ADR 0109): gitea provides and serves it, verdaccio provides it, the builder requires, binds and receives its secret under it. gitea's contributions file is grants/npm.json, so a second ecosystem's file has an obvious name beside it. gitea claims two mesh seats (ADR 0110): npm-package-registry, which it delivers, and git, which it now provides with what a clone URL is composed from — http on the forge's web port (ADR 0111). verdaccio provides npm-package-registry and claims nothing: it is the second provider the seat exists to make harmless, since a consumer now resolves to the seat's holder without a pin. No cargo or PyPI provision is added; ADR 0109 defers that. git mints no credential, so gitea's provisioner registers nothing for it — the mesh's own repositories are public, and a clone credential is undecided (ADR 0111). The provisioner still reads where its contributions land from $MESH_RECEIVES, and names no path itself. One variable carries one path, so a second registration in this module would need the mesh to say where each provision's file is; that is not possible yet and is not faked here. Verified: the controller's tests read this catalogue — every claim is a seat in the set, the forge holds both seats and serves what a clone URL needs, the builder requires what the npm seat delivers — and pass. Not verified here: a TypeScript build of gitea, whose dependencies resolve from the private registry.
234 lines
6.0 KiB
JSON
234 lines
6.0 KiB
JSON
{
|
|
"module": "gitea",
|
|
"version": "1",
|
|
"requires": [
|
|
"postgres-database",
|
|
"route",
|
|
"secret"
|
|
],
|
|
"contributes": {
|
|
"postgres-database": {
|
|
"name": "gitea"
|
|
},
|
|
"route": {
|
|
"label": "git",
|
|
"port": 3000
|
|
}
|
|
},
|
|
"binds": {
|
|
"postgres-database": "/var/lib/gitea/database.json",
|
|
"route": "/var/lib/gitea/route.json"
|
|
},
|
|
"secrets": {
|
|
"postgres-database": "/var/lib/gitea/database.secret",
|
|
"secret": {
|
|
"internal-token": "/var/lib/gitea/internal-token.secret",
|
|
"admin": "/var/lib/gitea/admin.secret"
|
|
}
|
|
},
|
|
"capabilities": [
|
|
"container-runtime"
|
|
],
|
|
"emits": [
|
|
"module.gitea.repo.created",
|
|
"module.gitea.issue.opened",
|
|
"module.gitea.pull.merged"
|
|
],
|
|
"listens": [
|
|
{
|
|
"port": 3000,
|
|
"protocol": "tcp",
|
|
"from": "mesh",
|
|
"why": "the forge, over http"
|
|
},
|
|
{
|
|
"port": 22,
|
|
"protocol": "tcp",
|
|
"from": "mesh",
|
|
"why": "git over ssh, gitea's own unmodified sshd. Published on the machine's own side at 222, the mesh's fixed public convention — not 22, which the machine's own daemon holds and a module does not take"
|
|
}
|
|
],
|
|
"serves": {
|
|
"npm-package-registry": {
|
|
"scheme": "http",
|
|
"port": 3000,
|
|
"npm-path": "/api/packages/novox/npm/"
|
|
},
|
|
"git": {
|
|
"scheme": "http",
|
|
"port": 3000
|
|
}
|
|
},
|
|
"receives": {
|
|
"npm-package-registry": "/var/lib/gitea/grants/npm.json"
|
|
},
|
|
"grants": {
|
|
"npm-package-registry": "/var/lib/gitea/grants"
|
|
},
|
|
"claims": [
|
|
{
|
|
"name": "npm-package-registry",
|
|
"scope": "mesh"
|
|
},
|
|
{
|
|
"name": "git",
|
|
"scope": "mesh"
|
|
}
|
|
],
|
|
"own-secrets": {
|
|
"broker": "/var/lib/mesh/gitea/broker"
|
|
},
|
|
"resources": [
|
|
{
|
|
"id": "mesh-state",
|
|
"type": "directory",
|
|
"path": "/var/lib/mesh/gitea",
|
|
"mode": "0700"
|
|
},
|
|
{
|
|
"id": "runtime-state",
|
|
"type": "directory",
|
|
"path": "/var/lib/mesh/gitea/state",
|
|
"mode": "0700"
|
|
},
|
|
{
|
|
"id": "state",
|
|
"type": "directory",
|
|
"path": "/var/lib/gitea",
|
|
"mode": "0700"
|
|
},
|
|
{
|
|
"id": "grants",
|
|
"type": "directory",
|
|
"path": "/var/lib/gitea/grants",
|
|
"mode": "0700"
|
|
},
|
|
{
|
|
"id": "server-env",
|
|
"type": "file",
|
|
"path": "/var/lib/gitea/server.env",
|
|
"mode": "0600",
|
|
"content": "GITEA__security__INTERNAL_TOKEN=${secret:internal-token}\nGITEA__database__DB_TYPE=postgres\nGITEA__database__HOST=${bound:postgres-database:at}:${bound:postgres-database:port}\nGITEA__database__NAME=${bound:postgres-database:as}\nGITEA__database__USER=${bound:postgres-database:as}\nGITEA__database__PASSWD=${secret:postgres-database}\n"
|
|
},
|
|
{
|
|
"id": "data",
|
|
"type": "directory",
|
|
"path": "/services/gitea/gitea",
|
|
"mode": "0700",
|
|
"owner": "1000:1000"
|
|
},
|
|
{
|
|
"id": "server",
|
|
"type": "container",
|
|
"name": "gitea",
|
|
"image": "gitea/gitea@sha256:87a67ee09d3ae0d1df5fda5dcda3e2a1f9236a45b0a59025d6e00e46adc43bef",
|
|
"env": {
|
|
"DB_TYPE": "postgres",
|
|
"USER_UID": "1000",
|
|
"USER_GID": "1000"
|
|
},
|
|
"env-file": [
|
|
"/var/lib/gitea/server.env"
|
|
],
|
|
"ports": [
|
|
"3000",
|
|
"222:22"
|
|
],
|
|
"volumes": [
|
|
"/services/gitea/gitea:/data"
|
|
],
|
|
"secrets-in-environment": "gitea honours GITEA__database__PASSWD__FILE and GITEA__security__INTERNAL_TOKEN__FILE; convertible, awaiting a bed that proves it"
|
|
},
|
|
{
|
|
"id": "admin-bootstrap",
|
|
"type": "container",
|
|
"name": "mesh-gitea-admin",
|
|
"image": "gitea/gitea@sha256:87a67ee09d3ae0d1df5fda5dcda3e2a1f9236a45b0a59025d6e00e46adc43bef",
|
|
"run-once": true,
|
|
"env": {
|
|
"USER_UID": "1000",
|
|
"USER_GID": "1000",
|
|
"MESH_GITEA_ADMIN_USER": "mesh-admin"
|
|
},
|
|
"env-file": [
|
|
"/var/lib/gitea/server.env"
|
|
],
|
|
"volumes": [
|
|
"/services/gitea/gitea:/data",
|
|
"/var/lib/gitea/admin.secret:/run/secrets/admin:ro"
|
|
],
|
|
"args": [
|
|
"/bin/sh",
|
|
"-c",
|
|
"su-exec git gitea admin user create --admin --username \"$MESH_GITEA_ADMIN_USER\" --email mesh-admin@localhost --password \"$(cat /run/secrets/admin)\" --must-change-password=false || true"
|
|
],
|
|
"secrets-in-environment": "gitea honours GITEA__database__PASSWD__FILE and GITEA__security__INTERNAL_TOKEN__FILE; convertible, awaiting a bed that proves it"
|
|
},
|
|
{
|
|
"id": "runtime-config",
|
|
"type": "file",
|
|
"path": "/var/lib/mesh/gitea/config.json",
|
|
"mode": "0600",
|
|
"content": "{}\n",
|
|
"merge": "json"
|
|
},
|
|
{
|
|
"id": "runtime",
|
|
"type": "container",
|
|
"name": "mesh-gitea",
|
|
"network": "host",
|
|
"volumes": [
|
|
"/var/lib/mesh/gitea/broker:/run/secrets/broker:ro",
|
|
"/var/lib/mesh/gitea/config.json:/run/config/config.json:ro",
|
|
"/var/lib/gitea/grants:/var/lib/gitea/grants:ro",
|
|
"/var/lib/gitea/admin.secret:/run/secrets/admin:ro",
|
|
"/var/lib/mesh/gitea/state:/run/state"
|
|
],
|
|
"env": {
|
|
"MESH_BROKER_FILE": "/run/secrets/broker",
|
|
"MESH_GITEA_URL": "http://127.0.0.1:${port:3000}",
|
|
"MESH_GITEA_CONFIG_FILE": "/run/config/config.json",
|
|
"MESH_GITEA_ADMIN_USER": "mesh-admin",
|
|
"MESH_GITEA_ADMIN_PASSWORD_FILE": "/run/secrets/admin",
|
|
"MESH_GITEA_STATE_DIR": "/run/state",
|
|
"MESH_RECEIVES": "/var/lib/gitea/grants/npm.json"
|
|
},
|
|
"artifact": "runtime",
|
|
"restart-on": [
|
|
"runtime-config"
|
|
]
|
|
}
|
|
],
|
|
"provides": [
|
|
{
|
|
"name": "npm-package-registry",
|
|
"scope": "mesh"
|
|
},
|
|
{
|
|
"name": "git",
|
|
"scope": "mesh"
|
|
}
|
|
],
|
|
"build": {
|
|
"on": [
|
|
{
|
|
"arg": "BUILD_BASE",
|
|
"module": "mesh-tools",
|
|
"artifact": "build"
|
|
},
|
|
{
|
|
"arg": "RUNTIME_BASE",
|
|
"module": "mesh-tools",
|
|
"artifact": "runtime"
|
|
}
|
|
],
|
|
"artifacts": [
|
|
{
|
|
"name": "runtime",
|
|
"kind": "image",
|
|
"from": "Dockerfile"
|
|
}
|
|
]
|
|
}
|
|
}
|