www/mycorrhiza/pkg/README (view raw)
1+-------------------------------------------------------------------------------
2| Running ${PKGSTEM} on OpenBSD
3+-------------------------------------------------------------------------------
4
5Initial setup
6=============
7
8By default, Mycorrhiza listens on localhost:1737. To make it reachable
9as a web service, it needs to be put behind a TLS terminating proxy.
10Here's a sample httpd(8) and relayd(8) configuration provided for
11reference:
12
13/etc/httpd.conf:
14
15 server "mycorrhiza.example.com" {
16 listen on * port http
17 location "/.well-known/acme-challenge/*" {
18 root "/acme"
19 request strip 2
20 }
21 location "*" {
22 block return 302 "https://$HTTP_HOST$REQUEST_URI"
23 }
24 }
25
26
27/etc/relayd.conf:
28
29 ext_ip="123.45.67.89"
30 ext_ip6="1234:5678:dead:beef"
31 mycorrhiza_port="1737"
32 table <mycorrhiza> { 127.0.0.1 ::1 }
33
34 http protocol https {
35 match request header append "X-Forwarded-For" \
36 value "$REMOTE_ADDR"
37 match request header append "X-Forwarded-By" \
38 value "$SERVER_ADDR:$SERVER_PORT"
39 match request header set "Connection" value "close"
40
41 match request header "Host" value "mycorrhiza.*" \
42 forward to <mycorrhiza>
43
44 tcp { sack, backlog 128 }
45 tls keypair mycorrhiza.example.com
46 }
47
48 relay https {
49 listen on $ext_ip port https tls
50 listen on $ext_ip6 port https tls
51 protocol https
52 forward to <mycorrhiza> port $mycorrhiza_port check tcp
53 }
54
55Don't forget to set up a TLS certificate (for example using
56acme-client(1)) and start httpd(8) and relayd(8):
57
58 # rcctl enable httpd relayd
59 # rcctl start httpd relayd
60
61
62Setup
63=====
64
65See the official documentation for details about configuration and
66deployment. Be sure to set up proper authentication.
67
68By default the wiki will be created in ${LOCALSTATEDIR}/mycorrhiza, but
69it's possible to change it by overwriting the daemon flags with rcctl(8)
70
71 # rcctl set mycorrhiza flags '/path/to/wiki/dir'
72
73Finally, enable and start the daemon:
74
75 # rcctl enable mycorrhiza
76 # rcctl start mycorrhiza