-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Local dev environment #145
Merged
Merged
Changes from all commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
aa2fecb
WIP
tom-sherman 24c0e97
Get create account flow working (with https)
tom-sherman bc02d65
First attempt at hooking up drainpipe to the pds
tom-sherman eb0eb58
Start from the beginning with a fresh database
tom-sherman fb38cf2
Setup turso
tom-sherman fbe9eb0
Improve readme
tom-sherman 8126fef
Add tunnel container
tom-sherman cacc459
Read plc directory host from env var
tom-sherman c92aded
Add libsql extensions
tom-sherman e4fdab8
Fix TLS for handles
tom-sherman c072964
Handle missing bluesky profile
tom-sherman 17671d1
Add cloudflared to the docs
tom-sherman 81526a6
Remove todo
tom-sherman ae6959d
Add account creation instructions
tom-sherman 5397b93
Use volumes for everything
tom-sherman 6c47182
Fix error message
tom-sherman File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
pds/ | ||
plc/ | ||
drainpipe/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
{ | ||
storage file_system /data/ | ||
debug | ||
pki { | ||
ca unravel { | ||
name "Unravel" | ||
} | ||
} | ||
} | ||
|
||
acme.dev.unravel.fyi { | ||
tls { | ||
issuer internal { | ||
ca unravel | ||
} | ||
} | ||
acme_server { | ||
ca unravel | ||
} | ||
} | ||
|
||
plc.dev.unravel.fyi { | ||
tls { | ||
issuer internal { | ||
ca unravel | ||
} | ||
} | ||
|
||
reverse_proxy http://plc:8080 | ||
} | ||
|
||
turso.dev.unravel.fyi { | ||
tls { | ||
issuer internal { | ||
ca unravel | ||
} | ||
} | ||
|
||
reverse_proxy http://turso_dev:8080 | ||
} | ||
|
||
*.pds.dev.unravel.fyi, pds.dev.unravel.fyi { | ||
tls { | ||
issuer internal { | ||
ca unravel | ||
} | ||
} | ||
|
||
reverse_proxy http://pds:3000 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
# Frontpage Dev Environment | ||
|
||
Docker compose file that runs the required peices of infrastructure for frontpage locally. | ||
|
||
> ![NOTE] | ||
> Does not include the frontpage service itself, you should run that with `pnpm run dev` | ||
|
||
## What's inside | ||
|
||
- ATProto [PLC server](https://github.com/did-method-plc/did-method-plc) (http://localhost:4000 & https://plc.dev.unravel.fyi) | ||
- ATProto [PDS](https://github.com/bluesky-social/pds) (http://localhost:4001 & https://pds.dev.unravel.fyi) | ||
- [Drainpipe](../../../packages-rs/drainpipe/README.md) (pushes data from the PDS to the Frontpage Next.js app) | ||
- Turso sqlite server (http://localhost:4002 && https://turso.dev.unravel.fyi) | ||
- [Caddy](https://caddyserver.com/) reverse proxy (it provides the above services over HTTPS) | ||
- [`cloudflared`](https://developers.cloudflare.com/cloudflare-one/connections/connect-networks/do-more-with-tunnels/trycloudflare/) (a public https tunnel to the local Frontpage Next.js app) | ||
|
||
## Setup | ||
|
||
- `docker-compose up` | ||
- 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 `/data/caddy/pki/authorities/unravel/root.crt` | ||
- Grab the auto generated `cloudflared` tunnel URL from the logs of the `cloudflared` container | ||
- Create a test account with `./scripts/create-account.sh <email> <handle>` | ||
- Go about your business | ||
|
||
> ![IMPORTANT] | ||
> When running Node.js based apps make sure you're setting the `NODE_OPTIONS` environment variable to `--use-openssl-ca` to tell Node.js to use the system's trust store. The scripts inside of Frontpage's `package.json` already do this for you. | ||
|
||
## Troubleshooting | ||
|
||
### `docker-compose up` fails with `failed to solve: error from sender: open ~/unravel/packages/frontpage/local-infra/plc/db: permission denied` | ||
|
||
Delete the ./plc directory and try again. | ||
|
||
TODO: This can probably be fixed by using named volumes instead of bind mounts. |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it worth extracting this as I see it is also used in
packages/frontpage/app/(app)/post/[postAuthor]/[postRkey]/og-image/route.tsx