Sign inSign up

phirumseng/knetrahub-core-api

By phirumseng

•Updated 7 days ago

KNetraHub Core API: auth, sessions, users, access control and the portal schema.

Image
0

881

phirumseng/knetrahub-core-api repository overview

⁠phirumseng/knetrahub-core-api

Core API — the identity and admin service everything else trusts.

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

Authentication, sessions, users/groups, per-app access, Admin (modules, settings, notifications, AI integrations, backups, logs), the portal database schema and its housekeeping. Provisions module databases when a module is enabled.

⁠How it works

Owns authentication, sessions, users and groups, per-app access, the admin surfaces and the portal database schema. It issues the JWT that every other API verifies, and it provisions a module's database the first time that module is enabled.

⁠What it deliberately does not do

It carries no module business logic, so a change to Monitoring or PAM never redeploys the service that holds your sessions.

⁠Privileges

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

⁠Which image do I want

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

Mandatory in a split stack: with it down, nothing else can authorise a request.

⁠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_APP_REPLICAS2set
NUXT_DB_POOL_MAX20set
NUXT_JWT_SECRETchange-me-to-a-long-random-stringset
NUXT_JWT_SECRET_FILE/run/secrets/knetrahub_jwt_secretoptional
NUXT_ENV_MODEstagingoptional
NUXT_PUBLIC_APP_URLhttps://knetrahub.example.comoptional
NUXT_DB_PASSWORD_FILE/run/secrets/knetrahub_db_passwordoptional
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
KNETRA_REQUIRE_INTERNAL_TOKENfalseoptional
KNETRA_RESTORE_SUSPEND_GRACE_MS15000optional
NUXT_BACKUP_DIR/app/data/backupsset
NUXT_SMTP_ENABLEDtrueoptional
NUXT_SMTP_HOSTsmtp.example.comoptional
NUXT_SMTP_PORT587optional
NUXT_SMTP_ENCRYPTIONstarttlsoptional
NUXT_SMTP_USERNAMEknetrahuboptional
NUXT_SMTP_PASSWORD_FILE/run/secrets/knetrahub_smtp_passwordoptional
NUXT_SMTP_FROM_ADDRESS[email protected]optional
NUXT_LOCAL_AUTH_HIDE_LOGINfalseset
NUXT_LOCAL_AUTH_SESSION_TIMEOUT_MINUTES720set
NUXT_LOCAL_AUTH_PASSWORD_MIN_LENGTH8set
NUXT_LOCAL_AUTH_PASSWORD_REQUIRE_UPPERCASEfalseset
NUXT_LOCAL_AUTH_PASSWORD_REQUIRE_LOWERCASEfalseset
NUXT_LOCAL_AUTH_PASSWORD_REQUIRE_NUMBERfalseset
NUXT_LOCAL_AUTH_PASSWORD_REQUIRE_SPECIALfalseset
NUXT_LDAP_ENABLEDfalseset
NUXT_OIDC_ENABLEDfalseset
NUXT_OIDC_ISSUERhttps://keycloak.example.com/realms/mainoptional
NUXT_OIDC_CLIENT_IDknetrahuboptional
NUXT_OIDC_CLIENT_SECRET_FILE/run/secrets/knetrahub_oidc_client_secretoptional
NUXT_OIDC_ADMIN_GROUPswarm-adminsoptional
NUXT_OIDC_OPERATOR_GROUPswarm-operatorsoptional

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_CORE_API_IMAGE, which the stack file reads:

export KNETRAHUB_CORE_API_IMAGE=phirumseng/knetrahub-core-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:f1d4dcf6c…

Size

63.9 MB

Last updated

7 days ago

docker pull phirumseng/knetrahub-core-api