Sign inSign up

phirumseng/knetrahub-proxy-api

By phirumseng

•Updated about 4 hours ago

KNetraHub Proxy Manager API: endpoints and migrations, no background jobs.

Image
0

271

phirumseng/knetrahub-proxy-api repository overview

⁠phirumseng/knetrahub-proxy-api

Proxy Manager API — the request half of Proxy Manager.

KNetraHub is a self-hosted IT operations portal: a Docker Swarm console, full-stack monitoring, work management, privileged access management, IP address management and a database workspace, behind one sign-in. It ships two ways — as a single monolith image, or as the split stack of one image per service that this image belongs to.

šŸ“– Documentation: https://sengphirum.github.io/KNetraHub/documentation⁠


⁠What this image does

The Proxy Manager module's HTTP API and realtime (SSE) endpoints, plus its schema migrations. No background jobs.

It bundles the server code of proxy and nothing else, so the image carries only the module it is named after.

⁠How it works

Serves Proxy Manager's HTTP endpoints and its realtime stream, and applies that module's own schema migrations at start-up. It opens two database pools: the portal pool it shares with every service, and Proxy Manager's module pool, which it shares only with that module's worker.

⁠What it deliberately does not do

It runs no background job whatsoever. Nothing here polls, sweeps or drains, so restarting it interrupts requests only — never the work already in flight on the worker.

⁠Privileges

Runs unprivileged with cap_drop: [ALL] and nothing added back.

⁠Which image do I want

ImageServes HTTPRuns background jobsScale it with
knetrahub-proxy-api (this image)yesnorequest load
knetrahub-app⁠yesyesnothing — it is one process

Scale this with request and dashboard load. Scale proxy-worker separately when it is the jobs, not the traffic, that are growing.

⁠Settings

Read straight from the stack file that deploys this service, so the list is what the image actually takes. Optional entries ship commented out.

VariableDefault
NUXT_PROXY_MASTER_KEY_FILE/run/secrets/knetrahub_proxy_master_keyoptional
NUXT_PROXY_SHARED_STACKknetrahub-proxyoptional
NUXT_PROXY_DEDICATED_STACK_PREFIXknetrahub-proxy-optional
NUXT_PROXY_DEPLOY_TIMEOUT_SECONDS180optional
NUXT_PROXY_DRIFT_INTERVAL_SECONDS60optional
NUXT_PROXY_STATS_INTERVAL_SECONDS60optional
NUXT_PROXY_REQUIRE_APPROVAL_EXTERNALtrueoptional
NUXT_PROXY_REQUIRE_APPROVAL_RESTRICTEDtrueoptional
NUXT_PROXY_RESERVED_PORTS3000optional
NUXT_PROXY_NGINX_IMAGEnginx:1.31.6-alpineoptional
NUXT_PROXY_CADDY_IMAGEcaddy:2.10.2-alpineoptional
NUXT_PROXY_TRAEFIK_IMAGEtraefik:v3.5.6optional
NUXT_PROXY_HAPROXY_IMAGEhaproxy:3.2.25-alpineoptional
NUXT_PROXY_NATIVE_VALIDATIONenforceoptional
NUXT_PROXY_DIAGNOSTICS_IMAGEbusybox:1.37.0optional
NUXT_PROXY_PRESET_RESERVATION_CPUS0.25optional
NUXT_PROXY_PRESET_RESERVATION_MEMORY_MIB128optional
NUXT_PROXY_PRESET_LIMIT_CPUS1optional
NUXT_PROXY_PRESET_LIMIT_MEMORY_MIB512optional
NUXT_APP_REPLICAS1set
NUXT_DB_POOL_MAX8set
NUXT_MODULE_POOL_REPLICAS1set
NUXT_JWT_SECRETchange-me-to-a-long-random-stringset
NUXT_ENV_MODEstagingoptional
NUXT_DB_HOSTtimescaledbset
NUXT_DB_PORT5432set
NUXT_DB_NAMEknetrahubset
NUXT_DB_USERknetrahubset
NUXT_DB_PASSWORDchange-me-to-a-long-random-stringset
KNETRA_INTERNAL_TOKEN_FILE/run/secrets/knetrahub_internal_tokenoptional
NUXT_WORK_FILES_DIR/app/data/work-filesoptional

Anything ending in _FILE reads its value from that path instead, which is how the stack passes Docker secrets.

⁠Deploying it

This is one service of a stack, not a standalone container: it expects the portal database and its siblings on the same overlay network. Deploy it with the stack file that owns it rather than with docker run.

docker stack deploy -c docker/docker-compose.yml knetrahub

Pin a tag or a registry for this one service with KNETRAHUB_PROXY_API_IMAGE, which the stack file reads:

export KNETRAHUB_PROXY_API_IMAGE=phirumseng/knetrahub-proxy-api:0.1.11

⁠Supported tags

  • latest — the most recent release
  • x.y.z (e.g. 0.1.11) — immutable release versions

Pin the version in production. A rollback needs a tag that does not move, and every image in the stack is released under the same version so the whole set can be pinned together.

⁠The rest of the stack

Each service is its own image, so one can be updated without restarting the others:

⁠License

Proprietary — Ā© Seng Phirum. All rights reserved.

Tag summary

Content type

Image

Digest

sha256:5d935afdb…

Size

58.9 MB

Last updated

about 4 hours ago

docker pull phirumseng/knetrahub-proxy-api