Skip to content

rhencke/confusio

Repository files navigation

confusio

confusio linguarum — the confusion of tongues.

A GitHub API shim — REST and GraphQL — that translates requests to other git hosting providers under the hood.

What it is

GitHub's API is the lingua franca of git hosting tools. Other providers speak their own dialects. Confusio stands in the middle, translating.

It implements both the GitHub REST API (GET /repos/{owner}/{repo}, etc.) and the GitHub GraphQL API (POST /graphql), routing each request to the equivalent call on the configured backend. Queries, mutations, Relay pagination, introspection, and batch requests are all supported.

Built with Redbean — a single-file web server containing a Lua interpreter, distributed as a self-extracting zip.

Prerequisites

  • make, zip, curl — needed to build and run tests
  • bash — needed to run tests

Quick start

1. Build

git clone https://github.com/rhencke/confusio
cd confusio
make build       # produces confusio.com

2. Run

# Cloud-hosted providers — base URL defaults to the well-known public instance
sh ./confusio.com -p 8080 -- gitea
sh ./confusio.com -p 8080 -- gitlab
sh ./confusio.com -p 8080 -- forgejo

# Self-hosted instance — supply your own base URL
sh ./confusio.com -p 8080 -- gitea https://my-gitea.example.com
sh ./confusio.com -p 8080 -- gitlab https://gitlab.example.com

3. Point your tools at it

Set your tool's GitHub API base URL to http://localhost:8080 and provide your provider token in the Authorization header (same format as GitHub: token <pat>).

Configuration

Config is supplied as positional CLI arguments after --:

sh ./confusio.com -p 8080 -- <backend> [base_url]
# Use provider default URL
sh ./confusio.com -p 8080 -- gitea

# Override the URL (self-hosted instance)
sh ./confusio.com -p 8080 -- gitea https://my-gitea.example.com

Providers

Provider backend value Default base_url Auth: pass as token
Azure DevOps azuredevops (required: https://dev.azure.com/{org}) Personal access token (see note)
Bitbucket bitbucket https://api.bitbucket.org user:app-password (see note)
Bitbucket Datacenter bitbucket_datacenter (self-hosted — required) user:password (see note)
Codeberg codeberg https://codeberg.org API token
Forgejo forgejo https://codeberg.org API token
Gerrit gerrit (self-hosted — required) user:http-password (see note)
Gitbucket gitbucket (self-hosted — required) API token
Gitea gitea https://gitea.com API token
GitLab gitlab https://gitlab.com Personal access token
Gogs gogs https://try.gogs.io API token
Harness Code harness https://app.harness.io API token
Kallithea kallithea (self-hosted — required) API token
Launchpad launchpad https://api.launchpad.net (public endpoints only)
NotABug notabug https://notabug.org API token
OneDev onedev https://code.onedev.io API token
Pagure pagure https://pagure.io API token
Phabricator phabricator (self-hosted — required) (public endpoints only)
Radicle radicle http://127.0.0.1:8080 Bearer token
RhodeCode rhodecode (self-hosted — required) API token
SourceForge sourceforge https://sourceforge.net (public endpoints only)
Sourcehut sourcehut https://git.sr.ht Personal access token

Notes on auth format:

  • Azure DevOps: pass your PAT as token <pat> — confusio re-encodes it as Basic base64(:<pat>).
  • Bitbucket / Gerrit / Bitbucket Datacenter: pass user:password (or user:app-password) as token user:password — confusio re-encodes it as Basic base64(user:password).
  • All other providers: pass your token as token <value> (same header format as GitHub).

Auth passthrough

Confusio never stores or logs tokens. The raw token value passes through unchanged; only the scheme wrapper is adjusted:

Provider group Confusio sends
Gitea, Forgejo, Gogs, Codeberg, NotABug, Pagure, Sourcehut Authorization: token <value>
GitLab, OneDev, RhodeCode, Kallithea, Gitbucket, Harness, Radicle Authorization: Bearer <value>
Azure DevOps Authorization: Basic base64(:<value>)
Bitbucket, Gerrit, Bitbucket Datacenter Authorization: Basic base64(<value>)
SourceForge, Launchpad, Phabricator (no auth forwarded)

Status

Active. REST and GraphQL APIs are implemented and tested across 24 backends. GraphQL support covers queries, mutations, Relay pagination, batch requests, and introspection — all phases of the GraphQL roadmap are complete.

Compatibility

See the full compatibility matrix on the project landing page.

Testing

Unit tests run against mock backends on every push. See docs/real-world-testing.md for the plan to extend coverage to real provider instances on a weekly cadence.

Design docs

Topic Document
GraphQL support (overview) docs/graphql/README.md
GitHub GraphQL API surface and scope docs/graphql/01-api-surface.md
Lexer and parser docs/graphql/02-lexer-parser.md
Schema loading docs/graphql/03-schema.md
Query executor docs/graphql/04-executor.md
REST translation docs/graphql/05-translation.md
Fragments, variables, directives docs/graphql/06-fragments-vars-directives.md
Relay pagination docs/graphql/07-pagination.md
Node/ID scheme docs/graphql/08-node-id.md
Error model docs/graphql/09-errors.md
Auth and rate limiting docs/graphql/10-auth-ratelimit.md
Mutations docs/graphql/11-mutations.md
Batching and caching docs/graphql/12-batching-caching.md
Testing strategy docs/graphql/13-testing.md
Per-backend feasibility docs/graphql/14-backend-feasibility.md
Compatibility site integration docs/graphql/15-compat-site.md
Rollout roadmap docs/graphql/16-roadmap.md

About

Use GitHub's REST API without GitHub

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages