Monorepo for Tangled forked from tangled.org/core
core docs hacking.md
5.2 kB · 172 lines
Markdown
at ci

# hacking on tangled We highly recommend [installing nix](https://nixos.org/download/) (the package manager) before working on the codebase. The nix flake provides a lot of helpers to get started and most importantly, builds and dev shells are entirely deterministic. To set up your dev environment: ```bash nix develop ``` Non-nix users can look at the `devShell` attribute in the `flake.nix` file to determine necessary dependencies. ## running the appview The nix flake also exposes a few `app` attributes (run `nix flake show` to see a full list of what the flake provides), one of the apps runs the appview with the `air` live-reloader: ```bash TANGLED_DEV=true nix run .#watch-appview # TANGLED_DB_PATH might be of interest to point to # different sqlite DBs # in a separate shell, you can live-reload tailwind nix run .#watch-tailwind ``` To authenticate with the appview, you will need redis and OAUTH JWKs to be setup: ``` # oauth jwks should already be setup by the nix devshell: echo $TANGLED_OAUTH_CLIENT_SECRET z42ty4RT1ovnTopY8B8ekz9NuziF2CuMkZ7rbRFpAR9jBqMc echo $TANGLED_OAUTH_CLIENT_KID 1761667908 # if not, you can set it up yourself: goat key generate -t P-256 Key Type: P-256 / secp256r1 / ES256 private key Secret Key (Multibase Syntax): save this securely (eg, add to password manager) z42tuPDKRfM2mz2Kv953ARen2jmrPA8S9LX9tRq4RVcUMwwL Public Key (DID Key Syntax): share or publish this (eg, in DID document) did:key:zDnaeUBxtG6Xuv3ATJE4GaWeyXM3jyamJsZw3bSPpxx4bNXDR # the secret key from above export TANGLED_OAUTH_CLIENT_SECRET="z42tuP..." # run redis in at a new shell to store oauth sessions redis-server ``` ## running knots and spindles An end-to-end knot setup requires setting up a machine with `sshd`, `AuthorizedKeysCommand`, and git user, which is quite cumbersome. So the nix flake provides a `nixosConfiguration` to do so. <details> <summary><strong>MacOS users will have to setup a Nix Builder first</strong></summary> In order to build Tangled's dev VM on macOS, you will …