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": [
+114 -1
View File
@@ -6290,6 +6290,26 @@ export interface paths {
patch?: never;
trace?: never;
};
"/admin/jobs/{name}": {
parameters: {
query?: never;
header?: never;
path?: never;
cookie?: never;
};
get?: never;
/**
* Switch a background job on or off, or change its schedule
* @description **Who:** Admins only.
*/
put: operations["putAdminJobsName"];
post?: never;
delete?: never;
options?: never;
head?: never;
patch?: never;
trace?: never;
};
"/admin/jobs/{name}/run": {
parameters: {
query?: never;
@@ -35118,15 +35138,28 @@ export interface operations {
content: {
"application/json": {
data: {
/** @description on, off or timers */
/** @description queue, timers or off */
mode: string;
timezone: string;
/** @description JOBS_ENABLED in the .env */
jobsEnabledEnv: boolean;
jobs: ({
name: string;
label: string;
cron?: string | null;
enabled: boolean;
envFlag?: string | null;
/** @description What the .env says */
envEnabled: boolean;
envCron: string;
defaultCron: string;
/** @description What an admin chose over the .env (null: the .env applies) */
override: {
enabled: boolean | null;
cron?: string | null;
} & {
[key: string]: unknown;
};
nextRun?: string | null;
/** @description Recent runs */
recent: {
@@ -35161,6 +35194,86 @@ export interface operations {
};
};
};
putAdminJobsName: {
parameters: {
query?: never;
header?: never;
path: {
/** @description The name */
name: string;
};
cookie?: never;
};
requestBody: {
content: {
"application/json": {
/** @description true or false wins over the .env; null goes back to it */
enabled?: boolean | null;
/** @description A cron schedule (five fields) that wins over the .env; null or empty goes back to it */
cron?: string | null;
};
};
};
responses: {
/** @description OK */
200: {
headers: {
[name: string]: unknown;
};
content: {
"application/json": {
data: {
name: string;
override: {
enabled: boolean | null;
cron?: string | null;
} & {
[key: string]: unknown;
};
} & {
[key: string]: unknown;
};
};
};
};
/** @description Validation failed (VALIDATION_FAILED) */
400: {
headers: {
[name: string]: unknown;
};
content: {
"application/json": components["schemas"]["Error"];
};
};
/** @description Not signed in (UNAUTHENTICATED) */
401: {
headers: {
[name: string]: unknown;
};
content: {
"application/json": components["schemas"]["Error"];
};
};
/** @description Not allowed for this role (FORBIDDEN) */
403: {
headers: {
[name: string]: unknown;
};
content: {
"application/json": components["schemas"]["Error"];
};
};
/** @description Not found (NOT_FOUND) */
404: {
headers: {
[name: string]: unknown;
};
content: {
"application/json": components["schemas"]["Error"];
};
};
};
};
postAdminJobsNameRun: {
parameters: {
query?: never;