aboutsummaryrefslogtreecommitdiffstats
path: root/sr.ht/configuration_reference.md
blob: 1d6987697b674ed0acf948f333f97760057b1f4c (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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
---
title: Configuration Reference
---

This document covers the configuration options common to all sr.ht
services.

# sr.ht

Configuration options that apply to all sr.ht services.

## site-name

The name of your network of sr.ht-based sites.

```ini
[sr.ht]
site-name=sourcehut
```

## site-info

Top-level information page for your site.

```ini
[sr.ht]
site-info=sourcehut
```

## site-blurb

A catchy one-liner describing your site.

```ini
[sr.ht]
site-blurb=the hacker's forge
```

## environment

The environment name, e.g. `production` or `development`. `production` is
recommended for live user-facing installations.

```ini
[sr.ht]
environment=development
```

## owner-name

Name of site owner.

```ini
[sr.ht]
owner-name=Drew DeVault
```

## owner-email

Email of site owner.

```ini
[sr.ht]
owner-email=sir@cmpwn.com
```

## source-url

The source code for your fork of sr.ht.

```ini
[sr.ht]
source-url=https://git.sr.ht/~sircmpwn/srht
```

**NOTICE**: SourceHut uses the AGPL license, which requires you to publish any
modifications you make to the source code under the same AGPL license.

## service-key

A secret key used to encrypt internal messages. To generate the key, run
`srht-keygen service`.

```ini
[sr.ht]
service-key=SERVICE_KEY
```

<div class="alert alert-warning">
  <strong>Warning:</strong> If you configure load balancing for a sr.ht
  service, the service keys must be consistent across all nodes of the
  service.
</div>

<div class="alert alert-info">
  <strong>Note:</strong> For asymmetric keys (i.e., a public/private key pair),
  store the private key in your <code>config.ini</code> and distribute the
  public key to any relevant parties.
</div>

## network-key

A secret key used to encrypt and sign internal service-to-service
communications. To generate the key, run `srht-keygen network`.

```ini
[sr.ht]
network-key=NETWORK_KEY
```

<div class="alert alert-warning">
  <strong>Warning:</strong> The key must be consistent across all services
  and nodes within your deployment.
</div>

## redis-host

The [Redis](https://redis.io) host URL, which is used for caching.

```ini
[sr.ht]
redis-host=
```

# webhooks

## webhook-key

A secret key used to sign webhook payloads for authenticating requests and
internal webhooks. To generate the key, run `srht-keygen webhook`.

```ini
[webhooks]
webhook-key=WEBHOOK_KEY
```

<div class="alert alert-warning">
  <strong>Warning:</strong> The key must be consistent across all services
  and nodes within your deployment.
</div>

# mail

Configuration options for outgoing emails.

## smtp-host

```ini
[mail]
smtp-host=
```

## smtp-port

```ini
[mail]
smtp-port=
```

## smtp-user

```ini
[mail]
smtp-user=
```

## smtp-password

```ini
[mail]
smtp-password=
```

## smtp-from

```ini
[mail]
smtp-from=
```

## error-to

Email address to which diagnostic application exceptions are sent.

```ini
[mail]
error-to=
```

## error-from

Email address from which diagnostic application exceptions are sent.

```ini
[mail]
error-from=
```

## pgp-privkey

## pgp-pubkey

## pgp-key-id

<div class="alert alert-warning">
  <strong>Warning:</strong> In order for sr.ht services to sign (and optionally
  encrypt) outgoing emails, you must generate a PGP key without a password.
</div>

# Proxy

Here is an example Nginx configuration for meta.sr.ht:

    server {
        listen 80;
        server_name meta.sr.ht;

        location / {
            return 302 https://$server_name$request_uri;
        }

        location ^~ /.well-known {
            root /var/www;
        }
    }

    server {
        listen 443 ssl http2;
        listen [::]:443 ssl http2;
        server_name meta.sr.ht;
        client_max_body_size 100M;
        ssl_certificate /etc/ssl/uacme/meta.sr.ht/cert.pem;
        ssl_certificate_key /etc/ssl/uacme/private/meta.sr.ht/key.pem;

        location / {
            proxy_pass http://127.0.0.1:5002;
        }

        location /static {
            root /usr/lib/python3.6/site-packages/metasrht;
        }
    }

See [sr.ht-nginx](https://git.sr.ht/~sircmpwn/sr.ht-nginx) for the nginx
configurations we use in production.