Scratch space for learning atproto app development

Compare changes

Choose any two refs to compare.

Changed files
+16 -8
+16 -8
README.md
···
## Deploying
In production, you will need a private key to sign OAuth tokens request. Use the
-
following command to generate a new JWK (JSON Web Key):
+
following command to generate a new private key:
```sh
./bin/gen-jwk
```
-
The generated key must be added to the environment variables (`.env` file) as `PRIVATE_KEY`.
+
The generated key must be added to the environment variables (`.env` file) in `PRIVATE_KEYS`.
```env
PRIVATE_KEYS='[{"kty":"EC","kid":"12",...}]'
```
-
Note that you can have multiple keys. Always add new keys at the beginning of
-
the array, so that the first key is always the most recent one. When a key is
-
removed, all associated sessions will be invalidated.
+
> [!NOTE]
+
>
+
> The `PRIVATE_KEYS` can contain multiple keys. The first key in the array is
+
> the most recent one, and it will be used to sign new tokens. When a key is
+
> removed, all associated sessions will be invalidated.
-
Make sure to also set the `COOKIE_SECRET` in your environment variables (`.env` file), which is used to sign session cookies. You can generate a random string for this:
+
Make sure to also set the `COOKIE_SECRET`, which is used to sign session
+
cookies, in your environment variables (`.env` file). You should use a random
+
string for this:
```sh
openssl rand -base64 33
```
-
Finally, set the `PUBLIC_URL` to the URL where your app will be accessible. This is used for OAuth client ID and other configurations.
+
Finally, set the `PUBLIC_URL` to the URL where your app will be accessible. This
+
will allow the authorization servers to download the app's public keys.
```env
PUBLIC_URL="https://your-app-url.com"
```
> [!NOTE]
-
> You can use services like [ngrok](https://ngrok.com/) to expose your local server to the internet for testing purposes. Just set the `PUBLIC_URL` to the ngrok URL.
+
>
+
> You can use services like [ngrok](https://ngrok.com/) to expose your local
+
> server to the internet for testing purposes. Just set the `PUBLIC_URL` to the
+
> ngrok URL.