Docs
Repositories

Connectors for private networks

A connector lets CodeBeast reach a self-hosted GitLab that isn't reachable from the internet. You run it inside your network, next to your GitLab. It dials out to CodeBeast, so you don't need to open an inbound firewall port, set up a VPN or publish DNS.

How it works

  • The connector opens an outbound TLS connection to CodeBeast on port 8446.
  • CodeBeast sends git and API traffic for your instance through that link, and the connector forwards it to your GitLab.
  • TLS stays end-to-end between CodeBeast and your GitLab. The tunnel carries encrypted bytes it can't read.
  • Both sides pin the target. The connector only forwards to hosts on your allow-list, and CodeBeast only sends traffic for the instance URL of the matching git connection. The connector can't be used to reach anything else on your network.

Set up a connector Admin only

  1. Open Repositories and scroll to Connectors. Click New connector.

  2. Enter a Connector name (for example datacenter-east) and click Create connector.

  3. Copy the registration token. It's shown once — if you lose it, click New token to issue another.

  4. Copy the command shown under the token and run it on a machine inside your network that can reach your GitLab. It looks like this, with your token and CodeBeast's gateway address already filled in:

    sh
    docker run -d --restart unless-stopped \
      -v codebeast-connector-state:/state \
      -e DHQF_GATEWAY=<gateway host>:8446 \
      -e DHQF_CONNECTOR_TOKEN=<token> \
      -e DHQF_ALLOW=<your-gitlab-host>:443 \
      dronahq/codebeast-connector:1.0.0

    Replace <your-gitlab-host> with your GitLab's hostname.

  5. Wait for the connector to show online. The list refreshes every 30 seconds.

  6. Connect your GitLab with Access set to Via connector (private instance) and pick this connector.

The hostname must match exactly

The host in DHQF_ALLOW must be identical to the host in the GitLab Instance URL you enter when connecting. If they differ, every request is refused even though the connector shows online.

Without Docker

A static binary is available for VMs and bare-metal hosts. It takes the same values as flags:

sh
codebeast-connector \
  --gateway <gateway host>:8446 \
  --token <token> \
  --allow <your-gitlab-host>:443

The binary stores its secret in ~/.dhqfactory-connector.

Settings reference

Env varFlagMeaning
DHQF_GATEWAY--gatewayCodeBeast gateway as host:port. No https:// — a scheme breaks the connection.
DHQF_CONNECTOR_TOKEN--tokenThe one-time registration token. Only needed on the first run.
DHQF_ALLOW--allowHosts the connector may forward to, as host:port. Comma-separated (env) or repeat the flag.
DHQF_STATE_DIR--state-dirWhere the long-lived secret is stored. /state in the Docker image.

On its first connection the connector swaps the registration token for a long-lived secret and saves it in the state volume. Later restarts don't need the token.

Tip

Pin the image version (for example :1.0.0) rather than using latest, so upgrades happen when you choose.

Status

BadgeMeaning
awaiting first dialCreated, but the connector hasn't connected yet.
onlineAt least one replica is connected. The card shows the replica count, version and the hosts it serves.
offlineNo replica is connected. The card shows when it was last seen.
revokedThe connector was revoked and can't connect again.

High availability

Run more than one replica with the same state volume (the same secret). CodeBeast spreads traffic across live replicas and fails over when one drops, so restarting a connector doesn't interrupt a running task.

HTTP-only GitLab

Connector access needs an https instance URL, because TLS runs end-to-end through the tunnel. If your GitLab only speaks plain HTTP, or its hostname isn't in DNS, put a small TLS proxy (Caddy) in front of it on the connector machine. The full recipe is in the CodeBeast UI under My GitLab is HTTP-only, or its hostname isn't in DNS, below the token. In short:

  1. Pick a hostname, for example gitlab.yourco.com. It needs no DNS record.
  2. Run Caddy with tls internal, proxying that hostname to your GitLab's HTTP address.
  3. Put Caddy and the connector on a shared Docker network, with the hostname as Caddy's network alias.
  4. Set DHQF_ALLOW=gitlab.yourco.com:443.
  5. Connect GitLab with instance URL https://gitlab.yourco.com, access Via connector, TLS Custom CA bundle, and paste Caddy's root certificate.

The chosen hostname must be identical in four places: the Caddyfile site, the network alias, DHQF_ALLOW and the instance URL.

Rotate or remove a connector Admin only

  • New token issues a fresh registration token, for example to register a new machine.
  • Revoke (or Remove, if nothing uses it) disconnects the connector permanently. Git connections that use it stop working until you point them at another connector.