Skip to content

Operations

@nx/asset is not deployed on its own. It ships inside whichever host application mounts it. Operational concerns below are scoped to the asset surface within those hosts.

1. Deployment

PropertyValue
ImageN/A — bundled into host images (commerce / finance / ledger)
ReplicasN/A — follows the host deployment
ResourcesN/A — accounted in the host
ProbesN/A — host healthchecks cover it
Snowflake ID rangeN/A — issues no IDs
Migration modeNone — no schema/migrations
Buildbun run rebuild (depends on @nx/core only)

Traefik labels

N/A — routed through the host service's existing router. Asset routes appear under the host base path (e.g. /v1/api/commerce/assets).

2. Observability

SignalSourceWhere to look
Logshost stdout (structured key-value)kubectl logs <host-pod> / Loki, scope AssetController / BanksVNController
Metricshost /metrics (no asset-specific metrics)host Grafana dashboard
Tracesinherited from host
Healthhost GET /healthz, GET /readyzGateway portal

Key log lines

LineSourceNotes
Failed to create MetaLink for %sAssetController UPLOADMetaLink create failed but object stored — captured into response, not thrown
Failed to delete MetaLink for %s/%sAssetController DELETE_OBJECTObject removed but MetaLink cleanup failed (async, best-effort)
banks-vn.logo.not_foundBanksVNControllerRequested PNG missing on disk → 404

3. Security

ConcernMitigation
AuthNMutating /assets routes (upload/delete/list) + /meta-links require BASIC or JWT (host's verifier); read/download + banks-vn are public
AuthZMetaLinkController sets authorize: { skip: true } on all routes today — Casbin checks disabled for MetaLink
Path traversalisValidPath/isValidName (max depth 2) on object names; bank logo regex ^[A-Za-z0-9]+\.png$
Content sniffingx-content-type-options: nosniff on all object/logo streams
SecretsS3 creds via host env (APP_ENV_S3_*); never in code
Cachingbank registry max-age=3600; bank logos max-age=604800, immutable
Object namingRandom UUID8 object names prevent client-controlled keys (except i18n.json)

4. Runbook

4.1 Alert classes

AlertTriggerCheckFixEscalate
Upload 5xx spikehost 5xx on /assets/uploadlogs Failed to create MetaLink / S3 errorsverify S3 reachability + credentialson-call backend
Orphaned objectsobject present, no MetaLinkFailed to create MetaLink log linesre-create MetaLink or re-uploadon-call backend
Bank logo 404sbanks-vn.logo.not_foundfilename vs resources/banks-vn/*.pngadd missing PNG to bundle + redeploy hostplatform

4.2 Common operations

OperationCommand / action
Tail asset logskubectl logs -n <ns> -f deploy/<host> and filter AssetController
Verify S3 connectivitycheck APP_ENV_S3_ENDPOINT reachable from the host pod
Inspect a MetaLinkGET <host>/meta-links?filter=... (JWT/Basic)
List bucket objectsGET <host>/assets/objects?prefix=... (JWT/Basic)

Proprietary and Confidential. Unauthorized copying, distribution, or use of this software is strictly prohibited.