openmates 0.14.5-alpha.0 → 0.14.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -9526,9 +9526,9 @@ function formatTs(ts) {
|
|
|
9526
9526
|
}
|
|
9527
9527
|
|
|
9528
9528
|
// src/server.ts
|
|
9529
|
-
import { execFileSync as execFileSync2, execSync, spawn as nodeSpawn } from "child_process";
|
|
9529
|
+
import { execFileSync as execFileSync2, execSync, spawn as nodeSpawn, spawnSync } from "child_process";
|
|
9530
9530
|
import { createHash as createHash6, randomBytes as randomBytes2 } from "crypto";
|
|
9531
|
-
import { chmodSync as chmodSync2, copyFileSync, cpSync, existsSync as existsSync5, mkdirSync as mkdirSync3, mkdtempSync, readFileSync as readFileSync5, readdirSync, rmSync as rmSync3, writeFileSync as writeFileSync3 } from "fs";
|
|
9531
|
+
import { chmodSync as chmodSync2, closeSync, copyFileSync, cpSync, existsSync as existsSync5, mkdirSync as mkdirSync3, mkdtempSync, openSync, readFileSync as readFileSync5, readdirSync, rmSync as rmSync3, writeFileSync as writeFileSync3 } from "fs";
|
|
9532
9532
|
import { createInterface as createInterface2 } from "readline";
|
|
9533
9533
|
import { createInterface as createPromptInterface } from "readline/promises";
|
|
9534
9534
|
import { homedir as homedir5 } from "os";
|
|
@@ -9652,7 +9652,7 @@ function planUpdate(input) {
|
|
|
9652
9652
|
const missingRequiredSecrets = input.missingRequiredSecrets ?? [];
|
|
9653
9653
|
const blocked = input.continuous === true && missingRequiredSecrets.length > 0;
|
|
9654
9654
|
const steps = ["preflight"];
|
|
9655
|
-
const backupName = runtime.dataBearing && input.skipBackup !== true ? `latest-pre-update-${runtime.role}.tar.
|
|
9655
|
+
const backupName = runtime.dataBearing && input.skipBackup !== true ? `latest-pre-update-${runtime.role}.tar.gz` : null;
|
|
9656
9656
|
if (backupName) steps.push("backup:latest-pre-update");
|
|
9657
9657
|
steps.push("pull", "up", "health-check");
|
|
9658
9658
|
return {
|
|
@@ -10573,14 +10573,19 @@ function createServerBackup(installPath, role, options = {}) {
|
|
|
10573
10573
|
if (role === "core") {
|
|
10574
10574
|
const databaseUser = env.DATABASE_USERNAME || "directus";
|
|
10575
10575
|
const databaseName = env.DATABASE_NAME || "directus";
|
|
10576
|
+
const dumpFile = openSync(join3(tempDir, "postgres.sql"), "w");
|
|
10576
10577
|
try {
|
|
10577
|
-
const
|
|
10578
|
-
|
|
10579
|
-
|
|
10578
|
+
const result = spawnSync(
|
|
10579
|
+
"docker",
|
|
10580
|
+
["exec", "cms-database", "pg_dump", "--clean", "--if-exists", "--no-owner", "--no-privileges", "-U", databaseUser, databaseName],
|
|
10581
|
+
{ encoding: "utf-8", stdio: ["ignore", dumpFile, "pipe"] }
|
|
10580
10582
|
);
|
|
10581
|
-
|
|
10583
|
+
if (result.error) throw result.error;
|
|
10584
|
+
if (result.status !== 0) throw new Error(result.stderr || `pg_dump exited with status ${result.status}`);
|
|
10582
10585
|
} catch (error) {
|
|
10583
10586
|
throw new Error(`Postgres backup failed. Is cms-database running? ${error instanceof Error ? error.message : String(error)}`);
|
|
10587
|
+
} finally {
|
|
10588
|
+
closeSync(dumpFile);
|
|
10584
10589
|
}
|
|
10585
10590
|
}
|
|
10586
10591
|
for (const item of [
|
|
@@ -47722,7 +47727,7 @@ function assertRemoteAccessSourceRecord(value, index) {
|
|
|
47722
47727
|
}
|
|
47723
47728
|
|
|
47724
47729
|
// src/selfUpdate.ts
|
|
47725
|
-
import { spawnSync } from "child_process";
|
|
47730
|
+
import { spawnSync as spawnSync2 } from "child_process";
|
|
47726
47731
|
import { readFileSync as readFileSync8 } from "fs";
|
|
47727
47732
|
var PACKAGE_NAME = "openmates";
|
|
47728
47733
|
var DEFAULT_TARGET = "latest";
|
|
@@ -47751,7 +47756,7 @@ function buildSelfUpdatePlan(flags) {
|
|
|
47751
47756
|
}
|
|
47752
47757
|
function runSelfUpdate(plan) {
|
|
47753
47758
|
if (plan.dryRun) return;
|
|
47754
|
-
const result =
|
|
47759
|
+
const result = spawnSync2(plan.command, plan.args, {
|
|
47755
47760
|
encoding: "utf-8",
|
|
47756
47761
|
stdio: ["ignore", "pipe", "pipe"]
|
|
47757
47762
|
});
|
package/dist/cli.js
CHANGED
package/dist/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,5 +1,37 @@
|
|
|
1
1
|
name: openmates-core
|
|
2
2
|
|
|
3
|
+
x-openmates-worker-base: &openmates-worker-base
|
|
4
|
+
image: ${OPENMATES_IMAGE_REGISTRY:-ghcr.io/glowingkitty}/openmates-api:${OPENMATES_IMAGE_TAG:-dev}
|
|
5
|
+
restart: unless-stopped
|
|
6
|
+
user: root
|
|
7
|
+
env_file: ../../.env
|
|
8
|
+
environment: &openmates-worker-env
|
|
9
|
+
PYTHONPATH: /app
|
|
10
|
+
PYTHONDONTWRITEBYTECODE: "1"
|
|
11
|
+
CMS_URL: http://cms:8055
|
|
12
|
+
DIRECTUS_TOKEN: ${DIRECTUS_TOKEN}
|
|
13
|
+
DRAGONFLY_URL: cache:6379
|
|
14
|
+
DRAGONFLY_PASSWORD: ${DRAGONFLY_PASSWORD}
|
|
15
|
+
VAULT_URL: http://vault:8200
|
|
16
|
+
PROVIDER_CONFIG_DIR: /app_config/providers
|
|
17
|
+
BACKEND_CONFIG_FILE: /app_config/backend_config.yml
|
|
18
|
+
LOG_LEVEL: ${LOG_LEVEL:-info}
|
|
19
|
+
SERVER_ENVIRONMENT: ${SERVER_ENVIRONMENT}
|
|
20
|
+
volumes:
|
|
21
|
+
- ../../config:/app_config
|
|
22
|
+
- vault-setup-data:/vault-data
|
|
23
|
+
- api-logs:/app/logs
|
|
24
|
+
networks: [openmates]
|
|
25
|
+
depends_on:
|
|
26
|
+
cache:
|
|
27
|
+
condition: service_healthy
|
|
28
|
+
cms:
|
|
29
|
+
condition: service_healthy
|
|
30
|
+
vault-setup:
|
|
31
|
+
condition: service_completed_successfully
|
|
32
|
+
cms-setup:
|
|
33
|
+
condition: service_completed_successfully
|
|
34
|
+
|
|
3
35
|
services:
|
|
4
36
|
api:
|
|
5
37
|
image: ${OPENMATES_IMAGE_REGISTRY:-ghcr.io/glowingkitty}/openmates-api:${OPENMATES_IMAGE_TAG:-dev}
|
|
@@ -168,6 +200,84 @@ services:
|
|
|
168
200
|
networks: [openmates]
|
|
169
201
|
depends_on: [api]
|
|
170
202
|
|
|
203
|
+
app-ai-worker:
|
|
204
|
+
<<: *openmates-worker-base
|
|
205
|
+
container_name: app-ai-worker
|
|
206
|
+
environment:
|
|
207
|
+
<<: *openmates-worker-env
|
|
208
|
+
CELERY_QUEUES: app_ai
|
|
209
|
+
CELERY_AUTOSCALE_MAX: ${CELERY_AUTOSCALE_MAX:-10}
|
|
210
|
+
command: >
|
|
211
|
+
sh -c "chown -R celeryuser:celeryuser /vault-data && gosu celeryuser python -m celery -A backend.core.api.app.tasks.celery_config worker --loglevel=info --queues=app_ai --concurrency=$${CELERY_AUTOSCALE_MAX} --max-tasks-per-child=50 --max-memory-per-child=600000 --prefetch-multiplier=1"
|
|
212
|
+
|
|
213
|
+
app-images-worker:
|
|
214
|
+
<<: *openmates-worker-base
|
|
215
|
+
container_name: app-images-worker
|
|
216
|
+
environment:
|
|
217
|
+
<<: *openmates-worker-env
|
|
218
|
+
CELERY_QUEUES: app_images
|
|
219
|
+
CELERY_AUTOSCALE_MAX: ${CELERY_AUTOSCALE_MAX:-10}
|
|
220
|
+
command: >
|
|
221
|
+
sh -c "chown -R celeryuser:celeryuser /vault-data && gosu celeryuser python -m celery -A backend.core.api.app.tasks.celery_config worker --loglevel=info --queues=app_images --concurrency=$${CELERY_AUTOSCALE_MAX} --max-tasks-per-child=50 --max-memory-per-child=600000 --prefetch-multiplier=1"
|
|
222
|
+
|
|
223
|
+
app-music-worker:
|
|
224
|
+
<<: *openmates-worker-base
|
|
225
|
+
container_name: app-music-worker
|
|
226
|
+
environment:
|
|
227
|
+
<<: *openmates-worker-env
|
|
228
|
+
CELERY_QUEUES: app_music
|
|
229
|
+
CELERY_AUTOSCALE_MAX: ${CELERY_AUTOSCALE_MAX:-5}
|
|
230
|
+
command: >
|
|
231
|
+
sh -c "chown -R celeryuser:celeryuser /vault-data && gosu celeryuser python -m celery -A backend.core.api.app.tasks.celery_config worker --loglevel=info --queues=app_music --concurrency=$${CELERY_AUTOSCALE_MAX} --max-tasks-per-child=20 --max-memory-per-child=600000 --prefetch-multiplier=1"
|
|
232
|
+
|
|
233
|
+
app-videos-worker:
|
|
234
|
+
<<: *openmates-worker-base
|
|
235
|
+
container_name: app-videos-worker
|
|
236
|
+
environment:
|
|
237
|
+
<<: *openmates-worker-env
|
|
238
|
+
CELERY_QUEUES: app_videos
|
|
239
|
+
CELERY_VIDEOS_AUTOSCALE_MAX: ${CELERY_VIDEOS_AUTOSCALE_MAX:-2}
|
|
240
|
+
E2B_REMOTION_TEMPLATE: ${E2B_REMOTION_TEMPLATE:-}
|
|
241
|
+
command: >
|
|
242
|
+
sh -c "chown -R celeryuser:celeryuser /vault-data && gosu celeryuser python -m celery -A backend.core.api.app.tasks.celery_config worker --loglevel=info --queues=app_videos --concurrency=$${CELERY_VIDEOS_AUTOSCALE_MAX} --max-tasks-per-child=10 --max-memory-per-child=1000000 --prefetch-multiplier=1"
|
|
243
|
+
|
|
244
|
+
app-pdf-worker:
|
|
245
|
+
<<: *openmates-worker-base
|
|
246
|
+
container_name: app-pdf-worker
|
|
247
|
+
environment:
|
|
248
|
+
<<: *openmates-worker-env
|
|
249
|
+
CELERY_QUEUES: app_pdf
|
|
250
|
+
command: >
|
|
251
|
+
sh -c "chown -R celeryuser:celeryuser /vault-data && gosu celeryuser python -m celery -A backend.core.api.app.tasks.celery_config worker --loglevel=info --queues=app_pdf --concurrency=2 --max-tasks-per-child=10 --max-memory-per-child=1000000 --prefetch-multiplier=1"
|
|
252
|
+
|
|
253
|
+
app-docs-worker:
|
|
254
|
+
<<: *openmates-worker-base
|
|
255
|
+
image: ${OPENMATES_IMAGE_REGISTRY:-ghcr.io/glowingkitty}/openmates-docs-worker:${OPENMATES_IMAGE_TAG:-dev}
|
|
256
|
+
container_name: app-docs-worker
|
|
257
|
+
environment:
|
|
258
|
+
<<: *openmates-worker-env
|
|
259
|
+
CELERY_QUEUES: app_docs
|
|
260
|
+
command: >
|
|
261
|
+
sh -c "chown -R celeryuser:celeryuser /vault-data && gosu celeryuser python -m celery -A backend.core.api.app.tasks.celery_config worker --loglevel=info --queues=app_docs --concurrency=2 --max-tasks-per-child=10 --max-memory-per-child=1000000 --prefetch-multiplier=1"
|
|
262
|
+
|
|
263
|
+
app-code-worker:
|
|
264
|
+
<<: *openmates-worker-base
|
|
265
|
+
container_name: app-code-worker
|
|
266
|
+
environment:
|
|
267
|
+
<<: *openmates-worker-env
|
|
268
|
+
CELERY_QUEUES: app_code
|
|
269
|
+
command: >
|
|
270
|
+
sh -c "chown -R celeryuser:celeryuser /vault-data && gosu celeryuser python -m celery -A backend.core.api.app.tasks.celery_config worker --loglevel=info --queues=app_code --concurrency=2 --max-tasks-per-child=20 --max-memory-per-child=600000 --prefetch-multiplier=1"
|
|
271
|
+
|
|
272
|
+
app-social-media-worker:
|
|
273
|
+
<<: *openmates-worker-base
|
|
274
|
+
container_name: app-social-media-worker
|
|
275
|
+
environment:
|
|
276
|
+
<<: *openmates-worker-env
|
|
277
|
+
CELERY_QUEUES: app_social_media
|
|
278
|
+
command: >
|
|
279
|
+
sh -c "chown -R celeryuser:celeryuser /vault-data && gosu celeryuser python -m celery -A backend.core.api.app.tasks.celery_config worker --loglevel=info --queues=app_social_media --concurrency=2 --max-tasks-per-child=50 --max-memory-per-child=600000 --prefetch-multiplier=1"
|
|
280
|
+
|
|
171
281
|
admin-sidecar:
|
|
172
282
|
image: ${OPENMATES_IMAGE_REGISTRY:-ghcr.io/glowingkitty}/openmates-admin-sidecar:${OPENMATES_IMAGE_TAG:-dev}
|
|
173
283
|
container_name: core-admin-sidecar
|