mirror of
https://github.com/BetterCorp/BetterTunnels.git
synced 2026-09-23 11:59:57 +00:00
No description
- TypeScript 73.1%
- Go 25.7%
- JavaScript 1.2%
Store receipt-to-completion durations with a separate sample count so historical request totals do not skew averages. |
||
|---|---|---|
| .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.
btunnel profileshows account defaults;btunnel profile set validation cookie|ip|noneandbtunnel profile set ttl 1..168update them across CLI devices.- Authed accounts keep 24-hour IP/port URLs, junior accounts get stable short URLs and up to seven days, and senior accounts get stable unvalidated tunnels without expiry.
- 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.