+11
.gitignore
+11
.gitignore
+8
Caddyfile
+8
Caddyfile
+40
Dockerfile
+40
Dockerfile
···
1
+
from golang:1.24-alpine as builder
2
+
env KNOT_REPO_SCAN_PATH=/home/git/repositories
3
+
env CGO_ENABLED=1
4
+
5
+
arg TAG='v1.11.0-alpha'
6
+
7
+
workdir /app
8
+
run apk add git gcc musl-dev
9
+
run git clone -b ${TAG} https://tangled.org/@tangled.org/core .
10
+
run go build -o /usr/bin/knot -ldflags '-s -w -extldflags "-static"' ./cmd/knot
11
+
12
+
from alpine:edge
13
+
expose 5555
14
+
expose 22
15
+
16
+
label org.opencontainers.image.title='knot'
17
+
label org.opencontainers.image.description='data server for tangled'
18
+
label org.opencontainers.image.source='https://tangled.org/@tangled.org/knot-docker'
19
+
label org.opencontainers.image.url='https://tangled.org'
20
+
label org.opencontainers.image.vendor='tangled.org'
21
+
label org.opencontainers.image.licenses='MIT'
22
+
23
+
arg UID=1000
24
+
arg GID=1000
25
+
26
+
copy rootfs .
27
+
run chmod 755 /etc
28
+
run chmod -R 755 /etc/s6-overlay
29
+
run apk add shadow s6-overlay execline openssl openssh git curl bash
30
+
run groupadd -g $GID -f git
31
+
run useradd -u $UID -g $GID -d /home/git git
32
+
run openssl rand -hex 16 | passwd --stdin git
33
+
run mkdir -p /home/git/repositories && chown -R git:git /home/git
34
+
copy --from=builder /usr/bin/knot /usr/bin
35
+
run mkdir /app && chown -R git:git /app
36
+
37
+
healthcheck --interval=60s --timeout=30s --start-period=5s --retries=3 \
38
+
cmd curl -f http://localhost:5555 || exit 1
39
+
40
+
entrypoint ["/init"]
+7
README.md
+7
README.md
+95
caddy/index.html
+95
caddy/index.html
···
1
+
<!DOCTYPE html>
2
+
<html lang="en">
3
+
<head>
4
+
<meta charset="UTF-8" />
5
+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
6
+
7
+
<meta name="title" content="girl on the moon :: moirai" />
8
+
<meta name="description" content="girl on the moon :: tngl knot" />
9
+
<meta name="author" content="girlonthemoon.xyz" />
10
+
<meta property="og:title" content="girl on the moon :: moirai" />
11
+
<meta property="og:description" content="girl on the moon tngl knot" />
12
+
<meta property="og:type" content="website" />
13
+
<meta property="og:url" content="https://bsky.girlonthemoon.xyz" />
14
+
<meta property="og:image" content="https://stash.4-walls.net/pics/Kamen-Rider-Gotchard-Sisters.jpg" />
15
+
16
+
<link rel="canonical" href="https://moirai.girlonthemoon.xyz" />
17
+
<link rel="icon" type="image/png" sizes="16x16" href="https://stash.4-walls.net/pics/Kamen-Rider-Gotchard-Sisters.jpg" />
18
+
19
+
<title>moirai</title>
20
+
21
+
<style>
22
+
@import url(https://fonts.bunny.net/css?family=victor-mono:100,100i,700,700i);
23
+
24
+
:root {
25
+
--font: "Victor Mono", monospace;
26
+
--main-color: #00b0eb;
27
+
}
28
+
29
+
html {
30
+
line-height: 1.45;
31
+
}
32
+
33
+
::selection {
34
+
background-color: var(--main-color);
35
+
color: white;
36
+
}
37
+
38
+
pre {
39
+
font-family: var(--font);
40
+
font-size: 0.9rem;
41
+
margin-block-start: 0;
42
+
max-width: 60ch;
43
+
}
44
+
45
+
a {
46
+
text-underline-offset: .3rem;
47
+
color: var(--main-color);
48
+
}
49
+
50
+
a:hover {
51
+
text-decoration: none;
52
+
text-shadow: none;
53
+
}
54
+
</style>
55
+
</head>
56
+
57
+
<body>
58
+
59
+
<pre>
60
+
<div aria-label="ASCII text art of a pegasus" role="img">
61
+
. . . .
62
+
,`,`,`,`,
63
+
. . . . `\`\`\`\;
64
+
`\`\`\`\`, ~|;!;!;\!
65
+
~\;\;\;\|\ (--,!!!~`! .
66
+
(--,\\\===~\ (--,|||~`! ./
67
+
(--,\\\===~\ `,-,~,=,:. _,//
68
+
(--,\\\==~`\ ~-=~-.---|\;/J,
69
+
(--,\\\((```==. ~'`~/ a |
70
+
(-,.\\('('(`\\. ~'=~| \_. \
71
+
(,--(,(,(,'\\. ~'=| \\_;>
72
+
(,-( ,(,(,;\\ ~=/ \
73
+
(,-/ (.(.(,;\\,/ )
74
+
(,--/,;,;,;,\\ ./------.
75
+
(==,-;-'`;' /_,----`. \
76
+
,.--_,__.-' `--. ` \
77
+
(='~-_,--/ , ,!,___--. \ \_)
78
+
(-/~( | \ ,_- | ) /_|
79
+
(~/((\ )\._, |-' _,/ /
80
+
\\)))) / ./~. | \_\;
81
+
,__///// / / ) /
82
+
'===~' | | (, <.
83
+
/ / \. \
84
+
_/ / \_\
85
+
/_!/ >_\
86
+
</div>
87
+
the spinner, measurer, and severer: welcome to <i>moirai</i> <span aria-hidden="true">~</span>
88
+
this is a self-hosted <dfn>knot</dfn> (repository server) for <a href="https://tangled.org/">tangled.org</a> <span aria-hidden="true">~</span>
89
+
90
+
kat PDS: <a href="https://katproto.girlonthemoon.xyz">katproto.girlonthemoon.xyz</a>
91
+
kat homepage: <a href="https://girlonthemoon.xyz">girlonthemoon.xyz</a>
92
+
93
+
</pre>
94
+
95
+
</html>
+25
docker-compose.yml
+25
docker-compose.yml
···
1
+
services:
2
+
knot:
3
+
build: .
4
+
env_file: knot.env
5
+
volumes:
6
+
- ./keys:/etc/ssh/keys
7
+
- ./repositories:/home/git/repositories
8
+
- ./server:/app
9
+
ports:
10
+
- "5555:5555"
11
+
- "2224:22"
12
+
restart: always
13
+
frontend:
14
+
image: caddy:alpine
15
+
depends_on:
16
+
- knot
17
+
ports:
18
+
- ${KNOT_SERVER_PORT:-443}:443
19
+
- ${KNOT_SERVER_PORT:-443}:443/udp
20
+
volumes:
21
+
- ./caddy_data:/data
22
+
- ./Caddyfile:/etc/caddy/Caddyfile
23
+
- ./caddy:/var/www/moirai/caddy
24
+
restart: always
25
+
profiles: ["caddy"]