Search code examples
githubtorbadgereadme

How to display build status badge from .onion domain on GitHub?


Suppose one hosts its GitLab Server and Runners on a .onion address. How could one modify a regular build status badge:

Build Status

To a .onion status badge and display it on GitHub? E.g:

<a href="http://somelonggitlabserverdomain.onion/danielduarte/flowed"><img src="http://somelonggitlabserverdomain.onion/danielduarte/flowed.svg?branch=main" alt="Build Status"></a>

Solution

  • In general, this is going to be practically impossible to do, unless you have some sort of website which can proxy requests to .onion domains. That's because all third-party images on GitHub go through a proxy called Camo, and Camo can't resolve .onion domains because GitHub doesn't run Tor.

    Avoiding this proxy isn't possible for security and tracking reasons, and even if you could bypass it, the Content-Security-Policy header on GitHub would tell your browser not to render it.

    So the only way to make this work would be to find some domain that could proxy this image for you to something accessible in the normal DNS.