Compare commits
No commits in common. "976e508ee51af459ad853b47e94bc008ef0668f9" and "b37b698e8cfeab8a05a441b621602fd7068b8372" have entirely different histories.
976e508ee5
...
b37b698e8c
5 changed files with 44 additions and 72 deletions
6
Makefile
6
Makefile
|
@ -11,6 +11,10 @@ export DOCKER_BUILDKIT=1
|
||||||
build-tag:
|
build-tag:
|
||||||
docker build --tag $(REGISTRY)/$(OWNER)/$(IMAGE):$(TAG) .
|
docker build --tag $(REGISTRY)/$(OWNER)/$(IMAGE):$(TAG) .
|
||||||
|
|
||||||
|
.PHONY: build
|
||||||
|
build:
|
||||||
|
docker build --tag $(REGISTRY)/$(OWNER)/$(IMAGE) .
|
||||||
|
|
||||||
.PHONY: wsdump
|
.PHONY: wsdump
|
||||||
wsdump:
|
wsdump:
|
||||||
wsdump "wss://$(DOMAIN)/xrpc/com.atproto.sync.subscribeRepos?cursor=0"
|
wsdump "wss://$(DOMAIN)/xrpc/com.atproto.sync.subscribeRepos?cursor=0"
|
||||||
|
@ -25,8 +29,6 @@ generate-env:
|
||||||
@echo "PDS_ADMIN_PASSWORD=$(PDS_ADMIN_PASSWORD)" >> .env
|
@echo "PDS_ADMIN_PASSWORD=$(PDS_ADMIN_PASSWORD)" >> .env
|
||||||
@echo "PDS_PLC_ROTATION_KEY_K256_PRIVATE_KEY_HEX=$(PDS_PLC_ROTATION_KEY_K256_PRIVATE_KEY_HEX)" >> .env
|
@echo "PDS_PLC_ROTATION_KEY_K256_PRIVATE_KEY_HEX=$(PDS_PLC_ROTATION_KEY_K256_PRIVATE_KEY_HEX)" >> .env
|
||||||
@echo "PDS_HOSTNAME=$(DOMAIN)" >> .env
|
@echo "PDS_HOSTNAME=$(DOMAIN)" >> .env
|
||||||
@echo "URL_NAME:" >> .env
|
|
||||||
@echo "URL_SUFFIX:" >> .env
|
|
||||||
|
|
||||||
.PHONY: run
|
.PHONY: run
|
||||||
run:
|
run:
|
||||||
|
|
74
README.md
74
README.md
|
@ -1,6 +1,5 @@
|
||||||
# bluesky-pds-docker
|
# bluesky-pds-docker
|
||||||
|
A self-contained Docker image for the [Bluesky PDS (Personal Data Server) ](https://github.com/bluesky-social/pds). This image is pinned to v0.4.74.
|
||||||
A self-contained Docker image for the [Bluesky PDS (Personal Data Server) ](https://github.com/bluesky-social/pds) for use with Traefik. This image is pinned to v0.4.74.
|
|
||||||
|
|
||||||
It is required to run the instance behind a proxy (like traefik) to generate SSL certificates. This will not work otherwise. The standard pds install includes caddy to handle this.
|
It is required to run the instance behind a proxy (like traefik) to generate SSL certificates. This will not work otherwise. The standard pds install includes caddy to handle this.
|
||||||
|
|
||||||
|
@ -8,43 +7,41 @@ I can confirm it works behind Cloudflare's DNS Proxy with Full (strict).
|
||||||
|
|
||||||
## Deployment
|
## Deployment
|
||||||
|
|
||||||
### Reqirements (to)
|
|
||||||
|
|
||||||
#### Manjaro/Arch
|
|
||||||
|
|
||||||
```bash
|
|
||||||
sudo pacman -Syu install jq
|
|
||||||
```
|
|
||||||
|
|
||||||
#### Debian/Ubunut
|
|
||||||
|
|
||||||
```bash
|
|
||||||
sudo apt install make xxd
|
|
||||||
```
|
|
||||||
|
|
||||||
### Setup
|
|
||||||
|
|
||||||
Generate secrets and add them to `.env` file. See [example.env](example.env) as an example.
|
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
# Generate secret environment variables
|
# Generate secret environment variables
|
||||||
echo PDS_ADMIN_PASSWORD: $(openssl rand --hex 16)
|
echo PDS_ADMIN_PASSWORD: $(openssl rand --hex 16)
|
||||||
echo PDS_JWT_SECRET: $(openssl rand --hex 16)
|
echo PDS_JWT_SECRET: $(openssl rand --hex 16)
|
||||||
echo PDS_PLC_ROTATION_KEY_K256_PRIVATE_KEY_HEX: $(openssl ecparam --name secp256k1 --genkey --noout --outform DER | tail --bytes=+8 | head --bytes=32 | xxd --plain --cols 32)
|
echo PDS_PLC_ROTATION_KEY_K256_PRIVATE_KEY_HEX: $(openssl ecparam --name secp256k1 --genkey --noout --outform DER | tail --bytes=+8 | head --bytes=32 | xxd --plain --cols 32)
|
||||||
|
|
||||||
|
# pull and run the container
|
||||||
|
docker pull forgejo.gravityfargo.dev/gravityfargo/bluesky-pds
|
||||||
|
docker-compose up -d
|
||||||
|
|
||||||
|
# Create an account
|
||||||
|
docker exec -it bluesky-pds bash
|
||||||
|
pdsadmin account create
|
||||||
|
pdsadmin account list
|
||||||
|
pdsadmin request-crawl bsky.network # useful if you re-deploy the same instance multiple times
|
||||||
```
|
```
|
||||||
|
|
||||||
### Standalone
|
In your browser:
|
||||||
|
|
||||||
|
- Go to https://bsky-debug.app/handle and enter your new user, "HTTP Verification Method" needs to pass.
|
||||||
|
- [websocket-tester](https://piehost.com/websocket-tester) "wss://example.com/xrpc/com.atproto.sync.subscribeRepos?cursor=0" needs to display "Connection Established"
|
||||||
|
- https://boat.kelinci.net/ has a helpful tool to export your data.
|
||||||
|
- Log in with your new user and go to https://bsky.app/
|
||||||
|
|
||||||
|
|
||||||
|
### Example Docker Compose
|
||||||
|
|
||||||
Full list of additional Environment Variables can be found in the [packages/pds/src/config/env.ts](https://github.com/bluesky-social/atproto/blob/main/packages/pds/src/config/env.ts)
|
Full list of additional Environment Variables can be found in the [packages/pds/src/config/env.ts](https://github.com/bluesky-social/atproto/blob/main/packages/pds/src/config/env.ts)
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
# Standalone, you'll need to add a proxy in front of this with SSL.
|
|
||||||
services:
|
services:
|
||||||
bluesky-pds:
|
bluesky-pds:
|
||||||
container_name: bluesky-pds
|
container_name: bluesky-pds
|
||||||
image: forgejo.gravityfargo.dev/gravityfargo/bluesky-pds
|
image: forgejo.gravityfargo.dev/gravityfargo/bluesky-pds
|
||||||
environment:
|
environment:
|
||||||
# Define variables here or in a .env file
|
|
||||||
PDS_JWT_SECRET: ...
|
PDS_JWT_SECRET: ...
|
||||||
PDS_ADMIN_PASSWORD: ...
|
PDS_ADMIN_PASSWORD: ...
|
||||||
PDS_PLC_ROTATION_KEY_K256_PRIVATE_KEY_HEX: ...
|
PDS_PLC_ROTATION_KEY_K256_PRIVATE_KEY_HEX: ...
|
||||||
|
@ -55,24 +52,30 @@ services:
|
||||||
- ./bluesky-pds:/pds
|
- ./bluesky-pds:/pds
|
||||||
```
|
```
|
||||||
|
|
||||||
### Traefik
|
### Example Docker Compose with Traefik
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
# Traefik Proxy
|
|
||||||
services:
|
services:
|
||||||
bluesky-pds:
|
bluesky-pds:
|
||||||
container_name: bluesky-pds
|
container_name: bluesky-pds
|
||||||
image: forgejo.gravityfargo.dev/gravityfargo/bluesky-pds:latest
|
image: forgejo.gravityfargo.dev/gravityfargo/bluesky-pds:latest
|
||||||
|
networks:
|
||||||
|
- proxy
|
||||||
env_file:
|
env_file:
|
||||||
- .env
|
PDS_ADMIN_PASSWORD: ""
|
||||||
|
PDS_JWT_SECRET: ""
|
||||||
|
PDS_PLC_ROTATION_KEY_K256_PRIVATE_KEY_HEX: ""
|
||||||
|
PDS_HOSTNAME: example.com
|
||||||
|
PDS_EMAIL_SMTP_URL: ""
|
||||||
|
PDS_EMAIL_FROM_ADDRESS: ""
|
||||||
volumes:
|
volumes:
|
||||||
- ./bluesky-pds:/pds
|
- ./bluesky-pds:/pds
|
||||||
labels:
|
labels:
|
||||||
traefik.enable: "true"
|
traefik.enable: "true"
|
||||||
traefik.http.routers.bluesky-pds-insecure.entrypoints: http
|
traefik.http.routers.bluesky-pds-insecure.entrypoints: http
|
||||||
traefik.http.routers.bluesky-pds-insecure.rule: HostRegexp(`^.+\.example\.com$`)
|
traefik.http.routers.bluesky-pds-insecure.rule: HostRegexp(`^.+\.example\.com$`) || Host(`example.social`)
|
||||||
traefik.http.routers.bluesky-pds-secure.entrypoints: https
|
traefik.http.routers.bluesky-pds-secure.entrypoints: https
|
||||||
traefik.http.routers.bluesky-pds-secure.rule: HostRegexp(`^.+\.example\.com$`)
|
traefik.http.routers.bluesky-pds-secure.rule: HostRegexp(`^.+\.example\.com$`) || Host(`example.social`)
|
||||||
traefik.http.routers.bluesky-pds-secure.tls: "true"
|
traefik.http.routers.bluesky-pds-secure.tls: "true"
|
||||||
traefik.http.services.bluesky-pds.loadbalancer.server.scheme: http
|
traefik.http.services.bluesky-pds.loadbalancer.server.scheme: http
|
||||||
traefik.http.services.bluesky-pds.loadbalancer.server.port: 3000
|
traefik.http.services.bluesky-pds.loadbalancer.server.port: 3000
|
||||||
|
@ -85,7 +88,6 @@ services:
|
||||||
I think file configs are cleaner than having a billion labels.
|
I think file configs are cleaner than having a billion labels.
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
# middleware.yaml
|
|
||||||
http:
|
http:
|
||||||
middlewares:
|
middlewares:
|
||||||
BlueskyHeaders:
|
BlueskyHeaders:
|
||||||
|
@ -102,18 +104,8 @@ http:
|
||||||
stsSeconds: 63072000
|
stsSeconds: 63072000
|
||||||
```
|
```
|
||||||
|
|
||||||
#### Optional Proxy Network
|
## Development Notes
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
docker network create --subnet=192.168.1.0/24 --ipv6 --attachable proxy
|
pamac install jq
|
||||||
# /etc/docker/daemon.json
|
|
||||||
# {
|
|
||||||
# "ipv6": true,
|
|
||||||
# "fixed-cidr-v6": "2001:db8:1::/64"
|
|
||||||
# }
|
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
#### Cloudflare DNS
|
|
||||||
|
|
||||||
![alt text](assets/image.png)
|
|
||||||
|
|
BIN
assets/image.png
BIN
assets/image.png
Binary file not shown.
Before Width: | Height: | Size: 46 KiB |
|
@ -1,27 +1,11 @@
|
||||||
networks:
|
|
||||||
proxy:
|
|
||||||
external: true
|
|
||||||
|
|
||||||
services:
|
services:
|
||||||
bluesky-pds-dev:
|
bluesky-pds-dev:
|
||||||
container_name: bluesky-pds-dev
|
container_name: bluesky-pds-dev
|
||||||
hostname: ${PDS_HOSTNAME}
|
hostname: sheltersky.social
|
||||||
image: forgejo.gravityfargo.dev/gravityfargo/bluesky-pds:dev
|
image: forgejo.gravityfargo.dev/gravityfargo/bluesky-pds:0.4.74
|
||||||
build: ./
|
ports:
|
||||||
networks:
|
- 3000:3000
|
||||||
- proxy
|
|
||||||
env_file:
|
|
||||||
- .env
|
|
||||||
volumes:
|
volumes:
|
||||||
- ./config:/pds
|
- ./config:/pds
|
||||||
labels:
|
env_file:
|
||||||
traefik.enable: "true"
|
- .env
|
||||||
traefik.http.routers.bluesky-pds-insecure.entrypoints: http
|
|
||||||
traefik.http.routers.bluesky-pds-insecure.rule: HostRegexp(`^.+\.${URL_NAME}\.${URL_SUFFIX}$`) || Host(`${PDS_HOSTNAME}`)
|
|
||||||
traefik.http.routers.bluesky-pds-insecure.middlewares: BlueskyHeaders@file
|
|
||||||
traefik.http.routers.bluesky-pds-secure.entrypoints: https
|
|
||||||
traefik.http.routers.bluesky-pds-secure.rule: HostRegexp(`^.+\.${URL_NAME}\.${URL_SUFFIX}$`) || Host(`${PDS_HOSTNAME}`)
|
|
||||||
traefik.http.routers.bluesky-pds-secure.tls: "true"
|
|
||||||
traefik.http.services.bluesky-pds.loadbalancer.server.scheme: http
|
|
||||||
traefik.http.services.bluesky-pds.loadbalancer.server.port: 3000
|
|
||||||
traefik.http.routers.bluesky-pds-secure.middlewares: BlueskyHeaders@file
|
|
|
@ -1,6 +0,0 @@
|
||||||
PDS_JWT_SECRET=
|
|
||||||
PDS_ADMIN_PASSWORD=
|
|
||||||
PDS_PLC_ROTATION_KEY_K256_PRIVATE_KEY_HEX=
|
|
||||||
PDS_HOSTNAME=
|
|
||||||
PDS_EMAIL_SMTP_URL=
|
|
||||||
PDS_EMAIL_FROM_ADDRESS=
|
|
Loading…
Reference in a new issue