Sign inSign up

lavrushin/b4hub

By lavrushin

Updated about 4 hours ago

B4 Community Hub

Image
Networking
0

349

lavrushin/b4hub repository overview

b4hub

The community hub behind b4, a DPI-circumvention service for Linux routers. b4 routers publish, rate and download shared sets through a hub. One image, two roles: serve runs a hub of your own with its moderation console, mirror runs a child of the central hub at hub.b4core.app that serves the same signed catalogue to your routers.

Tags: latest is the newest release, <version> (for example 1.0.0) a fixed one. Both are built for linux/amd64 and linux/arm64. Full documentation, the Compose bundle and the release notes: https://github.com/DanielLavrushin/b4hub

Quick start

A signing key once, then the hub:

docker run --rm -v b4hub:/var/lib/b4hub lavrushin/b4hub keygen
docker run -d --name b4hub -v b4hub:/var/lib/b4hub -p 127.0.0.1:7100:7100 \
  -e B4HUB_PUBLIC_URL=https://hub.example.net -e B4HUB_ADMIN_PASSWORD=change-me lavrushin/b4hub

The hub speaks plain HTTP on port 7100 and expects a TLS-terminating proxy in front that forwards X-Forwarded-Proto: https; the moderation console is at /admin. The Compose bundle adds a Caddy front that obtains the certificate on its own.

A child of the central hub instead of a hub of your own:

docker run -d --name b4hub -v b4hub:/var/lib/b4hub -p 127.0.0.1:7100:7100 \
  -e B4HUB_PUBLIC_URL=https://hub.example.net -e B4HUB_UPSTREAM=https://hub.b4core.app \
  lavrushin/b4hub mirror --announce

Configuration

Every flag has an environment variable:

VariableMeaningDefault
B4HUB_DATAData directory: store, signing key, payloads, published catalogue, geo files/var/lib/b4hub
B4HUB_LISTENListen address0.0.0.0:7100
B4HUB_PUBLIC_URLPublic base URL, announced to routers as the hub's addressnone
B4HUB_ADMIN_PASSWORDPassword of the moderation console; the console is off without itnone
B4HUB_UPSTREAMParent hub for the mirror rolenone
B4HUB_UPSTREAM_KEYParent key id to pin; the key compiled into b4 is trusted when unsetnone
B4HUB_TRUSTED_PROXIESAddresses or CIDRs whose X-Forwarded-For is trusted; loopback always isnone
B4HUB_GEOSITE_URL, B4HUB_GEOIP_URLSources of the geo databases, downloaded dailyv2fly and b4 GeoIP releases

Commands: serve (default), mirror, keygen, build, moderate, version.

Data and updates

Everything lives in the volume mounted at /var/lib/b4hub. hub.key in it is the signing identity that routers trust; back it up, a lost key means every router has to be pointed at a new one. The image runs as uid 7100, so a bind mount has to be owned by that uid.

Updating is docker pull lavrushin/b4hub and recreating the container; the store migrates on start. docker run --rm lavrushin/b4hub version prints the hub version and the b4 source tree it was built from.

Tag summary

Content type

Image

Digest

sha256:530d76f3c

Size

10.3 MB

Last updated

about 4 hours ago

docker pull lavrushin/b4hub