Skip to content
wildfirebill edited this page Jul 20, 2026 · 2 revisions

hub2lab

Bidirectional GitHub ↔ GitLab repository sync service

hub2lab is a self-hosted HTTP service that listens for webhooks from GitHub and GitLab and mirrors repository events between them. It handles pushes, branch and tag creation/deletion, and repository lifecycle events with built-in loop prevention and safety guarantees.

Features

  • Bidirectional sync — pushes, branches, tags, and repo events flow both ways between platforms
  • Loop prevention — commits from hub2lab include a marker string; webhooks containing that marker are silently dropped
  • Auto-sync mode — omit repos in mapping.json to sync every repo in an org/group
  • Explicit mapping — per-repo control when names differ between sides
  • Dockerized — docker pull ghcr.io/wildfirebill-docker/hub2lab with healthcheck
  • Unraid ready — community app template included
  • Self-hosted — deploy on any VPS, NAS, or homelab with Node.js ≥ 20
  • Webhook security — HMAC-SHA256 (GitHub) and shared secret (GitLab) verification
  • File logging — configurable Winston logger with rotation, 10 MB per file, 5 retained
  • Repository lifecycle — auto-create repos on GitLab when created on GitHub

Quick Start

# Pull the Docker image
docker pull ghcr.io/wildfirebill-docker/hub2lab:latest

# Create config files
mkdir -p /opt/hub2lab
cp mapping.example.json /opt/hub2lab/mapping.json
# Edit mapping.json and set up .env

# Run
docker run -d \
  --name hub2lab \
  -p 3000:3000 \
  -v /opt/hub2lab/.env:/app/.env \
  -v /opt/hub2lab/mapping.json:/app/mapping.json \
  ghcr.io/wildfirebill-docker/hub2lab:latest

Architecture

GitHub push → hub2lab → GitLab API (create branch, push files, etc.)
GitLab push → hub2lab → GitHub API (create branch, push files, etc.)

hub2lab runs as an Express HTTP server with three endpoints:

  • POST /webhook/github — receives GitHub webhook events
  • POST /webhook/gitlab — receives GitLab webhook events
  • GET /health — health check

See the Architecture page for details.

Project Repository

Clone this wiki locally