@oktis-works/cms 0.2.0 → 0.3.0
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.
- package/dist/assets.d.ts +23 -6
- package/dist/assets.d.ts.map +1 -1
- package/dist/assets.js +262 -87
- package/dist/assets.js.map +1 -1
- package/dist/bluegreen.d.ts.map +1 -1
- package/dist/bluegreen.js +75 -52
- package/dist/bluegreen.js.map +1 -1
- package/dist/commands.d.ts.map +1 -1
- package/dist/commands.js +269 -131
- package/dist/commands.js.map +1 -1
- package/dist/config-wizard.js +34 -36
- package/dist/config-wizard.js.map +1 -1
- package/dist/deploy-target.d.ts +20 -0
- package/dist/deploy-target.d.ts.map +1 -0
- package/dist/deploy-target.js +90 -0
- package/dist/deploy-target.js.map +1 -0
- package/dist/deploy.d.ts +20 -0
- package/dist/deploy.d.ts.map +1 -0
- package/dist/deploy.js +154 -0
- package/dist/deploy.js.map +1 -0
- package/dist/docker.d.ts +16 -0
- package/dist/docker.d.ts.map +1 -1
- package/dist/docker.js +25 -0
- package/dist/docker.js.map +1 -1
- package/dist/docs-updater.d.ts +10 -0
- package/dist/docs-updater.d.ts.map +1 -0
- package/dist/docs-updater.js +45 -0
- package/dist/docs-updater.js.map +1 -0
- package/dist/doctor.js +12 -12
- package/dist/doctor.js.map +1 -1
- package/dist/env-file.js +1 -1
- package/dist/env-file.js.map +1 -1
- package/dist/env-schema.d.ts.map +1 -1
- package/dist/env-schema.js +64 -64
- package/dist/env-schema.js.map +1 -1
- package/dist/extension-scaffold.js +5 -5
- package/dist/extension-scaffold.js.map +1 -1
- package/dist/guards.js +8 -8
- package/dist/guards.js.map +1 -1
- package/dist/history.d.ts +48 -0
- package/dist/history.d.ts.map +1 -0
- package/dist/history.js +104 -0
- package/dist/history.js.map +1 -0
- package/dist/installer.js +9 -9
- package/dist/installer.js.map +1 -1
- package/dist/npm-registry.js +1 -1
- package/dist/npm-registry.js.map +1 -1
- package/dist/pm2.d.ts +18 -0
- package/dist/pm2.d.ts.map +1 -0
- package/dist/pm2.js +179 -0
- package/dist/pm2.js.map +1 -0
- package/dist/project-config.js +1 -1
- package/dist/project-config.js.map +1 -1
- package/dist/prompt.d.ts +27 -4
- package/dist/prompt.d.ts.map +1 -1
- package/dist/prompt.js +254 -29
- package/dist/prompt.js.map +1 -1
- package/dist/redeploy.d.ts +6 -1
- package/dist/redeploy.d.ts.map +1 -1
- package/dist/redeploy.js +137 -74
- package/dist/redeploy.js.map +1 -1
- package/dist/rollback.d.ts +15 -0
- package/dist/rollback.d.ts.map +1 -0
- package/dist/rollback.js +170 -0
- package/dist/rollback.js.map +1 -0
- package/dist/scaffold-docs.d.ts +5 -0
- package/dist/scaffold-docs.d.ts.map +1 -1
- package/dist/scaffold-docs.js +61 -19
- package/dist/scaffold-docs.js.map +1 -1
- package/dist/scaffold.d.ts +3 -1
- package/dist/scaffold.d.ts.map +1 -1
- package/dist/scaffold.js +25 -16
- package/dist/scaffold.js.map +1 -1
- package/dist/simple.d.ts +31 -0
- package/dist/simple.d.ts.map +1 -0
- package/dist/simple.js +200 -0
- package/dist/simple.js.map +1 -0
- package/dist/start.js +1 -1
- package/dist/theme-build.js +3 -3
- package/dist/theme-build.js.map +1 -1
- package/dist/update.d.ts +23 -15
- package/dist/update.d.ts.map +1 -1
- package/dist/update.js +211 -66
- package/dist/update.js.map +1 -1
- package/package.json +7 -7
package/dist/assets.d.ts
CHANGED
|
@@ -12,28 +12,38 @@ export declare const ASSET_MIRROR: {
|
|
|
12
12
|
* processo escolhido pelo `command` do compose. Quatro Dockerfiles seriam
|
|
13
13
|
* quatro builds idênticos consumindo o mesmo node_modules.
|
|
14
14
|
*/
|
|
15
|
-
export declare const DOCKERFILE = "# syntax=docker/dockerfile:1\n# @oktis-works -
|
|
15
|
+
export declare const DOCKERFILE = "# syntax=docker/dockerfile:1\n# @oktis-works - Single OkCMS image (entrypoints: api | admin | web | worker)\n#\n# Generated by the CLI scaffold. Canonical at\n# infrastructure/docker/Dockerfile in this monorepo.\n#\n# SECURITY: the command-line tool never enters this image. The container\n# exposes only the application processes \u2014 no package installer, no Docker\n# socket access, no way to change its own state. Deploy and configuration\n# always run on the host.\nFROM oven/bun:1-alpine AS base\nWORKDIR /app\nENV NODE_ENV=production\n\n# --- dependencies -----------------------------------------------------------\n# Manifest + lock first: changing just the code does not invalidate\n# this `install`.\nFROM base AS deps\nCOPY package.json bun.lock* package-lock.json* yarn.lock* pnpm-lock.yaml* ./\n# Fallbacks: missing/divergent lock (npm/yarn) or old bun without --production\nRUN bun install --production --frozen-lockfile \\\n || bun install --production \\\n || bun install\n\n# --- runtime ----------------------------------------------------------------\nFROM base AS runtime\n# 1. project code (.dockerignore drops .env, node_modules and .data)\nCOPY . .\n# 2. clean node_modules from the deps stage, on top \u2014 never the host's\nCOPY --from=deps /app/node_modules ./node_modules\n\nRUN mkdir -p /app/.data/storage /app/.data/cache /app/logs\n\nEXPOSE 3000 3001 3011\n\n# `docker compose ... command: api` picks the role; see docker/entrypoint.sh\nENTRYPOINT [\"/app/docker/entrypoint.sh\"]\nCMD [\"api\"]\n";
|
|
16
16
|
/** Dispatcher de papéis. Fora da lista, executa o comando literal. */
|
|
17
|
-
export declare const ENTRYPOINT_SH = "#!/bin/sh\n# @oktis-works -
|
|
17
|
+
export declare const ENTRYPOINT_SH = "#!/bin/sh\n# @oktis-works - Single entrypoint of the okcms/app image\n#\n# Compose picks the role with `command: api|web|admin|worker`. Any other\n# value is passed through literally (`docker run okcms/app sh`), which keeps\n# the container inspectable without rewriting the image.\nset -eu\n\napi_entry=\"node_modules/@oktis-works/api/dist/index.js\"\nweb_entry=\"node_modules/@oktis-works/web/dist/index.js\"\nadmin_entry=\"node_modules/@oktis-works/admin/bin/admin.js\"\nworker_entry=\"node_modules/@oktis-works/worker/dist/index.js\"\n\ncase \"${1:-api}\" in\n api)\n shift\n exec bun \"$api_entry\" \"$@\"\n ;;\n web)\n shift\n exec bun \"$web_entry\" \"$@\"\n ;;\n admin)\n shift\n exec bun \"$admin_entry\" \"$@\"\n ;;\n worker)\n shift\n exec bun \"$worker_entry\" \"$@\"\n ;;\n *)\n exec \"$@\"\n ;;\nesac\n";
|
|
18
18
|
/**
|
|
19
19
|
* Camada de segurança do build: além do ganho de cache, impede dois acidentes
|
|
20
20
|
* caros — assinar a imagem com o `.env` real e instalar `node_modules` do host
|
|
21
21
|
* (arquitetura diferente / código não auditado).
|
|
22
22
|
*/
|
|
23
|
-
export declare const DOCKERIGNORE = "# @oktis-works - build context
|
|
23
|
+
export declare const DOCKERIGNORE = "# @oktis-works - build context of the okcms/app image\n# .env NEVER enters the image: it carries the database password and\n# JWT_SECRET, and the image is distributed/copied. At runtime it comes\n# from the host via env_file.\n\n.env\n.env.*\n!.env.example\n\n# host dependencies (the image installs its own)\nnode_modules\n**/node_modules\n.tsbuildinfo\n**/*.tsbuildinfo\n# NB: do NOT ignore dist/ \u2014 plugins installed in plugins/*/dist are runtime.\n\n# local data and state\n.data\n**/.data\nlogs\n**/logs\n*.log\ncoverage\n**/coverage\n\n# mounted at runtime, not copied\ndeploy/\n\n# VCS and tooling \u2014 not runtime code\n.git\n.github\n.gitignore\n.sdd\n.vscode\n.idea\n.claude\n*.md\n!README.md\n\n# infrastructure mounted at runtime, not copied inside\ndocker-compose*.yml\ndeploy/nginx/certs\n";
|
|
24
24
|
/**
|
|
25
25
|
* Banco, cache e proxy — únicos e estáveis por toda a vida do site. Moram num
|
|
26
26
|
* projeto PRÓPRIO para que `docker compose -p okcms-blue down` não derrube o
|
|
27
27
|
* banco junto com a lane antiga.
|
|
28
28
|
*/
|
|
29
|
-
export declare const COMPOSE_INFRA = "# @oktis-works -
|
|
29
|
+
export declare const COMPOSE_INFRA = "# @oktis-works - Shared infrastructure of the production deploy\n# Generated by the CLI. Canonical at\n# infrastructure/compose/docker-compose.infra.yml\n#\n# OWN Docker project (okcms): single postgres, redis and proxy. The\n# blue/green lanes are separate projects (okcms-blue / okcms-green) that\n# join this network as external \u2014 so `down` of a lane never touches the\n# database.\n#\n# docker compose -p okcms -f docker-compose.infra.yml up -d\nname: okcms\n\nservices:\n postgres:\n image: postgres:16-alpine\n container_name: okcms-postgres\n restart: unless-stopped\n environment:\n POSTGRES_DB: ${DB_NAME:-okcms}\n POSTGRES_USER: ${DB_USER:-postgres}\n POSTGRES_PASSWORD: ${DB_PASSWORD:?set DB_PASSWORD in .env}\n volumes:\n - postgres-data:/var/lib/postgresql/data\n ports:\n # Loopback only: the host can run `okcms db:migrate` and\n # `db:backup` without exposing Postgres to the network. On managed\n # production remove this block and point DB_HOST/DATABASE_URL at the\n # provider.\n - \"127.0.0.1:${DB_HOST_PORT:-5432}:5432\"\n healthcheck:\n test: [\"CMD-SHELL\", \"pg_isready -U $${POSTGRES_USER} -d $${POSTGRES_DB}\"]\n interval: 10s\n timeout: 5s\n retries: 10\n labels:\n # classification read by `okcms update`: data = untouchable\n okcms.role: data\n networks: [okcms]\n\n redis:\n image: redis:7-alpine\n container_name: okcms-redis\n restart: unless-stopped\n environment:\n REDIS_PASSWORD: ${REDIS_PASSWORD:-}\n command:\n - sh\n - -c\n - |\n if [ -n \"$${REDIS_PASSWORD:-}\" ]; then\n exec redis-server --appendonly yes --requirepass \"$$REDIS_PASSWORD\"\n else\n exec redis-server --appendonly yes\n fi\n # no published port: only what is on okcms-net can reach Redis\n volumes:\n - redis-data:/data\n healthcheck:\n test: [\"CMD\", \"redis-cli\", \"ping\"]\n interval: 10s\n timeout: 5s\n retries: 10\n labels:\n okcms.role: data\n networks: [okcms]\n\n proxy:\n image: nginx:1.27-alpine\n container_name: okcms-proxy\n restart: unless-stopped\n ports:\n - \"80:80\"\n - \"8080:8080\"\n environment:\n # fed to the native nginx envsubst \u2192 writes conf.d/default.conf\n SERVER_NAME: ${SERVER_NAME:-_}\n ADMIN_SERVER_NAME: ${ADMIN_SERVER_NAME:-admin.localhost}\n volumes:\n - ./deploy/nginx/templates:/etc/nginx/templates:ro\n # conf.d must be writable: the CLI rewrites 00-upstreams.conf on swap\n - ./deploy/nginx/conf.d:/etc/nginx/conf.d:rw\n labels:\n okcms.role: proxy\n networks: [okcms]\n\nnetworks:\n okcms:\n # fixed name \u2014 the lanes declare it as external\n name: okcms-net\n\nvolumes:\n postgres-data:\n name: okcms-postgres-data\n redis-data:\n name: okcms-redis-data\n";
|
|
30
30
|
/**
|
|
31
31
|
* Um arquivo, dois projetos Docker. O "lane" é o NOME DO PROJETO — não há
|
|
32
32
|
* serviço repetido por perfil nem perfil a ativar manualmente; basta
|
|
33
33
|
* `-p okcms-blue` ou `-p okcms-green`. Os containers herdam o prefixo
|
|
34
34
|
* `okcms-<lane>-`, que é exatamente o que os upstreams do nginx apontam.
|
|
35
35
|
*/
|
|
36
|
-
export declare const COMPOSE_DEPLOY = "# @oktis-works -
|
|
36
|
+
export declare const COMPOSE_DEPLOY = "# @oktis-works - OkCMS blue/green lanes\n# Generated by the CLI. Canonical at\n# infrastructure/compose/docker-compose.deploy.yml\n#\n# ONE FILE, TWO Docker projects. The lane is the project name:\n#\n# docker compose -p okcms-blue -f docker-compose.deploy.yml up -d --build\n# docker compose -p okcms-green -f docker-compose.deploy.yml up -d --build\n#\n# Containers are okcms-<lane>-<service> \u2014 the nginx upstreams point at\n# those names (generated in deploy/nginx/conf.d/00-upstreams.conf).\n#\n# The okcms-net network is EXTERNAL (created by docker-compose.infra.yml)\n# and the infra services are NOT listed here on purpose: without that,\n# `down` of a lane would take the database down with the old lane.\n#\n# Roles (label okcms.role, read by `okcms update`):\n# edge api/web/admin \u2192 fully replaced on each deploy (blue/green)\n# worker BullMQ queue \u2192 NEVER blue/green; drained with SIGTERM on swap\n# data postgres/redis\u2192 untouchable; they live in docker-compose.infra.yml\n#\n# NB: a lane `down` removes CONTAINERS and NETWORKS, but never passes -v\n# (`-v` would wipe the okcms-storage volume shared by blue and green, the\n# one that keeps media alive across deploys).\n\nx-app: &app\n image: okcms/app:${OKCMS_VERSION:-latest}\n build:\n context: .\n dockerfile: docker/Dockerfile\n env_file:\n # .env first (operator ports) \u2014 the environment below overrides\n - .env\n restart: unless-stopped\n networks: [okcms]\n environment:\n NODE_ENV: production\n DB_HOST: postgres\n REDIS_HOST: redis\n volumes:\n - ./plugins:/app/plugins\n - ./themes:/app/themes\n # media shared by both lanes: a deploy never loses files\n - storage-data:/app/.data/storage\n - cache-data:/app/.data/cache\n\nx-api-health: &api-health\n test:\n - CMD\n - bun\n - -e\n - \"fetch('http://127.0.0.1:'+(process.env.PORT||3000)+'/health').then(r=>process.exit(r.ok?0:1)).catch(()=>process.exit(1))\"\n interval: 10s\n timeout: 5s\n retries: 12\n start_period: 25s\n\nx-web-health: &web-health\n test:\n - CMD\n - bun\n - -e\n - \"fetch('http://127.0.0.1:'+(process.env.WEB_PORT||3001)+'/health').then(r=>process.exit(r.ok?0:1)).catch(()=>process.exit(1))\"\n interval: 10s\n timeout: 5s\n retries: 12\n start_period: 25s\n\nx-admin-health: &admin-health\n # the admin is an Astro standalone: it serves / and has no /health endpoint\n test:\n - CMD\n - bun\n - -e\n - \"fetch('http://127.0.0.1:'+(process.env.PORT||3011)+'/').then(r=>process.exit(r.status<500?0:1)).catch(()=>process.exit(1))\"\n interval: 10s\n timeout: 5s\n retries: 12\n start_period: 30s\n\nservices:\n # ---------------------------------------------------------------- api\n api-blue:\n <<: *app\n container_name: okcms-api-blue\n command: [\"api\"]\n labels:\n okcms.role: edge\n okcms.lane: blue\n okcms.service: api\n healthcheck: *api-health\n\n api-green:\n <<: *app\n container_name: okcms-api-green\n command: [\"api\"]\n labels:\n okcms.role: edge\n okcms.lane: green\n okcms.service: api\n healthcheck: *api-health\n\n # ---------------------------------------------------------------- web\n web-blue:\n <<: *app\n container_name: okcms-web-blue\n command: [\"web\"]\n labels:\n okcms.role: edge\n okcms.lane: blue\n okcms.service: web\n healthcheck: *web-health\n\n web-green:\n <<: *app\n container_name: okcms-web-green\n command: [\"web\"]\n labels:\n okcms.role: edge\n okcms.lane: green\n okcms.service: web\n healthcheck: *web-health\n\n # -------------------------------------------------------------- admin\n # admin reads `PORT` (astro standalone), not `ADMIN_PORT`: a service\n # level environment replaces the merged anchor one, so the three shared\n # ones are repeated.\n admin-blue:\n <<: *app\n container_name: okcms-admin-blue\n command: [\"admin\"]\n environment:\n NODE_ENV: production\n DB_HOST: postgres\n REDIS_HOST: redis\n PORT: ${ADMIN_PORT:-3011}\n labels:\n okcms.role: edge\n okcms.lane: blue\n okcms.service: admin\n healthcheck: *admin-health\n\n admin-green:\n <<: *app\n container_name: okcms-admin-green\n command: [\"admin\"]\n environment:\n NODE_ENV: production\n DB_HOST: postgres\n REDIS_HOST: redis\n PORT: ${ADMIN_PORT:-3011}\n labels:\n okcms.role: edge\n okcms.lane: green\n okcms.service: admin\n healthcheck: *admin-health\n\n # ------------------------------------------------------------- worker\n # a queue cannot take two \"ghost\" instances: the worker starts only after\n # the swap and the old lane's worker drains with SIGTERM\n # (stop_grace_period) first.\n worker-blue:\n <<: *app\n container_name: okcms-worker-blue\n command: [\"worker\"]\n stop_grace_period: 30s\n labels:\n okcms.role: worker\n okcms.lane: blue\n okcms.service: worker\n\n worker-green:\n <<: *app\n container_name: okcms-worker-green\n command: [\"worker\"]\n stop_grace_period: 30s\n labels:\n okcms.role: worker\n okcms.lane: green\n okcms.service: worker\n\nnetworks:\n okcms:\n name: okcms-net\n external: true\n\nvolumes:\n # shared between blue and green on purpose: media survives the deploy\n storage-data:\n name: okcms-storage\n cache-data:\n name: okcms-cache\n";
|
|
37
|
+
/**
|
|
38
|
+
* The non-blue/green path: one Docker project (`okcms-app`) holding api, web,
|
|
39
|
+
* admin and worker without lane suffixes. `up -d --build` recreates only what
|
|
40
|
+
* changed, there is no second lane to keep warm and no proxy swap — the nginx
|
|
41
|
+
* upstreams simply point at `okcms-api` / `okcms-web` / `okcms-admin`.
|
|
42
|
+
*
|
|
43
|
+
* Network and volumes are the same ones the lanes use, so storage (media)
|
|
44
|
+
* survives a switch between simple mode and blue/green.
|
|
45
|
+
*/
|
|
46
|
+
export declare const COMPOSE_APP = "# @oktis-works - Simple container stack of OkCMS\n# Generated by the CLI.\n#\n# One Docker project, no lanes, no swap:\n#\n# docker compose -p okcms-app -f docker-compose.app.yml up -d --build\n#\n# Containers are okcms-api / okcms-web / okcms-admin / okcms-worker \u2014 the\n# nginx upstreams (deploy/nginx/conf.d/00-upstreams.conf) point at them.\n# Use `okcms deploy` to pick this mode, or blue/green for zero-downtime.\n#\n# Network okcms-net is EXTERNAL (created by docker-compose.infra.yml), so\n# `down` of this stack never touches postgres, redis or the proxy.\n\nx-app: &app\n image: okcms/app:${OKCMS_VERSION:-latest}\n build:\n context: .\n dockerfile: docker/Dockerfile\n env_file:\n - .env\n restart: unless-stopped\n networks: [okcms]\n environment:\n NODE_ENV: production\n DB_HOST: postgres\n REDIS_HOST: redis\n volumes:\n - ./plugins:/app/plugins\n - ./themes:/app/themes\n - storage-data:/app/.data/storage\n - cache-data:/app/.data/cache\n\nx-api-health: &api-health\n test:\n - CMD\n - bun\n - -e\n - \"fetch('http://127.0.0.1:'+(process.env.PORT||3000)+'/health').then(r=>process.exit(r.ok?0:1)).catch(()=>process.exit(1))\"\n interval: 10s\n timeout: 5s\n retries: 12\n start_period: 25s\n\nx-web-health: &web-health\n test:\n - CMD\n - bun\n - -e\n - \"fetch('http://127.0.0.1:'+(process.env.WEB_PORT||3001)+'/health').then(r=>process.exit(r.ok?0:1)).catch(()=>process.exit(1))\"\n interval: 10s\n timeout: 5s\n retries: 12\n start_period: 25s\n\nx-admin-health: &admin-health\n # the admin is an Astro standalone: it serves / and has no /health endpoint\n test:\n - CMD\n - bun\n - -e\n - \"fetch('http://127.0.0.1:'+(process.env.PORT||3011)+'/').then(r=>process.exit(r.status<500?0:1)).catch(()=>process.exit(1))\"\n interval: 10s\n timeout: 5s\n retries: 12\n start_period: 30s\n\nservices:\n api:\n <<: *app\n container_name: okcms-api\n command: [\"api\"]\n labels:\n okcms.role: edge\n okcms.service: api\n healthcheck: *api-health\n\n web:\n <<: *app\n container_name: okcms-web\n command: [\"web\"]\n labels:\n okcms.role: edge\n okcms.service: web\n healthcheck: *web-health\n\n # the admin reads `PORT` (astro standalone), not `ADMIN_PORT`: a service\n # level environment replaces the merged anchor one, so it is repeated here.\n admin:\n <<: *app\n container_name: okcms-admin\n command: [\"admin\"]\n environment:\n NODE_ENV: production\n DB_HOST: postgres\n REDIS_HOST: redis\n PORT: ${ADMIN_PORT:-3011}\n labels:\n okcms.role: edge\n okcms.service: admin\n healthcheck: *admin-health\n\n worker:\n <<: *app\n container_name: okcms-worker\n command: [\"worker\"]\n stop_grace_period: 30s\n labels:\n okcms.role: worker\n okcms.service: worker\n\nnetworks:\n okcms:\n name: okcms-net\n external: true\n\nvolumes:\n # same names as the lanes: media survives switching deploy modes\n storage-data:\n name: okcms-storage\n cache-data:\n name: okcms-cache\n";
|
|
37
47
|
/**
|
|
38
48
|
* Roteamento production. Os upstreams ficam em arquivo SEPARADO
|
|
39
49
|
* (`00-upstreams.conf`) justamente para que o swap seja uma reescrita de um
|
|
@@ -44,7 +54,7 @@ export declare const COMPOSE_DEPLOY = "# @oktis-works - Lanes blue/green do OkCM
|
|
|
44
54
|
* as variáveis em `$host`/`$upstream_*` são do nginx e ficam intactas porque
|
|
45
55
|
* o envsubst só substitui a lista de variáveis definidas no ambiente.
|
|
46
56
|
*/
|
|
47
|
-
export declare const NGINX_TEMPLATE = "# @oktis-works -
|
|
57
|
+
export declare const NGINX_TEMPLATE = "# @oktis-works - OkCMS proxy routing (template)\n# Generated by the CLI. Canonical at\n# infrastructure/nginx/templates/default.conf.template\n#\n# The official nginx image runs /etc/nginx/templates/*.template on start,\n# with envsubst limited to the variables defined in the environment\n# (SERVER_NAME and ADMIN_SERVER_NAME, coming from the .env). Anything that\n# is $host, $remote_addr or $upstream_* belongs to nginx and is NOT\n# substituted.\n#\n# The upstreams live in conf.d/00-upstreams.conf: the CLI rewrites them on\n# swap and reloads with `nginx -s reload` \u2014 lane switch without dropping\n# connections.\n\nmap $http_upgrade $connection_upgrade {\n default upgrade;\n '' close;\n}\n\n# ---------------------------------------------------------------- admin ----\n# The admin is an Astro standalone served at the ROOT (not /admin): it emits\n# /_astro/... URLs and has no configured base path, so publishing it under\n# /admin/ would break the assets. It needs its own host.\nserver {\n listen 80;\n server_name ${ADMIN_SERVER_NAME};\n\n location / {\n proxy_pass $upstream_admin;\n proxy_http_version 1.1;\n proxy_set_header Host $host;\n proxy_set_header X-Real-IP $remote_addr;\n proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;\n proxy_set_header X-Forwarded-Proto $scheme;\n proxy_set_header X-Forwarded-Host $host;\n proxy_set_header Upgrade $http_upgrade;\n proxy_set_header Connection $connection_upgrade;\n proxy_read_timeout 120s;\n }\n}\n\n# admin by port \u2014 works without any DNS (http://<host>:8080/)\nserver {\n listen 8080 default_server;\n server_name _;\n\n location / {\n proxy_pass $upstream_admin;\n proxy_http_version 1.1;\n proxy_set_header Host $host;\n proxy_set_header X-Real-IP $remote_addr;\n proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;\n proxy_set_header X-Forwarded-Proto $scheme;\n proxy_set_header Upgrade $http_upgrade;\n proxy_set_header Connection $connection_upgrade;\n proxy_read_timeout 120s;\n }\n}\n\n# ----------------------------------------------------------- public site ---\nserver {\n listen 80 default_server;\n server_name ${SERVER_NAME};\n\n client_max_body_size 100m;\n gzip on;\n gzip_types text/plain text/css application/json application/javascript\n image/svg+xml;\n\n # edge healthcheck: always on the api (it is the one talking to the database)\n location = /health {\n access_log off;\n proxy_pass $upstream_api;\n proxy_http_version 1.1;\n proxy_set_header Host $host;\n }\n\n # API + media (/api/v1/media/file/<tenant>/<file>)\n location /api/ {\n proxy_pass $upstream_api;\n proxy_http_version 1.1;\n proxy_set_header Host $host;\n proxy_set_header X-Real-IP $remote_addr;\n proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;\n proxy_set_header X-Forwarded-Proto $scheme;\n proxy_set_header X-Forwarded-Host $host;\n proxy_set_header Upgrade $http_upgrade;\n proxy_set_header Connection $connection_upgrade;\n proxy_read_timeout 120s;\n }\n\n # STORAGE_PUBLIC_BASE=/storage \u2192 routes the same file to the API.\n # The local driver publishes <base>/<tenant>/<file>, which is exactly the\n # format of /api/v1/media/file/<tenant>/<file>.\n location /storage/ {\n rewrite ^/storage/(.*)$ /api/v1/media/file/$1 break;\n proxy_pass $upstream_api;\n proxy_http_version 1.1;\n proxy_set_header Host $host;\n proxy_set_header X-Forwarded-Proto $scheme;\n proxy_cache_valid 200 30d;\n expires 30d;\n }\n\n # theme assets served by the web (Theme SDK path resolver)\n location /themes/ {\n proxy_pass $upstream_web;\n proxy_http_version 1.1;\n proxy_set_header Host $host;\n proxy_set_header X-Forwarded-Proto $scheme;\n }\n\n # SSR of the public site\n location / {\n proxy_pass $upstream_web;\n proxy_http_version 1.1;\n proxy_set_header Host $host;\n proxy_set_header X-Real-IP $remote_addr;\n proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;\n proxy_set_header X-Forwarded-Proto $scheme;\n proxy_set_header X-Forwarded-Host $host;\n proxy_set_header Upgrade $http_upgrade;\n proxy_set_header Connection $connection_upgrade;\n proxy_read_timeout 120s;\n }\n}\n";
|
|
48
58
|
export type Lane = 'blue' | 'green';
|
|
49
59
|
export interface UpstreamPorts {
|
|
50
60
|
api: number;
|
|
@@ -60,12 +70,19 @@ export declare const DEFAULT_UPSTREAM_PORTS: UpstreamPorts;
|
|
|
60
70
|
* fechar conexão estabelecida.
|
|
61
71
|
*/
|
|
62
72
|
export declare function renderUpstreams(lane: Lane, ports?: UpstreamPorts): string;
|
|
73
|
+
/**
|
|
74
|
+
* Upstreams for the SIMPLE stack (`okcms deploy --target simple`): the same
|
|
75
|
+
* nginx config, pointing at the lane-less containers. Switching modes is a
|
|
76
|
+
* rewrite of this file plus `nginx -s reload`.
|
|
77
|
+
*/
|
|
78
|
+
export declare function renderSimpleUpstreams(ports?: UpstreamPorts): string;
|
|
63
79
|
export declare const DEPLOY_PATHS: {
|
|
64
80
|
readonly dockerignore: ".dockerignore";
|
|
65
81
|
readonly dockerfile: "docker/Dockerfile";
|
|
66
82
|
readonly entrypoint: "docker/entrypoint.sh";
|
|
67
83
|
readonly composeInfra: "docker-compose.infra.yml";
|
|
68
84
|
readonly composeDeploy: "docker-compose.deploy.yml";
|
|
85
|
+
readonly composeApp: "docker-compose.app.yml";
|
|
69
86
|
readonly nginxTemplate: "deploy/nginx/templates/default.conf.template";
|
|
70
87
|
readonly nginxUpstreams: "deploy/nginx/conf.d/00-upstreams.conf";
|
|
71
88
|
};
|
package/dist/assets.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"assets.d.ts","sourceRoot":"","sources":["../src/assets.ts"],"names":[],"mappings":"AAaA,2DAA2D;AAC3D,eAAO,MAAM,YAAY;;;;;;;CAOf,CAAC;AAMX;;;;GAIG;AACH,eAAO,MAAM,UAAU,
|
|
1
|
+
{"version":3,"file":"assets.d.ts","sourceRoot":"","sources":["../src/assets.ts"],"names":[],"mappings":"AAaA,2DAA2D;AAC3D,eAAO,MAAM,YAAY;;;;;;;CAOf,CAAC;AAMX;;;;GAIG;AACH,eAAO,MAAM,UAAU,+/CAsCtB,CAAC;AAEF,sEAAsE;AACtE,eAAO,MAAM,aAAa,o2BAkCzB,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,YAAY,8yBA0CxB,CAAC;AAMF;;;;GAIG;AACH,eAAO,MAAM,aAAa,y3FA+FzB,CAAC;AAMF;;;;;GAKG;AACH,eAAO,MAAM,cAAc,q5KAgM1B,CAAC;AAMF;;;;;;;;GAQG;AACH,eAAO,MAAM,WAAW,4jGA0HvB,CAAC;AAMF;;;;;;;;;GASG;AACH,eAAO,MAAM,cAAc,ktIA8H1B,CAAC;AAEF,MAAM,MAAM,IAAI,GAAG,MAAM,GAAG,OAAO,CAAC;AAEpC,MAAM,WAAW,aAAa;IAC5B,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;CACf;AAED,eAAO,MAAM,sBAAsB,EAAE,aAAqD,CAAC;AAE3F;;;;;;GAMG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,IAAI,EAAE,KAAK,GAAE,aAAsC,GAAG,MAAM,CAqBjG;AAED;;;;GAIG;AACH,wBAAgB,qBAAqB,CAAC,KAAK,GAAE,aAAsC,GAAG,MAAM,CAoB3F;AAMD,eAAO,MAAM,YAAY;;;;;;;;;CASf,CAAC;AAEX,yEAAyE;AACzE,eAAO,MAAM,eAAe,qCAAqC,CAAC;AAElE,oEAAoE;AACpE,eAAO,MAAM,gBAAgB,UAM5B,CAAC;AAEF,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,yDAAyD;IACzD,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,4EAA4E;AAC5E,wBAAgB,YAAY,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,aAAa,CAU1E;AAED;;;;;;;;GAQG;AACH,wBAAgB,YAAY,CAC1B,IAAI,GAAE,IAAa,EACnB,KAAK,GAAE,aAAsC,GAC5C,YAAY,EAAE,CAWhB"}
|