GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - PascalAI2024/kintunnel: Self-hosted WireGuard access for people you trust

BranchesTags
Open more actions menu

Latest commit

 

History

35 Commits
35 Commits

Folders and files

NameName
Last commit message
Last commit date
.github
.github
 
 
adr
adr
 
 
compose
compose
 
 
config
config
 
 
docs
docs
 
 
examples
examples
 
 
packages
packages
 
 
scripts
scripts
 
 
specs
specs
 
 
tests
tests
 
 
.coderabbit.yaml
.coderabbit.yaml
 
 
.dockerignore
.dockerignore
 
 
.editorconfig
.editorconfig
 
 
.env.example
.env.example
 
 
.gitattributes
.gitattributes
 
 
.gitignore
.gitignore
 
 
CHANGELOG.md
CHANGELOG.md
 
 
CODE_OF_CONDUCT.md
CODE_OF_CONDUCT.md
 
 
CONTRIBUTING.md
CONTRIBUTING.md
 
 
Dockerfile.admin
Dockerfile.admin
 
 
Dockerfile.engine
Dockerfile.engine
 
 
LICENSE
LICENSE
 
 
NOTICE
NOTICE
 
 
PLAN-implementation.md
PLAN-implementation.md
 
 
PLAN.md
PLAN.md
 
 
README.md
README.md
 
 
ROADMAP.md
ROADMAP.md
 
 
SECURITY.md
SECURITY.md
 
 
SUPPORT.md
SUPPORT.md
 
 
THIRD_PARTY_NOTICES.md
THIRD_PARTY_NOTICES.md
 
 
docker-compose.yml
docker-compose.yml
 
 
mkdocs.yml
mkdocs.yml
 
 
package-lock.json
package-lock.json
 
 
package.json
package.json
 
 
tsconfig.base.json
tsconfig.base.json
 
 

Repository files navigation

KinTunnel

CI Docs Security License

KinTunnel is a Docker-based manager for a WireGuard server on one VPS. You add a peer per person or device, hand out a QR code or config file, and revoke access from a token-protected admin UI.

KinTunnel admin dashboard showing peer list, engine health, and recent activity

Why KinTunnel

  • One VPS, one WireGuard server, one peer per person or device.
  • QR-code and config-based onboarding.
  • A private admin UI for lifecycle work.
  • Docker Compose first, with a Dokploy/Swarm reference for single-node deployments.

You run it yourself. There is no hosted service, and the project stays out of mesh networking, zero-trust suites and wg-easy territory.

Current Status

KinTunnel has a runnable TypeScript MVP.

Area Status
Engine API Health, status, peer lifecycle, config export, audit events, and reconcile endpoints.
Admin UI Token login, peer list, peer creation, QR rendering, config download, revoke, delete, and recent activity.
Docker Engine and admin Dockerfiles, Compose model, minimal VPS overlay, and Dokploy/Swarm reference.
Tests Unit and process-level integration coverage for the dry-run runtime.
Safe default KINTUNNEL_DRY_RUN=true, which validates state and renders configs without changing host networking.
Backup + restore Atomic snapshots under /backups/, sha256 integrity, retention pruner, safety snapshot before restore, POST /v1/backups family of endpoints.
Deep health 7-check HealthReport (tun, forwarding, interface, nat, iptables, port, state_io), returns 503 when any required check fails.
Apply path wg syncconf warm sync + ip link cold-start bootstrap + drift detection + rollback. Replaces the prior "intentionally deferred" seam.
NAT + firewall policy MASQUERADE + FORWARD chain rules via iptables, idempotent -C pre-check, comment-marker rollback.
Structured logging NDJSON logs with KINTUNNEL_LOG_LEVEL filtering.
Prometheus /metrics Counters + gauges + histograms at /metrics.
Persistent audit log NDJSON with size-based rotation, queryable via GET /v1/audit?action=&actor=&since=.
Live VPS validation Requires a self-hosted CI runner with /dev/net/tun access.

The dry-run safe default remains. The engine apply path, NAT/firewall policy, backup/restore, and deep health are implemented and unit-tested. The only remaining gap is live VPS validation in CI, which requires a self-hosted runner with /dev/net/tun access. See docs/operations.md for the manual verification runbook.

Quick Start

Run the engine and admin UI locally in dry-run mode:

git clone https://github.com/PascalAI2024/kintunnel.git
cd kintunnel
npm ci
npm test
KINTUNNEL_ENV=development KINTUNNEL_DRY_RUN=true KINTUNNEL_ENGINE_API_TOKEN=dev-engine-token-change-me KINTUNNEL_ENGINE_PORT=9090 npm run dev:engine

In another shell:

KINTUNNEL_ENV=development KINTUNNEL_ADMIN_TOKEN=dev-admin-token-change-me KINTUNNEL_ENGINE_API_TOKEN=dev-engine-token-change-me KINTUNNEL_ENGINE_URL=http://127.0.0.1:9090 npm run dev:admin

Open http://127.0.0.1:8080 and sign in with the token.

