|
|
|
@@ -1,6 +1,7 @@
|
|
|
|
|
{
|
|
|
|
|
"module": "gitea",
|
|
|
|
|
"version": "1",
|
|
|
|
|
"moved": true,
|
|
|
|
|
"requires": [
|
|
|
|
|
"postgres-database",
|
|
|
|
|
"route",
|
|
|
|
@@ -42,11 +43,50 @@
|
|
|
|
|
"issue.opened",
|
|
|
|
|
"pull.merged",
|
|
|
|
|
"pull.updated",
|
|
|
|
|
"pull.closed"
|
|
|
|
|
"pull.closed",
|
|
|
|
|
"forge.push",
|
|
|
|
|
"forge.create",
|
|
|
|
|
"forge.delete",
|
|
|
|
|
"forge.fork",
|
|
|
|
|
"forge.status",
|
|
|
|
|
"forge.pull-request.opened",
|
|
|
|
|
"forge.pull-request.reopened",
|
|
|
|
|
"forge.pull-request.synchronized",
|
|
|
|
|
"forge.pull-request.edited",
|
|
|
|
|
"forge.pull-request.closed",
|
|
|
|
|
"forge.pull-request.merged",
|
|
|
|
|
"forge.pull-request.labeled",
|
|
|
|
|
"forge.pull-request.unlabeled",
|
|
|
|
|
"forge.pull-request.assigned",
|
|
|
|
|
"forge.pull-request.unassigned",
|
|
|
|
|
"forge.pull-request.reviewed",
|
|
|
|
|
"forge.pull-request.review-requested",
|
|
|
|
|
"forge.pull-request.commented",
|
|
|
|
|
"forge.pull-request.changed",
|
|
|
|
|
"forge.issue-comment.created",
|
|
|
|
|
"forge.issue-comment.edited",
|
|
|
|
|
"forge.issue-comment.deleted",
|
|
|
|
|
"forge.issues.opened",
|
|
|
|
|
"forge.issues.reopened",
|
|
|
|
|
"forge.issues.closed",
|
|
|
|
|
"forge.issues.edited",
|
|
|
|
|
"forge.issues.labeled",
|
|
|
|
|
"forge.issues.unlabeled",
|
|
|
|
|
"forge.issues.assigned",
|
|
|
|
|
"forge.issues.unassigned",
|
|
|
|
|
"forge.issues.changed",
|
|
|
|
|
"forge.release.published",
|
|
|
|
|
"forge.release.updated",
|
|
|
|
|
"forge.release.deleted",
|
|
|
|
|
"forge.release.changed",
|
|
|
|
|
"forge.repository.created",
|
|
|
|
|
"forge.repository.deleted",
|
|
|
|
|
"forge.repository.changed",
|
|
|
|
|
"forge.wiki.changed",
|
|
|
|
|
"forge.other"
|
|
|
|
|
],
|
|
|
|
|
"consumes": [
|
|
|
|
|
"mesh-controller.checked",
|
|
|
|
|
"node-build-agent.started"
|
|
|
|
|
"mesh-controller.checked"
|
|
|
|
|
],
|
|
|
|
|
"listens": [
|
|
|
|
|
{
|
|
|
|
@@ -61,14 +101,22 @@
|
|
|
|
|
"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 \u2014 not 22, which the machine's own daemon holds and a module does not take"
|
|
|
|
|
"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"
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
"name": "forge-events",
|
|
|
|
|
"port": 3047,
|
|
|
|
|
"protocol": "tcp",
|
|
|
|
|
"from": "machine",
|
|
|
|
|
"why": "the forge's system webhook, every event signed with a secret the module keeps, from the forge's container on the docker bridge to the module's receiver at the bridge's gateway 172.17.0.1 (novox/hq issue 729)"
|
|
|
|
|
}
|
|
|
|
|
],
|
|
|
|
|
"serves": {
|
|
|
|
|
"npm-package-registry": {
|
|
|
|
|
"scheme": "http",
|
|
|
|
|
"port": 3000,
|
|
|
|
|
"npm-path": "/api/packages/novox/npm/"
|
|
|
|
|
"npm-path": "/api/packages/novox/npm/",
|
|
|
|
|
"public-root": "https://${bound:route:name-web}/api/packages/novox/npm/"
|
|
|
|
|
},
|
|
|
|
|
"git": {
|
|
|
|
|
"scheme": "http",
|
|
|
|
@@ -108,46 +156,92 @@
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
"config": {
|
|
|
|
|
"url": {
|
|
|
|
|
"type": "string",
|
|
|
|
|
"description": "The address the module's tools reach the forge at, as a URL; unset, the code falls back to its environment, else this machine's gitea on its port.",
|
|
|
|
|
"trusted": true,
|
|
|
|
|
"default": ""
|
|
|
|
|
},
|
|
|
|
|
"agent-read-teams": {
|
|
|
|
|
"type": "object",
|
|
|
|
|
"description": "The read teams of the agents' forge accounts (ADR 0365 clause 3): each team by name, {\"<team>\": {\"repos\": [\"<owner>/<repo>\", ...], \"members\": [\"<node>\", ...]}}. The forge gets a team agent-read-<team> that reads only, with exactly those repositories and the accounts agent-<node>; a team taken out of the value is emptied. Nothing else on the forge is touched; an agent account is in no team until it is listed here.",
|
|
|
|
|
"trusted": true,
|
|
|
|
|
"default": {}
|
|
|
|
|
},
|
|
|
|
|
"repositories": {
|
|
|
|
|
"type": "object",
|
|
|
|
|
"description": "The repositories of the organisation novox the mesh holds (ADR 0428): each by name, {\"<name>\": {\"private\": true, \"description\": \"...\"}}. One that does not exist is made by the module's setup login under its own account, its main protected and given a first commit (a README naming the description), its rule narrowed to no push and the tools' merge requiring mesh/check, and only then moved into the organisation; one that exists only has main's rule put right, mesh/check in place of mesh/merge-gate and mesh/repo-check and its other statuses kept (a main requiring mesh/repo-check alone keeps it). Every other repository whose main requires mesh/merge-gate has the two swapped for mesh/check; nothing else of a repository out of the value is touched.",
|
|
|
|
|
"trusted": true,
|
|
|
|
|
"default": {}
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
"facts": {
|
|
|
|
|
"forge-host": {
|
|
|
|
|
"path": "/etc/gitea/forge-host",
|
|
|
|
|
"template": "{{range .Machines}}{{if eq .Name $.Node}}{{.FQDN}}{{end}}{{end}}\n"
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
"resources": [
|
|
|
|
|
{
|
|
|
|
|
"id": "mesh-state",
|
|
|
|
|
"type": "directory",
|
|
|
|
|
"mode": "0700",
|
|
|
|
|
"place": "mesh"
|
|
|
|
|
"place": "mesh",
|
|
|
|
|
"unknown": "program"
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
"id": "runtime-state",
|
|
|
|
|
"type": "directory",
|
|
|
|
|
"path": "${dir:mesh-state}/state",
|
|
|
|
|
"mode": "0700"
|
|
|
|
|
"mode": "0700",
|
|
|
|
|
"unknown": "program"
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
"id": "forge-patches",
|
|
|
|
|
"type": "directory",
|
|
|
|
|
"path": "/var/lib/mesh/forge-patches",
|
|
|
|
|
"mode": "0733",
|
|
|
|
|
"owner": "${machine:account}",
|
|
|
|
|
"unknown": "program"
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
"id": "state",
|
|
|
|
|
"type": "directory",
|
|
|
|
|
"mode": "0700",
|
|
|
|
|
"place": "."
|
|
|
|
|
"place": ".",
|
|
|
|
|
"unknown": "program"
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
"id": "grants",
|
|
|
|
|
"type": "directory",
|
|
|
|
|
"mode": "0700"
|
|
|
|
|
"mode": "0700",
|
|
|
|
|
"unknown": "program"
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
"id": "server-env",
|
|
|
|
|
"type": "file",
|
|
|
|
|
"path": "${dir:state}/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"
|
|
|
|
|
"template": "files/server.env"
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
"id": "data",
|
|
|
|
|
"type": "directory",
|
|
|
|
|
"mode": "0700",
|
|
|
|
|
"owner": "1000:1000"
|
|
|
|
|
"owner": "1000:1000",
|
|
|
|
|
"unknown": "program"
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
"id": "server",
|
|
|
|
|
"type": "container",
|
|
|
|
|
"health": {
|
|
|
|
|
"kind": "http",
|
|
|
|
|
"endpoint": "web",
|
|
|
|
|
"path": "/api/healthz",
|
|
|
|
|
"status": 200,
|
|
|
|
|
"needs": "postgres-database"
|
|
|
|
|
},
|
|
|
|
|
"name": "gitea",
|
|
|
|
|
"image": "gitea/gitea@sha256:87a67ee09d3ae0d1df5fda5dcda3e2a1f9236a45b0a59025d6e00e46adc43bef",
|
|
|
|
|
"env": {
|
|
|
|
@@ -193,13 +287,89 @@
|
|
|
|
|
],
|
|
|
|
|
"secrets-in-environment": "gitea honours GITEA__database__PASSWD__FILE and GITEA__security__INTERNAL_TOKEN__FILE; convertible, awaiting a bed that proves it"
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
"id": "origins",
|
|
|
|
|
"type": "file",
|
|
|
|
|
"path": "${dir:mesh-state}/origins",
|
|
|
|
|
"mode": "0644",
|
|
|
|
|
"template": "files/origins"
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
"id": "runtime-config",
|
|
|
|
|
"type": "file",
|
|
|
|
|
"path": "${dir:mesh-state}/config.json",
|
|
|
|
|
"mode": "0600",
|
|
|
|
|
"content": "{}\n",
|
|
|
|
|
"merge": "json"
|
|
|
|
|
"template": "files/config.json",
|
|
|
|
|
"merge": "json",
|
|
|
|
|
"takes-config": [
|
|
|
|
|
"url"
|
|
|
|
|
]
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
"id": "agent-teams-file",
|
|
|
|
|
"type": "file",
|
|
|
|
|
"path": "${dir:mesh-state}/agent-teams.json",
|
|
|
|
|
"mode": "0600",
|
|
|
|
|
"template": "files/agent-teams.json",
|
|
|
|
|
"merge": "json",
|
|
|
|
|
"takes-config": [
|
|
|
|
|
"agent-read-teams"
|
|
|
|
|
]
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
"id": "repositories-file",
|
|
|
|
|
"type": "file",
|
|
|
|
|
"path": "${dir:mesh-state}/repositories.json",
|
|
|
|
|
"mode": "0600",
|
|
|
|
|
"template": "files/repositories.json"
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
"id": "consumers",
|
|
|
|
|
"type": "file",
|
|
|
|
|
"path": "${dir:state}/consumers.json",
|
|
|
|
|
"mode": "0600",
|
|
|
|
|
"template": "files/consumers.json"
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
"id": "agent-teams",
|
|
|
|
|
"type": "process",
|
|
|
|
|
"name": "gitea-agent-teams",
|
|
|
|
|
"artifact": "agent-teams",
|
|
|
|
|
"run": [
|
|
|
|
|
"./agent-teams"
|
|
|
|
|
],
|
|
|
|
|
"run-once": true,
|
|
|
|
|
"env": {
|
|
|
|
|
"MESH_GITEA_URL": "http://127.0.0.1:${port:3000}",
|
|
|
|
|
"MESH_GITEA_ADMIN_USER": "mesh-admin",
|
|
|
|
|
"MESH_GITEA_ADMIN_PASSWORD_FILE": "${dir:state}/admin.secret",
|
|
|
|
|
"MESH_AGENT_TEAMS_FILE": "${dir:mesh-state}/agent-teams.json"
|
|
|
|
|
},
|
|
|
|
|
"restart-on": [
|
|
|
|
|
"agent-teams-file"
|
|
|
|
|
]
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
"id": "repositories",
|
|
|
|
|
"type": "process",
|
|
|
|
|
"name": "gitea-repositories",
|
|
|
|
|
"artifact": "repositories",
|
|
|
|
|
"run": [
|
|
|
|
|
"./repositories",
|
|
|
|
|
"sync"
|
|
|
|
|
],
|
|
|
|
|
"run-once": true,
|
|
|
|
|
"env": {
|
|
|
|
|
"MESH_GITEA_URL": "http://127.0.0.1:${port:3000}",
|
|
|
|
|
"MESH_GITEA_ADMIN_USER": "mesh-admin",
|
|
|
|
|
"MESH_GITEA_ADMIN_PASSWORD_FILE": "${dir:state}/admin.secret",
|
|
|
|
|
"MESH_GITEA_TOOLS_USER": "mesh-tools",
|
|
|
|
|
"MESH_REPOSITORIES_FILE": "${dir:mesh-state}/repositories.json",
|
|
|
|
|
"MESH_REPOSITORIES_OUTCOME": "${dir:runtime-state}/repositories-outcome.json"
|
|
|
|
|
},
|
|
|
|
|
"restart-on": [
|
|
|
|
|
"repositories-file"
|
|
|
|
|
]
|
|
|
|
|
}
|
|
|
|
|
],
|
|
|
|
|
"provides": [
|
|
|
|
@@ -214,6 +384,18 @@
|
|
|
|
|
{
|
|
|
|
|
"name": "git",
|
|
|
|
|
"scope": "mesh"
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
"name": "gitea-read",
|
|
|
|
|
"scope": "mesh",
|
|
|
|
|
"credential": {
|
|
|
|
|
"issued-by": "software",
|
|
|
|
|
"tool": "gitea_agent_token"
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
"name": "forge-account",
|
|
|
|
|
"scope": "mesh"
|
|
|
|
|
}
|
|
|
|
|
],
|
|
|
|
|
"build": {
|
|
|
|
@@ -237,8 +419,12 @@
|
|
|
|
|
"MESH_GITEA_CONFIG_FILE": "${dir:mesh-state}/config.json",
|
|
|
|
|
"MESH_GITEA_ADMIN_USER": "mesh-admin",
|
|
|
|
|
"MESH_GITEA_ADMIN_PASSWORD_FILE": "${dir:state}/admin.secret",
|
|
|
|
|
"MESH_GITEA_TOOLS_USER": "mesh-tools",
|
|
|
|
|
"MESH_GITEA_STATE_DIR": "${dir:runtime-state}",
|
|
|
|
|
"MESH_RECEIVES": "${dir:grants}/npm.json"
|
|
|
|
|
"MESH_RECEIVES": "${dir:grants}/npm.json",
|
|
|
|
|
"MESH_GITEA_HOOK_URL": "http://172.17.0.1:3047",
|
|
|
|
|
"MESH_GITEA_HOOK_PORT": "3047",
|
|
|
|
|
"MESH_GITEA_HOOK_HOST": "172.17.0.1"
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
@@ -268,10 +454,74 @@
|
|
|
|
|
"loads": [
|
|
|
|
|
"forge"
|
|
|
|
|
],
|
|
|
|
|
"env": {
|
|
|
|
|
"MESH_GITEA_URL": "http://127.0.0.1:${port:3000}",
|
|
|
|
|
"MESH_GITEA_TOOLS_USER": "mesh-tools",
|
|
|
|
|
"MESH_GITEA_TOKEN_FILE": "${dir:runtime-state}/token",
|
|
|
|
|
"MESH_GITEA_PATCH_DIR": "${dir:forge-patches}"
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
"name": "files",
|
|
|
|
|
"kind": "archive",
|
|
|
|
|
"from": "files"
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
"name": "agent-token",
|
|
|
|
|
"kind": "bundle",
|
|
|
|
|
"language": "go",
|
|
|
|
|
"system": "arch",
|
|
|
|
|
"from": "cmd/agent-token",
|
|
|
|
|
"binary": "agent-token",
|
|
|
|
|
"loads": [
|
|
|
|
|
"agent-token"
|
|
|
|
|
],
|
|
|
|
|
"env": {
|
|
|
|
|
"MESH_GITEA_URL": "http://127.0.0.1:${port:3000}",
|
|
|
|
|
"MESH_GITEA_ADMIN_USER": "mesh-admin",
|
|
|
|
|
"MESH_GITEA_ADMIN_PASSWORD_FILE": "${dir:state}/admin.secret"
|
|
|
|
|
"MESH_GITEA_ADMIN_PASSWORD_FILE": "${dir:state}/admin.secret",
|
|
|
|
|
"MESH_GITEA_ORIGINS_FILE": "${dir:mesh-state}/origins"
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
"name": "agent-teams",
|
|
|
|
|
"kind": "bundle",
|
|
|
|
|
"language": "go",
|
|
|
|
|
"system": "arch",
|
|
|
|
|
"from": "cmd/agent-teams",
|
|
|
|
|
"binary": "agent-teams",
|
|
|
|
|
"loads": [
|
|
|
|
|
"agent-teams"
|
|
|
|
|
]
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
"name": "repositories",
|
|
|
|
|
"kind": "bundle",
|
|
|
|
|
"language": "go",
|
|
|
|
|
"system": "arch",
|
|
|
|
|
"from": "cmd/repositories",
|
|
|
|
|
"binary": "repositories",
|
|
|
|
|
"loads": [
|
|
|
|
|
"repositories"
|
|
|
|
|
]
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
"name": "forge-account-provider",
|
|
|
|
|
"kind": "bundle",
|
|
|
|
|
"language": "go",
|
|
|
|
|
"system": "arch",
|
|
|
|
|
"from": "cmd/forge-account-provider",
|
|
|
|
|
"binary": "forge-account-provider",
|
|
|
|
|
"loads": [
|
|
|
|
|
"forge-account-provider"
|
|
|
|
|
],
|
|
|
|
|
"env": {
|
|
|
|
|
"MESH_GITEA_URL": "http://127.0.0.1:${port:3000}",
|
|
|
|
|
"MESH_GITEA_ADMIN_USER": "mesh-admin",
|
|
|
|
|
"MESH_GITEA_ADMIN_PASSWORD_FILE": "${dir:state}/admin.secret",
|
|
|
|
|
"MESH_GITEA_ORIGINS_FILE": "${dir:mesh-state}/origins",
|
|
|
|
|
"MESH_GITEA_SSH_PORT": "222",
|
|
|
|
|
"MESH_FORGE_HOST_FILE": "/etc/gitea/forge-host"
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
]
|
|
|
|
@@ -282,5 +532,17 @@
|
|
|
|
|
"failregex": "^.*Failed authentication attempt for .* from <HOST>(?::\\d+)?\\s*$\n ^.*Invalid user .* from <HOST> port \\d+\\s*$\n ^.*User \\S+ from <HOST> not allowed because .*$",
|
|
|
|
|
"jail": "backend = systemd\njournalmatch = CONTAINER_NAME=gitea\nport = http,https,222\nmaxretry = 3\nfindtime = 1d\nbantime = 1d"
|
|
|
|
|
}
|
|
|
|
|
],
|
|
|
|
|
"state": [
|
|
|
|
|
"bound",
|
|
|
|
|
"announced"
|
|
|
|
|
],
|
|
|
|
|
"reads": [
|
|
|
|
|
"mesh-controller.assignments",
|
|
|
|
|
"ssh-client.keys",
|
|
|
|
|
"mesh-build-go.keys",
|
|
|
|
|
"mesh-build-node.keys",
|
|
|
|
|
"mesh-build-image.keys",
|
|
|
|
|
"mesh-delivery-checker.owed"
|
|
|
|
|
]
|
|
|
|
|
}
|
|
|
|
|