aboutsummaryrefslogtreecommitdiffstats
path: root/hacking.md
blob: a63629db52cae3aa90f0bda9a77981d5865f46fe (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
---
title: Hacking on SourceHut
toc: false
---

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

# Installation

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 run.py` instead.
* Some services depend on other services. Some such integrations are optional,
  but all services depend on meta.sr.ht.

## 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
* `npm` for minifying CSS
* `go` for compiling the Go APIs

## Generic instructions

Do this once, when starting with meta.sr.ht:

* In addition to meta.sr.ht, check out
  [core.sr.ht](https://git.sr.ht/~sircmpwn/core.sr.ht)
* Copy meta.sr.ht's `config.example.ini` to `config.ini` and configure
  everything following the instructions in the comments.

Then, for each `SERVICE`:

* `export SRHT_PATH=/path/to/core.sr.ht/srht`
* `export PYTHONPATH=/path/to/core.sr.ht:/path/to/$SERVICE`
* `make all`

For each service *except* meta.sr.ht:

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

For each `SERVICE`:

* `createdb $SERVICE`
* `./$SRV-initdb` (e.g. `./metasrht-initdb`)

To run a service:

* `./api/api`
* `python run.py`

# Sending Patches

We use [git send-email](https://git-send-email.io) and discuss patches (and
other development topics) on the
[sr.ht-dev](https://lists.sr.ht/~sircmpwn/sr.ht-dev) list. Please send your
patches and development questions there.