Repository navigation
Getting Started
wildfirebill edited this page Jul 20, 2026
·
1 revision
- Node.js ≥ 20 or Docker
- A GitHub Personal Access Token with
reposcope - A GitLab Personal Access Token with
apiscope - A publicly reachable server (or a tunnel like ngrok)
git clone https://github.com/wildfirebill-docker/hub2lab.git
cd hub2lab
npm installdocker pull ghcr.io/wildfirebill-docker/hub2lab:latestcp .env.example .envEdit .env with your credentials:
| Variable | Required | Default | Description |
|---|---|---|---|
PORT |
No | 3000 |
HTTP server port |
GITHUB_TOKEN |
Yes | — | GitHub PAT with repo scope |
GITHUB_WEBHOOK_SECRET |
Yes | — | Secret for verifying GitHub webhook signatures |
GITLAB_TOKEN |
Yes | — | GitLab PAT with api scope |
GITLAB_WEBHOOK_SECRET |
Yes | — | Token for verifying GitLab webhook requests |
GITLAB_BASE_URL |
No | https://gitlab.com |
GitLab instance URL (for self-hosted GitLab) |
MAPPING_FILE |
No | ./mapping.json |
Path to mapping configuration |
MIRROR_DIR |
No | ./mirrors |
Temp directory for git mirror operations |
SYNC_MARKER |
No | [hub2lab] |
Marker in commit messages to prevent loops |
LOG_DIR |
No | ./logs |
Directory for log files |
LOG_LEVEL |
No | info |
Winston log level (debug, info, warn, error) |
cp mapping.example.json mapping.jsonSee the Mapping Guide for detailed configuration options.
GitHub PAT:
- Go to GitHub → Settings → Developer settings → Personal access tokens → Fine-grained tokens
- Repository access: All repositories
- Permissions: Contents (read and write), Metadata (read-only)
- Or use a classic token with
reposcope
GitLab PAT:
- Go to GitLab → Preferences → Access Tokens
- Scopes:
api,write_repository - Create and copy the token
npm run devnpm run build
npm startdocker run -d \
--name hub2lab \
-p 3000:3000 \
-v /path/to/.env:/app/.env \
-v /path/to/mapping.json:/app/mapping.json \
ghcr.io/wildfirebill-docker/hub2lab:latestSee Docker Deployment for a docker-compose example.
curl http://localhost:3000/healthExpected response:
{"status":"ok","timestamp":"2026-07-20T13:00:00.000Z"}Once hub2lab is running:
- Set up GitHub webhooks
- Set up GitLab webhooks
- Monitor the logs for sync activity