AT-based link agregator. Mirror of https://github.com/likeandscribe/frontpage

Simplify local setup

tom.sherman.is 08467d83 deb7f503

verified
+25 -23
+1 -4
packages/frontpage/local-infra/README.md
··· 23 23 - Install the Unravel CA root certificate in your system's trust store. You can find it in the `frontpage-local-infra_caddy_data` volume at `/pki/authorities/unravel/root.crt` in your docker container volumes section. 24 24 - Depending on your browser you may have to import the certificate into your browser profiles too as some have their own certs do not use your system ones 25 25 - Create a test account with `./scripts/create-test-account.sh <username>` (username=bob will create a user with handle bob.pds.unravel.dev.fyi) 26 - - Update your Frontpage environment variables with `packages/frontpage/local.env`: 27 - - `DRAINPIPE_CONSUMER_SECRET=secret` 28 - - `TURSO_CONNECTION_URL=libsql://turso.dev.unravel.fyi` 29 - - `PLC_DIRECTORY_URL=https://plc.dev.unravel.fyi` 26 + - Run `pnpm --filter=frontpage run generate-local-env` and update the `packages/frontpage/.env.local` file with the generated values. 30 27 - Run `pnpm turbo dev` in the frontpage package folder 31 28 - Run `pnpm run db:migrate` in the frontpage package folder 32 29 - Grab the auto generated `cloudflared` tunnel URL from the logs of the `cloudflared` container, use this to access the Frontpage dev server
+2 -1
packages/frontpage/package.json
··· 15 15 "db:push": "NODE_OPTIONS=--use-openssl-ca drizzle-kit push", 16 16 "db:pull": "NODE_OPTIONS=--use-openssl-ca drizzle-kit pull", 17 17 "test": "vitest", 18 - "type-check": "tsc --noEmit" 18 + "type-check": "tsc --noEmit", 19 + "generate-local-env": "tsx scripts/generate-local-env.mts" 19 20 }, 20 21 "dependencies": { 21 22 "@atproto/common-web": "^0.3.2",
-18
packages/frontpage/scripts/generate-jwk.mts
··· 1 - const keyPair = await crypto.subtle.generateKey( 2 - { 3 - name: "ECDSA", 4 - namedCurve: "P-256", 5 - }, 6 - true, 7 - ["sign", "verify"], 8 - ); 9 - 10 - const [privateKey, publicKey] = await Promise.all( 11 - [keyPair.privateKey, keyPair.publicKey].map((key) => 12 - crypto.subtle.exportKey("jwk", key), 13 - ), 14 - ); 15 - 16 - console.log( 17 - `PRIVATE_JWK='${JSON.stringify(privateKey)}'\nPUBLIC_JWK='${JSON.stringify(publicKey)}'`, 18 - );
+22
packages/frontpage/scripts/generate-local-env.mts
··· 1 + const keyPair = await crypto.subtle.generateKey( 2 + { 3 + name: "ECDSA", 4 + namedCurve: "P-256", 5 + }, 6 + true, 7 + ["sign", "verify"], 8 + ); 9 + 10 + const [privateKey, publicKey] = await Promise.all( 11 + [keyPair.privateKey, keyPair.publicKey].map((key) => 12 + crypto.subtle.exportKey("jwk", key), 13 + ), 14 + ); 15 + 16 + console.log( 17 + `PRIVATE_JWK='${JSON.stringify(privateKey)}' 18 + PUBLIC_JWK='${JSON.stringify(publicKey)}' 19 + DRAINPIPE_CONSUMER_SECRET=secret 20 + TURSO_CONNECTION_URL=libsql://turso.dev.unravel.fyi 21 + PLC_DIRECTORY_URL=https://plc.dev.unravel.fyi`, 22 + );