···11# knot
2233-OCI Container to run your own [tangled](https://tangled.org) [knot](https://tangled.org/@tangled.org/core/blob/master/docs/knot-hosting.md) and host the data of your own repositories.
33+OCI Container to run your own [tangled](https://tangled.org) [knot](https://docs.tangled.org/knot-self-hosting-guide.html) and host the data of your own repositories.
4455## Pre-built Images
6677-Pre-built images are available in an ATCR [repository](https://atcr.io/r/bram.gotink.be/knot) starting at `v1.10.0-alpha`.
77+Pre-built images are available in an ATCR [repository](https://atcr.io/r/bram.gotink.be/knot) starting at `v1.12.0-alpha`.
8899```sh
1010docker pull atcr.io/bram.gotink.be/knot
···1313This image differs from the pseudo-official [tngl/knot](https://hub.docker.com/r/tngl/knot) image.
1414The code is the same, but the image is set up differently:
15151616-- Run everything using a non-root user
1616+- It is designed to be run with a non-root user (userid 10999), although root works just fine if you prefer
1717- Allow the OCI runtime to restart the container if anything fails, rather than package an entire init system that manages these programs
18181919## Building The Image
20202121```sh
2222-docker build --platform linux/amd64,linux/arm64 -t atcr.io/bram.gotink.be/knot --build-arg VERSION=v1.10.0-alpha .
2222+docker build --platform linux/amd64,linux/arm64 -t atcr.io/bram.gotink.be/knot --build-arg VERSION=v1.13.0-alpha .
2323```
24242525## Setting Up The Image
26262727-This image is designed to work with kubernetes.
2828-It requires three `volumeMounts`:
2727+This image is designed to work with stricter permissions in e.g. kubernetes.
2828+2929+The container requires three volumes:
3030+3131+| Environment variable | Default value | Usage |
3232+| --------------------- | --------------------- | ----------------------------------------------------- |
3333+| `KNOT_REPO_SCAN_PATH` | `/repositories` | storage directory the repositories |
3434+| `KNOT_SERVER_DB_PATH` | `/data/knotserver.db` | the sqlite database, should be placed inside a volume |
3535+| `KNOT_SSH_KEYS_PATH` | `/ssh-keys` | directory in which to store SSH host keys |
29363030-- `/repositories` for the repositories
3131-- `/data` for the database
3232-- `/ssh-keys` for the SSH host keys
3737+Two environment variables are required:
33383434-The first two can be configured using `KNOT_REPO_SCAN_PATH` (default `/repositories`) and `KNOT_SERVER_DB_PATH` (default `/data/knotserver.db`).
3535-The latter cannot be changed, and it _must_ be a folder with strict permissions.
3939+| Environment variable | Usage |
4040+| ---------------------- | ------------------------------------------------------------------------------ |
4141+| `KNOT_SERVER_HOSTNAME` | Domain name of the server (`example.com`) |
4242+| `KNOT_SERVER_OWNER` | Did of the owner (user account) of the knot server (`did:plc:yourdidgoeshere`) |
36433744The container listens on two ports:
3845- 5555 handles HTTP traffic and should be mapped onto port 443