Configuration files for self-hosted Tangled knot

Initial commit

ionchy.ca 92b73ac4

+3
.gitignore
···
+
keys/
+
repositories/
+
server/
+3
.gitmodules
···
+
[submodule "knot-docker"]
+
path = knot-docker
+
url = git@tangled.sh:tangled.sh/knot-docker
+22
README.md
···
+
# Tangled.sh Knot
+
+
These are the config files for the Tangled knot hosted at [knot.ionchy.ca](https://knot.ionchy.ca).
+
+
## Docker installation
+
+
1. In `knot-docker` diretory, create Docker image with `docker build -t knot:latest --build-arg TAG=master .`
+
2. In this directory, create bind mount directories with `mkdir keys repositories server`
+
3. Ensure `repositories` and `server` are owned by a USER with UID/GUID `1000:1000`
+
with `chown USER:USER repositories server`
+
4. Edit `docker-compose.yml` with appropriate `KNOT_SERVER_HOSTNAME` and `KNOT_SERVER_OWNER`
+
4. Create Docker container with `docker-compose up -d`
+
5. Knot is now ready for reverse proxy from `KNOT_SERVER_HOSTNAME:443` to local port 5555
+
(knot verification will not work over HTTP port 80!)
+
+
## Repository troubleshooting
+
+
* SSH keys must be added to Tangled *after* the knot is created for it to pick them up.
+
Run `docker exec knot knot keys` to verify the keys.
+
* Git remote URLs must be of the form `ssh://git@KNOT_SERVER_HOSTNAME:2222/KNOT_SERVER_OWNER/REPO`
+
since the container exposes port 2222 for Git.
+
Remember to allow the port through your firewall.
+18
docker-compose.yml
···
+
services:
+
knot:
+
image: knot:latest
+
container_name: knot
+
environment:
+
KNOT_SERVER_HOSTNAME: knot.ionchy.ca
+
KNOT_SERVER_OWNER: did:plc:ypsrm6ue6o5xk5kvbdhwtppm
+
KNOT_SERVER_DB_PATH: /app/knotserver.db
+
KNOT_REPO_SCAN_PATH: /home/git/repositories
+
KNOT_SERVER_INTERNAL_LISTEN_ADDR: localhost:5444
+
volumes:
+
- ./keys:/etc/ssh/keys
+
- ./repositories:/home/git/repositories
+
- ./server:/app
+
ports:
+
- "5555:5555"
+
- "2222:22"
+
restart: always