···5555quite cumbersome. So the nix flake provides a
5656`nixosConfiguration` to do so.
57575858-To begin, head to `http://localhost:3000/knots` in the browser
5959-and create a knot with hostname `localhost:6000`. This will
6060-generate a knot secret. Set `$TANGLED_VM_KNOT_SECRET` to it,
6161-ideally in a `.envrc` with [direnv](https://direnv.net) so you
6262-don't lose it.
5858+To begin, grab your DID from http://localhost:3000/settings.
5959+Then, set `TANGLED_VM_KNOT_OWNER` and
6060+`TANGLED_VM_SPINDLE_OWNER` to your DID.
63616464-You will also need to set the `$TANGLED_VM_SPINDLE_OWNER`
6565-variable to some value. If you don't want to [set up a
6666-spindle](#running-a-spindle), you can use any placeholder
6767-value.
6262+If you don't want to [set up a spindle](#running-a-spindle),
6363+you can use any placeholder value.
68646965You can now start a lightweight NixOS VM like so:
7066···7571```
76727773This starts a knot on port 6000, a spindle on port 6555
7878-with `ssh` exposed on port 2222. You can push repositories
7979-to this VM with this ssh config block on your main machine:
7474+with `ssh` exposed on port 2222.
7575+7676+Once the services are running, head to
7777+http://localhost:3000/knots and hit verify (and similarly,
7878+http://localhost:3000/spindles to verify your spindle). It
7979+should verify the ownership of the services instantly if
8080+everything went smoothly.
8181+8282+You can push repositories to this VM with this ssh config
8383+block on your main machine:
80848185```bash
8286Host nixos-shell
···959996100## running a spindle
971019898-You will need to find out your DID by entering your login handle into
9999-<https://pdsls.dev/>. Set `$TANGLED_VM_SPINDLE_OWNER` to your DID.
100100-101101-The above VM should already be running a spindle on `localhost:6555`.
102102-You can head to the spindle dashboard on `http://localhost:3000/spindles`,
103103-and register a spindle with hostname `localhost:6555`. It should instantly
104104-be verified. You can then configure each repository to use this spindle
105105-and run CI jobs.
102102+The above VM should already be running a spindle on
103103+`localhost:6555`. Head to http://localhost:3000/spindles and
104104+hit verify. You can then configure each repository to use
105105+this spindle and run CI jobs.
106106107107Of interest when debugging spindles:
108108
+7-5
docs/knot-hosting.md
···7373```
74747575Create `/home/git/.knot.env` with the following, updating the values as
7676-necessary. The `KNOT_SERVER_SECRET` can be obtained from the
7777-[/knots](https://tangled.sh/knots) page on Tangled.
7676+necessary. The `KNOT_SERVER_OWNER` should be set to your
7777+DID, you can find your DID in the [Settings](https://tangled.sh/settings) page.
78787979```
8080KNOT_REPO_SCAN_PATH=/home/git
8181KNOT_SERVER_HOSTNAME=knot.example.com
8282APPVIEW_ENDPOINT=https://tangled.sh
8383-KNOT_SERVER_SECRET=secret
8383+KNOT_SERVER_OWNER=did:plc:foobar
8484KNOT_SERVER_INTERNAL_LISTEN_ADDR=127.0.0.1:5444
8585KNOT_SERVER_LISTEN_ADDR=127.0.0.1:5555
8686```
···128128Remember to use Let's Encrypt or similar to procure a certificate for your
129129knot domain.
130130131131-You should now have a running knot server! You can finalize your registration by hitting the
132132-`initialize` button on the [/knots](https://tangled.sh/knots) page.
131131+You should now have a running knot server! You can finalize
132132+your registration by hitting the `verify` button on the
133133+[/knots](https://tangled.sh/knots) page. This simply creates
134134+a record on your PDS to announce the existence of the knot.
133135134136### custom paths
135137
+39
docs/migrations/knot-1.7.0.md
···11+# Upgrading from v1.7.0
22+33+After v1.7.0, knot secrets have been deprecated. You no
44+longer need a secret from the appview to run a knot. All
55+authorized commands between services to knots are managed
66+via [Service
77+Auth](https://atproto.com/specs/xrpc#inter-service-authentication-jwt).
88+Knots will be read-only until upgraded.
99+1010+Upgrading is quite easy, in essence:
1111+1212+- `KNOT_SERVER_SECRET` is no more, you can remove this
1313+ environment variable entirely
1414+- `KNOT_SERVER_OWNER` is now required on boot, set this to
1515+ your DID. You can find your DID in the
1616+ [settings](https://tangled.sh/settings) page.
1717+- Restart your knot once you have replace the environment
1818+ variable
1919+- Head to the [knot dashboard](https://tangled.sh/knots) and
2020+ hit the "retry" button to verify your knot. This simply
2121+ writes a `sh.tangled.knot` record to your PDS.
2222+2323+## Nix
2424+2525+If you use the nix module, simply bump the flake to the
2626+latest revision, and change your config block like so:
2727+2828+```diff
2929+ services.tangled-knot = {
3030+ enable = true;
3131+ server = {
3232+- secretFile = /path/to/secret;
3333++ owner = "did:plc:foo";
3434+ .
3535+ .
3636+ .
3737+ };
3838+ };
3939+```