Skip to content

wip: docker support + NICTOOL_BIND_HOST override#3

Draft
aberoham wants to merge 2 commits intoNicTool:mainfrom
aberoham:feat/docker-support
Draft

wip: docker support + NICTOOL_BIND_HOST override#3
aberoham wants to merge 2 commits intoNicTool:mainfrom
aberoham:feat/docker-support

Conversation

@aberoham
Copy link
Copy Markdown

@aberoham aberoham commented Apr 9, 2026

WIP, untested beyond local docker compose.

Adds docker/Dockerfile and docker/entrypoint.sh so the server can run in a container. The entrypoint generates nictool.toml from env vars (remote API mode) and the server auto-generates self-signed TLS on first start, so docker compose up should just work.

One small code change in index.jsNICTOOL_BIND_HOST env var overrides the listen address. Without this the server binds to the container hostname (which resolves to a container-internal IP), so port forwarding never reaches it. Setting NICTOOL_BIND_HOST=0.0.0.0 in compose fixes that.

Related to NicTool/api#19 and NicTool/api#40, which add docker compose support to the API repo including an optional server service that builds from this repo.

🤖 Generated with Claude Code

aberoham and others added 2 commits April 9, 2026 01:26
Dockerfile and entrypoint in docker/ for container deployments.
The entrypoint generates nictool.toml from env vars (remote API
mode) and lets the server auto-generate self-signed TLS on first
start.

NICTOOL_BIND_HOST env var overrides the listen address so the
server can bind 0.0.0.0 inside a container while keeping the TLS
cert hostname for display.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
NICTOOL_TLS=false gives you plain HTTP on 8080 -- no more
self-signed cert dance in local dev. Left "auto" as the default
for production (discovers or generates certs as before).

Added a Groups tab to the web UI: list, create, edit, delete,
restore, and you can click a group name to navigate into it.
Follows the same patterns as the Users/Nameservers tabs.

Fixed a few things that were crashing the server:
- buildRemoteUrl assumed non-localhost meant https, which
  blew up with EPROTO when proxying to the plain-HTTP API
  container. Defaults to http now, configurable via scheme.
- forwardToRemote was missing an await so proxy errors
  bypassed the try/catch entirely
- added clientError/tlsClientError/connection handlers plus
  process-level uncaughtException/unhandledRejection for
  EPROTO so a stray bad request can't take down the server

Dockerfile now exposes both 8080 and 8443.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant