mirror of
https://github.com/BetterCorp/BetterTunnels.git
synced 2026-07-25 14:54:50 +00:00
No description
- TypeScript 71.5%
- Go 27.1%
- JavaScript 1.4%
Reject bearer tokens used outside a trusted hashed network range. Require browser re-authentication before enrolling a new range. Trusted ranges expire after one year of inactivity. Includes the ClientTrustedIpRange database migration and lets tunnel creators bypass visitor verification from their exact originating IP. |
||
|---|---|---|
| .github/workflows | ||
| cli | ||
| logos | ||
| prisma | ||
| scripts | ||
| src | ||
| tests | ||
| .dockerignore | ||
| .env.example | ||
| .gitignore | ||
| betterportal-logo.png | ||
| bsb-plugin.json | ||
| Caddyfile | ||
| docker-compose.yml | ||
| docker-stack.yml | ||
| Dockerfile.caddy | ||
| package-lock.json | ||
| package.json | ||
| prisma.config.ts | ||
| README.md | ||
| sec-config.yaml | ||
| SPEC.md | ||
| tsconfig.json | ||
BetterTunnels
HTTP/HTTPS development tunnels using BSB, H3, AnyVali, websocket clients, Prisma, and PostgreSQL 18.
Dev Setup
npm install
copy .env.example .env
npm run prisma:generate
npm run build
Start PostgreSQL 18 with the included compose file when Docker is available:
docker compose up -d postgres
npm run prisma:migrate
Run the server:
npm run dev
Server startup goes through BSB. Do not start a standalone src/server.ts.
Run a tunnel:
npm run cli -- http 3300
Build the release CLI:
cd cli
go build -o ..\dist\btunnel.exe .
Notes
- Default domain:
tunnels.betterportal.dev. - Anonymous configured prefixes are ignored.
- Authenticated prefix handling is designed but auth is not in the first runtime slice.
- The H3/WS runtime is owned by the
service-tunnels-proxyBSB plugin. - The release CLI lives in
cli/and builds to single-file Go binaries for Windows, Linux, and macOS.
Docker
Build the BSB runtime image with this plugin preloaded:
docker build -t better-tunnels:dev .
Run it with a production DATABASE_URL:
docker run --rm -p 8080:8080 -p 8081:8081 -e DATABASE_URL="postgresql://..." better-tunnels:dev
Swarm Deploy
On the server, build local images, run migrations, then deploy the stack:
docker swarm init
docker build -t bettertunnels-app:latest .
docker build -t bettertunnels-migrate:latest --target build .
docker build -t bettertunnels-caddy:latest -f Dockerfile.caddy .
docker stack deploy -c docker-stack.yml bettertunnels
app runs two replicas with start-first rolling updates. Caddy and Postgres are singletons on this one-node swarm. The stack reuses the original Compose volumes by external name.