Events 3.4.0, Accounts 1.4.0, contracts 1.12.0, agent 1.3.0: jobs from the dashboard, styled Accounts emails, .env from the Hub

- Events and Accounts: Background jobs are switched on or off and rescheduled from the admin;
  the choice is kept in the database (job_overrides), wins over the .env and applies at once.
  Accounts gets an Admin -> Background jobs page and per-job env flags, as Events.
- Accounts: every email styled as Cross Events' (church colour, logo, button, footer), same
  plain text (src/lib/emails.ts).
- Contracts 1.12.0: env-read / env-set agent jobs, envReadResultSchema, isSecretEnvName.
- crosscode script: `crosscode env <church> <product>` reads the .env (secrets hidden) and, with
  --set/--unset/--restart, changes one file, rebuilds the frontend when its file changed, reloads,
  and puts the file back if the site doesn't answer (lib/envedit.cjs, tests/envedit.bats).
- Agent 1.3.0: runs env-read and env-set.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-20 12:14:02 +02:00
co-authored by Claude Opus 5.5
parent a85347bff8
commit bbcafe61b9
43 changed files with 2276 additions and 131 deletions
@@ -61198,11 +61198,15 @@
"properties": {
"mode": {
"type": "string",
"description": "on, off or timers"
"description": "queue, timers or off"
},
"timezone": {
"type": "string"
},
"jobsEnabledEnv": {
"type": "boolean",
"description": "JOBS_ENABLED in the .env"
},
"jobs": {
"type": "array",
"items": {
@@ -61229,6 +61233,38 @@
"null"
]
},
"envEnabled": {
"type": "boolean",
"description": "What the .env says"
},
"envCron": {
"type": "string"
},
"defaultCron": {
"type": "string"
},
"override": {
"type": "object",
"properties": {
"enabled": {
"type": [
"boolean",
"null"
]
},
"cron": {
"type": [
"string",
"null"
]
}
},
"required": [
"enabled"
],
"additionalProperties": {},
"description": "What an admin chose over the .env (null: the .env applies)"
},
"nextRun": {
"anyOf": [
{
@@ -61254,6 +61290,10 @@
"name",
"label",
"enabled",
"envEnabled",
"envCron",
"defaultCron",
"override",
"recent"
],
"additionalProperties": {}
@@ -61263,6 +61303,7 @@
"required": [
"mode",
"timezone",
"jobsEnabledEnv",
"jobs"
],
"additionalProperties": {}
@@ -61299,6 +61340,157 @@
}
}
},
"/admin/jobs/{name}": {
"put": {
"tags": [
"Admin"
],
"summary": "Switch a background job on or off, or change its schedule",
"description": "**Who:** Admins only.",
"operationId": "putAdminJobsName",
"security": [
{
"bearerAuth": []
}
],
"parameters": [
{
"name": "name",
"in": "path",
"required": true,
"description": "The name",
"schema": {
"type": "string",
"minLength": 1,
"maxLength": 100
}
}
],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"enabled": {
"description": "true or false wins over the .env; null goes back to it",
"type": [
"boolean",
"null"
]
},
"cron": {
"description": "A cron schedule (five fields) that wins over the .env; null or empty goes back to it",
"anyOf": [
{
"type": "string",
"maxLength": 100
},
{
"type": "null"
}
]
}
}
}
}
}
},
"responses": {
"200": {
"description": "OK",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"type": "object",
"properties": {
"name": {
"type": "string"
},
"override": {
"type": "object",
"properties": {
"enabled": {
"type": [
"boolean",
"null"
]
},
"cron": {
"type": [
"string",
"null"
]
}
},
"required": [
"enabled"
],
"additionalProperties": {}
}
},
"required": [
"name",
"override"
],
"additionalProperties": {}
}
},
"required": [
"data"
],
"additionalProperties": false
}
}
}
},
"400": {
"description": "Validation failed (VALIDATION_FAILED)",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"401": {
"description": "Not signed in (UNAUTHENTICATED)",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"403": {
"description": "Not allowed for this role (FORBIDDEN)",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"404": {
"description": "Not found (NOT_FOUND)",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
}
}
}
},
"/admin/jobs/{name}/run": {
"post": {
"tags": [