This document provides information for those interested in hacking on or contributing to SourceHut.


Here are some tips to expedite the installation procedure:

  • A PostgreSQL database and Redis server are always required.
  • Some services require (or may optionally make use of) an S3-compatible storage backend. Minio is recommended for this purpose.
  • Generally, you can skip the webhooks daemons unless you need them.
  • Always prefer package installations for obtaining dependencies.
  • You can usually get away without configuring the outgoing mail settings, but you may still have to generate a PGP key to get things started up.
  • You can skip setting up a reverse proxy and use our development servers via python3 instead.
  • Some services depend on other services. Some such integrations are optional, but all services depend on
Dev dependencies

In addition to the runtime dependencies of our packages, building packages from source requires additional build-time dependencies:

  • sassc for CSS pre-processing
  • minify for minifying CSS
  • go for compiling the Go APIs
  • make for making
Generic instructions

Do this once, when starting with

  • Check out and Make sure to clone with --recurse-submodules.
  • Copy's config.example.ini to config.ini and configure everything following the instructions in the comments.

When filling in the config.ini file, remember the following:

  • Some of the comments will ask you to run programs such as srht-keygen — these can be found in the repository.
  • If you do not have SSL enabled for Postgres, be sure to add ?sslmode=disable to the end of your Postgres URL.

Then, for each SERVICE (e.g.

  • export SRHT_PATH=/path/to/
  • export PYTHONPATH=/path/to/$SERVICE
  • make all

To avoid conflicts with the email package, you should now unset PYTHONPATH.

Note that is not a service, but merely a repository of code shared between services.

For each service except

  • Copy the service's section(s) from its config.example.ini into's config.ini, modifying it according to the comments.
  • ln -s /path/to/ config.ini

For each SERVICE:

  • createdb $SERVICE (e.g. createdb
  • psql -d $SERVICE -f schema.sql (e.g. psql -d -f schema.sql)

To run a service:

  • ./api/api (must be run before the following command)
  • python3

For the APIs to be able to talk to each other, you need to correctly register each service as a client. You will find more instructions on the page, as well as in the OAuth Reference. After you have created the OAuth clients, find each respective database entry in the oauthclient table, and set the preauthorized column to TRUE for each one.

Sending Patches

We use git send-email and discuss patches (and other development topics) on the list. Please send your patches and development questions there.

About this wiki

commit 6778928f971ff2e3f4628b7a47c6f6b433c2b11d
Author: Shulhan <>
Date:   2024-06-08T02:18:59+07:00 remove duplicate DELETE API for repos
Clone this wiki (read-only) (read/write)