sonarqube-badges/README.md
2025-03-15 01:49:52 +01:00

1.6 KiB

SonarQube Badges

Quality Gate

Why?

SonarQube has a feature known as badges, you must have seen those kind of badge on different kind of readme for things such as CI status, Current version or event dependencies.

SonarQube has those but for the compliance of the codebase to some standards.

However, the links that SonarQube creates contains sensitive information such as a token that can be used for various things.

That is why, I decided to make an app that hides the tokens in order to be able to publicly share those badges.

Build

In order to build this app, you will need to install Templ to compile the templates

templ generate
go build .

Configuration

This app has 3 environment variables which are the following:

  • DATA_PATH : Location of the data folder of the application that'll contain the sqlite database.
  • SECRET : A secret that'll be used to encrypt the SonarQube token in the database
  • SQ_HOST : Your SonarQube instance URL
  • PORT : The port of the web application defaults to 8080

First run

On your first run, you'll get default credentials displayed as such:

Default User: 
        - admin@example.com
        - adec2454d43489be2cdb758f645a4973ec785159546db83563dd16e6d650faa261c8b429dbdf8074f95cf4cdc118b8a21753d06412d2

You will be able to change those credential by accessing the /user path in the app and updating your profile

Docker

A docker image is available on my own Registry