The npm test step covers the admin UI and the process-level integration tests everywhere. The engine suite drives temporary files under /var/run/kintunnel, so run the full suite on Linux or WSL.

Docker From Source

cp .env.example .env
mkdir -p config/secrets
openssl rand -base64 32 > config/secrets/admin-token.txt
openssl rand -base64 32 > config/secrets/engine-api-token.txt
docker compose --profile admin build
docker compose --profile admin up -d
docker compose ps

For the MVP, leave KINTUNNEL_DRY_RUN=true unless you are deliberately testing host networking on a Linux VPS.

Architecture

flowchart LR
    devices["Family devices<br>WireGuard clients"] --> tunnel["WireGuard UDP tunnel"]
    tunnel --> engine["KinTunnel engine<br>state, config, reconcile"]
    admin["Admin browser"] --> ui["KinTunnel admin UI"]
    ui --> engine
    engine --> store["Persistent JSON state<br>server keys, peers, audit events"]
    engine --> wg["Standard WireGuard tooling"]
    wg --> internet["Internet via VPS public IP"]
Loading

Design principles:

  • Keep the VPN data plane boring and standard.
  • Keep the admin plane private, authenticated, and auditable.
  • Prefer explicit single-node deployment over accidental clustered VPN state.
  • Treat generated peer configs as sensitive material.

VPS Requirements

Minimum host expectations for non-dry-run testing:

  • Linux VPS with Docker Engine.
  • UDP port for WireGuard, commonly 51820/udp.
  • HTTPS reverse proxy or SSH tunnel for the admin UI.
  • /dev/net/tun available to the engine container.
  • IPv4 forwarding and firewall/NAT configured on the host.

Host checks:

test -c /dev/net/tun
sysctl net.ipv4.ip_forward

Backup and Restore

Snapshots live under /backups/ inside the engine container and persist on the kintunnel-backups named volume. Every snapshot carries a SHA-256 manifest and a safety snapshot is taken automatically before any restore.

# Create a snapshot
curl -X POST -H "Authorization: Bearer $KINTUNNEL_ENGINE_API_TOKEN" \
     http://localhost:9090/v1/backups \
     -H "Content-Type: application/json" -d '{"trigger":"manual"}'

# List snapshots
curl -H "Authorization: Bearer $KINTUNNEL_ENGINE_API_TOKEN" \
     http://localhost:9090/v1/backups

# Restore
curl -X POST -H "Authorization: Bearer $KINTUNNEL_ENGINE_API_TOKEN" \
     http://localhost:9090/v1/backups/snap-<id>/restore \
     -H "Content-Type: application/json" -d '{}'

See docs/operations.md for the full runbook.

Observability

  • /health — Deep health report. Returns 503 if any required check fails. Inspect checks[] for which probe failed.
  • /v1/health — Token-gated equivalent of /health. Same shape.
  • /v1/capabilities — Static capability inventory (hasWg, hasWgQuick, hasTun, hasIptables, ipForward, etc).
  • /metrics — Prometheus text exposition. Counters, gauges, histograms for peer lifecycle, reconcile runs, apply duration, backup operations.
  • /v1/audit?action=&actor=&since= — Queryable persistent audit log (NDJSON, size-rotated).
  • Structured NDJSON logs to stdout, filtered by KINTUNNEL_LOG_LEVEL (debug / info / warn / error).

See docs/operations.md for scrape configs and example queries.

Documentation

Full docs are published at pascalai2024.github.io/kintunnel. The same source renders directly on GitHub:

  • Quick Start
  • Docker Compose Installation
  • Dokploy Swarm Installation
  • Architecture
  • Operations Runbook
  • Security Model
  • Privilege Model
  • Brand
  • Release Checklist
  • Roadmap
  • Changelog
  • Contributing

The research memo is retained as a historical note: VPN Research Memo.

Security Summary

This project manages VPN access, so the admin UI and the peer configs deserve the same care as any other private key.

  • Create one peer per person or device.
  • Revoke lost devices immediately.
  • Do not share peer profiles across users.
  • Keep the admin UI behind HTTPS, IP allowlisting, an SSH tunnel, or an identity-aware proxy.
  • Back up the config volume securely.
  • Remember that traffic exits through the VPS public IP. The VPS owner remains responsible for provider terms, abuse reports, and local law.

See SECURITY.md for reporting guidance. Vulnerabilities should be reported through GitHub private vulnerability reporting, not public issues.

Trademark Notice

WireGuard is a registered trademark of Jason A. Donenfeld. KinTunnel is not affiliated with, endorsed by, sponsored by, or approved by Jason A. Donenfeld or the WireGuard project.

The KINTUNNEL_* environment variable namespace is used for deployment configuration.

License

Licensed under the Apache License, Version 2.0. See LICENSE.

About

Self-hosted WireGuard access for people you trust

pascalai2024.github.io/kintunnel/

Topics

dockerdocker-composedokployhomelabself-hostedtypescriptvpnwireguard

Resources

Readme
Apache-2.0 license

Code of conduct

Code of conduct

Contributing

Contributing

Security policy

Security policy
Activity

Stars

0 stars

Watchers

0 watching

Forks

0 forks
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.