mirror of
https://tangled.org/tranquil.farm/tranquil-pds
synced 2026-09-03 00:36:55 +00:00
Rename to tranquil PDS, sounds better than bullshit PDS
This commit is contained in:
+42
-45
@@ -1,7 +1,7 @@
|
||||
# BSPDS Production Installation on Alpine Linux
|
||||
# Tranquil PDS Production Installation on Alpine Linux
|
||||
> **Warning**: These instructions are untested and theoretical, written from the top of Lewis' head. They may contain errors or omissions. This warning will be removed once the guide has been verified.
|
||||
|
||||
This guide covers installing BSPDS on Alpine Linux 3.23 (current stable as of December 2025).
|
||||
This guide covers installing Tranquil PDS on Alpine Linux 3.23.
|
||||
|
||||
## Prerequisites
|
||||
- A VPS with at least 2GB RAM and 20GB disk
|
||||
@@ -20,17 +20,16 @@ rustup-init -y
|
||||
source ~/.cargo/env
|
||||
rustup default stable
|
||||
```
|
||||
This installs the latest stable Rust (1.92+ as of December 2025). Alpine 3.23 also ships Rust 1.91 via `apk add rust cargo` if you prefer system packages.
|
||||
This installs the latest stable Rust. Alpine also ships Rust via `apk add rust cargo` if you prefer system packages.
|
||||
## 3. Install postgres
|
||||
Alpine 3.23 includes PostgreSQL 18:
|
||||
```sh
|
||||
apk add postgresql postgresql-contrib
|
||||
rc-update add postgresql
|
||||
/etc/init.d/postgresql setup
|
||||
rc-service postgresql start
|
||||
psql -U postgres -c "CREATE USER bspds WITH PASSWORD 'your-secure-password';"
|
||||
psql -U postgres -c "CREATE DATABASE pds OWNER bspds;"
|
||||
psql -U postgres -c "GRANT ALL PRIVILEGES ON DATABASE pds TO bspds;"
|
||||
psql -U postgres -c "CREATE USER tranquil_pds WITH PASSWORD 'your-secure-password';"
|
||||
psql -U postgres -c "CREATE DATABASE pds OWNER tranquil_pds;"
|
||||
psql -U postgres -c "GRANT ALL PRIVILEGES ON DATABASE pds TO tranquil_pds;"
|
||||
```
|
||||
## 4. Install minio
|
||||
```sh
|
||||
@@ -78,7 +77,6 @@ mc alias set local http://localhost:9000 minioadmin your-minio-password
|
||||
mc mb local/pds-blobs
|
||||
```
|
||||
## 5. Install valkey
|
||||
Alpine 3.23 includes Valkey 9:
|
||||
```sh
|
||||
apk add valkey
|
||||
rc-update add valkey
|
||||
@@ -90,11 +88,11 @@ curl -fsSL https://deno.land/install.sh | sh
|
||||
export PATH="$HOME/.deno/bin:$PATH"
|
||||
echo 'export PATH="$HOME/.deno/bin:$PATH"' >> ~/.profile
|
||||
```
|
||||
## 7. Clone and Build BSPDS
|
||||
## 7. Clone and Build Tranquil PDS
|
||||
```sh
|
||||
mkdir -p /opt && cd /opt
|
||||
git clone https://tangled.org/lewis.moe/bspds-sandbox bspds
|
||||
cd bspds
|
||||
git clone https://tangled.org/lewis.moe/bspds-sandbox tranquil-pds
|
||||
cd tranquil-pds
|
||||
cd frontend
|
||||
deno task build
|
||||
cd ..
|
||||
@@ -103,56 +101,55 @@ cargo build --release
|
||||
## 8. Install sqlx-cli and Run Migrations
|
||||
```sh
|
||||
cargo install sqlx-cli --no-default-features --features postgres
|
||||
export DATABASE_URL="postgres://bspds:your-secure-password@localhost:5432/pds"
|
||||
export DATABASE_URL="postgres://tranquil_pds:your-secure-password@localhost:5432/pds"
|
||||
sqlx migrate run
|
||||
```
|
||||
## 9. Configure BSPDS
|
||||
## 9. Configure Tranquil PDS
|
||||
```sh
|
||||
mkdir -p /etc/bspds
|
||||
cp /opt/bspds/.env.example /etc/bspds/bspds.env
|
||||
chmod 600 /etc/bspds/bspds.env
|
||||
mkdir -p /etc/tranquil-pds
|
||||
cp /opt/tranquil-pds/.env.example /etc/tranquil-pds/tranquil-pds.env
|
||||
chmod 600 /etc/tranquil-pds/tranquil-pds.env
|
||||
```
|
||||
Edit `/etc/bspds/bspds.env` and fill in your values. Generate secrets with:
|
||||
Edit `/etc/tranquil-pds/tranquil-pds.env` and fill in your values. Generate secrets with:
|
||||
```sh
|
||||
openssl rand -base64 48
|
||||
```
|
||||
## 10. Create OpenRC Service
|
||||
```sh
|
||||
adduser -D -H -s /sbin/nologin bspds
|
||||
cp /opt/bspds/target/release/bspds /usr/local/bin/
|
||||
mkdir -p /var/lib/bspds
|
||||
cp -r /opt/bspds/frontend/dist /var/lib/bspds/frontend
|
||||
chown -R bspds:bspds /var/lib/bspds
|
||||
cat > /etc/init.d/bspds << 'EOF'
|
||||
adduser -D -H -s /sbin/nologin tranquil-pds
|
||||
cp /opt/tranquil-pds/target/release/tranquil-pds /usr/local/bin/
|
||||
mkdir -p /var/lib/tranquil-pds
|
||||
cp -r /opt/tranquil-pds/frontend/dist /var/lib/tranquil-pds/frontend
|
||||
chown -R tranquil-pds:tranquil-pds /var/lib/tranquil-pds
|
||||
cat > /etc/init.d/tranquil-pds << 'EOF'
|
||||
#!/sbin/openrc-run
|
||||
name="bspds"
|
||||
description="BSPDS - AT Protocol PDS"
|
||||
command="/usr/local/bin/bspds"
|
||||
command_user="bspds"
|
||||
name="tranquil-pds"
|
||||
description="Tranquil PDS - AT Protocol PDS"
|
||||
command="/usr/local/bin/tranquil-pds"
|
||||
command_user="tranquil-pds"
|
||||
command_background=true
|
||||
pidfile="/run/${RC_SVCNAME}.pid"
|
||||
output_log="/var/log/bspds.log"
|
||||
error_log="/var/log/bspds.log"
|
||||
output_log="/var/log/tranquil-pds.log"
|
||||
error_log="/var/log/tranquil-pds.log"
|
||||
depend() {
|
||||
need net postgresql minio
|
||||
}
|
||||
start_pre() {
|
||||
export FRONTEND_DIR=/var/lib/bspds/frontend
|
||||
. /etc/bspds/bspds.env
|
||||
export FRONTEND_DIR=/var/lib/tranquil-pds/frontend
|
||||
. /etc/tranquil-pds/tranquil-pds.env
|
||||
export SERVER_HOST SERVER_PORT PDS_HOSTNAME DATABASE_URL
|
||||
export S3_ENDPOINT AWS_REGION S3_BUCKET AWS_ACCESS_KEY_ID AWS_SECRET_ACCESS_KEY
|
||||
export VALKEY_URL JWT_SECRET DPOP_SECRET MASTER_KEY CRAWLERS
|
||||
}
|
||||
EOF
|
||||
chmod +x /etc/init.d/bspds
|
||||
rc-update add bspds
|
||||
rc-service bspds start
|
||||
chmod +x /etc/init.d/tranquil-pds
|
||||
rc-update add tranquil-pds
|
||||
rc-service tranquil-pds start
|
||||
```
|
||||
## 11. Install and Configure nginx
|
||||
Alpine 3.23 includes nginx 1.28:
|
||||
```sh
|
||||
apk add nginx certbot certbot-nginx
|
||||
cat > /etc/nginx/http.d/bspds.conf << 'EOF'
|
||||
cat > /etc/nginx/http.d/tranquil-pds.conf << 'EOF'
|
||||
server {
|
||||
listen 80;
|
||||
listen [::]:80;
|
||||
@@ -217,26 +214,26 @@ rc-update add ip6tables
|
||||
```
|
||||
## 14. Verify Installation
|
||||
```sh
|
||||
rc-service bspds status
|
||||
rc-service tranquil-pds status
|
||||
curl -s https://pds.example.com/xrpc/_health
|
||||
curl -s https://pds.example.com/.well-known/atproto-did
|
||||
```
|
||||
## Maintenance
|
||||
View logs:
|
||||
```sh
|
||||
tail -f /var/log/bspds.log
|
||||
tail -f /var/log/tranquil-pds.log
|
||||
```
|
||||
Update BSPDS:
|
||||
Update Tranquil PDS:
|
||||
```sh
|
||||
cd /opt/bspds
|
||||
cd /opt/tranquil-pds
|
||||
git pull
|
||||
cd frontend && deno task build && cd ..
|
||||
cargo build --release
|
||||
rc-service bspds stop
|
||||
cp target/release/bspds /usr/local/bin/
|
||||
cp -r frontend/dist /var/lib/bspds/frontend
|
||||
DATABASE_URL="postgres://bspds:your-secure-password@localhost:5432/pds" sqlx migrate run
|
||||
rc-service bspds start
|
||||
rc-service tranquil-pds stop
|
||||
cp target/release/tranquil-pds /usr/local/bin/
|
||||
cp -r frontend/dist /var/lib/tranquil-pds/frontend
|
||||
DATABASE_URL="postgres://tranquil_pds:your-secure-password@localhost:5432/pds" sqlx migrate run
|
||||
rc-service tranquil-pds start
|
||||
```
|
||||
Backup database:
|
||||
```sh
|
||||
|
||||
+77
-77
@@ -1,6 +1,6 @@
|
||||
# BSPDS Containerized Production Deployment
|
||||
# Tranquil PDS Containerized Production Deployment
|
||||
> **Warning**: These instructions are untested and theoretical, written from the top of Lewis' head. They may contain errors or omissions. This warning will be removed once the guide has been verified.
|
||||
This guide covers deploying BSPDS using containers with podman.
|
||||
This guide covers deploying Tranquil PDS using containers with podman.
|
||||
- **Debian 13+**: Uses systemd quadlets (modern, declarative container management)
|
||||
- **Alpine 3.23+**: Uses OpenRC service script with podman-compose
|
||||
## Prerequisites
|
||||
@@ -39,14 +39,14 @@ apt install -y podman
|
||||
## 2. Create Directory Structure
|
||||
```bash
|
||||
mkdir -p /etc/containers/systemd
|
||||
mkdir -p /srv/bspds/{postgres,minio,valkey,certs,acme,config}
|
||||
mkdir -p /srv/tranquil-pds/{postgres,minio,valkey,certs,acme,config}
|
||||
```
|
||||
## 3. Create Environment File
|
||||
```bash
|
||||
cp /opt/bspds/.env.example /srv/bspds/config/bspds.env
|
||||
chmod 600 /srv/bspds/config/bspds.env
|
||||
cp /opt/tranquil-pds/.env.example /srv/tranquil-pds/config/tranquil-pds.env
|
||||
chmod 600 /srv/tranquil-pds/config/tranquil-pds.env
|
||||
```
|
||||
Edit `/srv/bspds/config/bspds.env` and fill in your values. Generate secrets with:
|
||||
Edit `/srv/tranquil-pds/config/tranquil-pds.env` and fill in your values. Generate secrets with:
|
||||
```bash
|
||||
openssl rand -base64 48
|
||||
```
|
||||
@@ -54,37 +54,37 @@ For quadlets, also add `DATABASE_URL` with the full connection string (systemd d
|
||||
## 4. Install Quadlet Definitions
|
||||
Copy the quadlet files from the repository:
|
||||
```bash
|
||||
cp /opt/bspds/deploy/quadlets/*.pod /etc/containers/systemd/
|
||||
cp /opt/bspds/deploy/quadlets/*.container /etc/containers/systemd/
|
||||
cp /opt/tranquil-pds/deploy/quadlets/*.pod /etc/containers/systemd/
|
||||
cp /opt/tranquil-pds/deploy/quadlets/*.container /etc/containers/systemd/
|
||||
```
|
||||
Note: Systemd doesn't support shell-style variable expansion in `Environment=` lines. The quadlet files expect DATABASE_URL to be set in the environment file.
|
||||
## 5. Create nginx Configuration
|
||||
```bash
|
||||
cp /opt/bspds/deploy/nginx/nginx-quadlet.conf /srv/bspds/config/nginx.conf
|
||||
cp /opt/tranquil-pds/deploy/nginx/nginx-quadlet.conf /srv/tranquil-pds/config/nginx.conf
|
||||
```
|
||||
## 6. Build BSPDS Image
|
||||
## 6. Build Tranquil PDS Image
|
||||
```bash
|
||||
cd /opt
|
||||
git clone https://tangled.org/lewis.moe/bspds-sandbox bspds
|
||||
cd bspds
|
||||
podman build -t bspds:latest .
|
||||
git clone https://tangled.org/lewis.moe/bspds-sandbox tranquil-pds
|
||||
cd tranquil-pds
|
||||
podman build -t tranquil-pds:latest .
|
||||
```
|
||||
## 7. Create Podman Secrets
|
||||
```bash
|
||||
source /srv/bspds/config/bspds.env
|
||||
echo "$DB_PASSWORD" | podman secret create bspds-db-password -
|
||||
echo "$MINIO_ROOT_PASSWORD" | podman secret create bspds-minio-password -
|
||||
source /srv/tranquil-pds/config/tranquil-pds.env
|
||||
echo "$DB_PASSWORD" | podman secret create tranquil-pds-db-password -
|
||||
echo "$MINIO_ROOT_PASSWORD" | podman secret create tranquil-pds-minio-password -
|
||||
```
|
||||
## 8. Start Services and Initialize
|
||||
```bash
|
||||
systemctl daemon-reload
|
||||
systemctl start bspds-db bspds-minio bspds-valkey
|
||||
systemctl start tranquil-pds-db tranquil-pds-minio tranquil-pds-valkey
|
||||
sleep 10
|
||||
```
|
||||
|
||||
Create the minio bucket:
|
||||
```bash
|
||||
podman run --rm --pod bspds \
|
||||
podman run --rm --pod tranquil-pds \
|
||||
-e MINIO_ROOT_USER=minioadmin \
|
||||
-e MINIO_ROOT_PASSWORD=your-minio-password \
|
||||
docker.io/minio/mc:RELEASE.2025-07-16T15-35-03Z \
|
||||
@@ -94,7 +94,7 @@ podman run --rm --pod bspds \
|
||||
Run migrations:
|
||||
```bash
|
||||
cargo install sqlx-cli --no-default-features --features postgres
|
||||
DATABASE_URL="postgres://bspds:your-db-password@localhost:5432/pds" sqlx migrate run --source /opt/bspds/migrations
|
||||
DATABASE_URL="postgres://tranquil_pds:your-db-password@localhost:5432/pds" sqlx migrate run --source /opt/tranquil-pds/migrations
|
||||
```
|
||||
## 9. Obtain Wildcard SSL Certificate
|
||||
User handles are served as subdomains (e.g., `alice.pds.example.com`), so you need a wildcard certificate. Wildcard certs require DNS-01 validation.
|
||||
@@ -102,16 +102,16 @@ User handles are served as subdomains (e.g., `alice.pds.example.com`), so you ne
|
||||
Create temporary self-signed cert to start services:
|
||||
```bash
|
||||
openssl req -x509 -nodes -days 1 -newkey rsa:2048 \
|
||||
-keyout /srv/bspds/certs/privkey.pem \
|
||||
-out /srv/bspds/certs/fullchain.pem \
|
||||
-keyout /srv/tranquil-pds/certs/privkey.pem \
|
||||
-out /srv/tranquil-pds/certs/fullchain.pem \
|
||||
-subj "/CN=pds.example.com"
|
||||
systemctl start bspds-app bspds-nginx
|
||||
systemctl start tranquil-pds-app tranquil-pds-nginx
|
||||
```
|
||||
|
||||
Get a wildcard certificate using DNS validation:
|
||||
```bash
|
||||
podman run --rm -it \
|
||||
-v /srv/bspds/certs:/etc/letsencrypt:Z \
|
||||
-v /srv/tranquil-pds/certs:/etc/letsencrypt:Z \
|
||||
docker.io/certbot/certbot:v5.2.2 certonly \
|
||||
--manual --preferred-challenges dns \
|
||||
-d pds.example.com -d '*.pds.example.com' \
|
||||
@@ -123,13 +123,13 @@ For automated renewal, use a DNS provider plugin (e.g., cloudflare, route53).
|
||||
|
||||
Link certificates and restart:
|
||||
```bash
|
||||
ln -sf /srv/bspds/certs/live/pds.example.com/fullchain.pem /srv/bspds/certs/fullchain.pem
|
||||
ln -sf /srv/bspds/certs/live/pds.example.com/privkey.pem /srv/bspds/certs/privkey.pem
|
||||
systemctl restart bspds-nginx
|
||||
ln -sf /srv/tranquil-pds/certs/live/pds.example.com/fullchain.pem /srv/tranquil-pds/certs/fullchain.pem
|
||||
ln -sf /srv/tranquil-pds/certs/live/pds.example.com/privkey.pem /srv/tranquil-pds/certs/privkey.pem
|
||||
systemctl restart tranquil-pds-nginx
|
||||
```
|
||||
## 10. Enable All Services
|
||||
```bash
|
||||
systemctl enable bspds-db bspds-minio bspds-valkey bspds-app bspds-nginx
|
||||
systemctl enable tranquil-pds-db tranquil-pds-minio tranquil-pds-valkey tranquil-pds-app tranquil-pds-nginx
|
||||
```
|
||||
## 11. Configure Firewall
|
||||
```bash
|
||||
@@ -142,7 +142,7 @@ ufw enable
|
||||
## 12. Certificate Renewal
|
||||
Add to root's crontab (`crontab -e`):
|
||||
```
|
||||
0 0 * * * podman run --rm -v /srv/bspds/certs:/etc/letsencrypt:Z -v /srv/bspds/acme:/var/www/acme:Z docker.io/certbot/certbot:v5.2.2 renew --quiet && systemctl reload bspds-nginx
|
||||
0 0 * * * podman run --rm -v /srv/tranquil-pds/certs:/etc/letsencrypt:Z -v /srv/tranquil-pds/acme:/var/www/acme:Z docker.io/certbot/certbot:v5.2.2 renew --quiet && systemctl reload tranquil-pds-nginx
|
||||
```
|
||||
---
|
||||
# Alpine 3.23+ with OpenRC
|
||||
@@ -161,79 +161,79 @@ rc-service podman start
|
||||
```
|
||||
## 2. Create Directory Structure
|
||||
```sh
|
||||
mkdir -p /srv/bspds/{data,config}
|
||||
mkdir -p /srv/bspds/data/{postgres,minio,valkey,certs,acme}
|
||||
mkdir -p /srv/tranquil-pds/{data,config}
|
||||
mkdir -p /srv/tranquil-pds/data/{postgres,minio,valkey,certs,acme}
|
||||
```
|
||||
## 3. Clone Repository and Build
|
||||
```sh
|
||||
cd /opt
|
||||
git clone https://tangled.org/lewis.moe/bspds-sandbox bspds
|
||||
cd bspds
|
||||
podman build -t bspds:latest .
|
||||
git clone https://tangled.org/lewis.moe/bspds-sandbox tranquil-pds
|
||||
cd tranquil-pds
|
||||
podman build -t tranquil-pds:latest .
|
||||
```
|
||||
## 4. Create Environment File
|
||||
```sh
|
||||
cp /opt/bspds/.env.example /srv/bspds/config/bspds.env
|
||||
chmod 600 /srv/bspds/config/bspds.env
|
||||
cp /opt/tranquil-pds/.env.example /srv/tranquil-pds/config/tranquil-pds.env
|
||||
chmod 600 /srv/tranquil-pds/config/tranquil-pds.env
|
||||
```
|
||||
Edit `/srv/bspds/config/bspds.env` and fill in your values. Generate secrets with:
|
||||
Edit `/srv/tranquil-pds/config/tranquil-pds.env` and fill in your values. Generate secrets with:
|
||||
```sh
|
||||
openssl rand -base64 48
|
||||
```
|
||||
## 5. Set Up Compose and nginx
|
||||
Copy the production compose and nginx configs:
|
||||
```sh
|
||||
cp /opt/bspds/docker-compose.prod.yml /srv/bspds/docker-compose.yml
|
||||
cp /opt/bspds/nginx.prod.conf /srv/bspds/config/nginx.conf
|
||||
cp /opt/tranquil-pds/docker-compose.prod.yml /srv/tranquil-pds/docker-compose.yml
|
||||
cp /opt/tranquil-pds/nginx.prod.conf /srv/tranquil-pds/config/nginx.conf
|
||||
```
|
||||
Edit `/srv/bspds/docker-compose.yml` to adjust paths if needed:
|
||||
- Update volume mounts to use `/srv/bspds/data/` paths
|
||||
- Update nginx cert paths to match `/srv/bspds/data/certs/`
|
||||
Edit `/srv/bspds/config/nginx.conf` to update cert paths:
|
||||
Edit `/srv/tranquil-pds/docker-compose.yml` to adjust paths if needed:
|
||||
- Update volume mounts to use `/srv/tranquil-pds/data/` paths
|
||||
- Update nginx cert paths to match `/srv/tranquil-pds/data/certs/`
|
||||
Edit `/srv/tranquil-pds/config/nginx.conf` to update cert paths:
|
||||
- Change `/etc/nginx/certs/live/${PDS_HOSTNAME}/` to `/etc/nginx/certs/`
|
||||
## 6. Create OpenRC Service
|
||||
```sh
|
||||
cat > /etc/init.d/bspds << 'EOF'
|
||||
cat > /etc/init.d/tranquil-pds << 'EOF'
|
||||
#!/sbin/openrc-run
|
||||
name="bspds"
|
||||
description="BSPDS AT Protocol PDS (containerized)"
|
||||
name="tranquil-pds"
|
||||
description="Tranquil PDS AT Protocol PDS (containerized)"
|
||||
command="/usr/bin/podman-compose"
|
||||
command_args="-f /srv/bspds/docker-compose.yml up"
|
||||
command_args="-f /srv/tranquil-pds/docker-compose.yml up"
|
||||
command_background=true
|
||||
pidfile="/run/${RC_SVCNAME}.pid"
|
||||
directory="/srv/bspds"
|
||||
directory="/srv/tranquil-pds"
|
||||
depend() {
|
||||
need net podman
|
||||
after firewall
|
||||
}
|
||||
start_pre() {
|
||||
set -a
|
||||
. /srv/bspds/config/bspds.env
|
||||
. /srv/tranquil-pds/config/tranquil-pds.env
|
||||
set +a
|
||||
}
|
||||
stop() {
|
||||
ebegin "Stopping ${name}"
|
||||
cd /srv/bspds
|
||||
cd /srv/tranquil-pds
|
||||
set -a
|
||||
. /srv/bspds/config/bspds.env
|
||||
. /srv/tranquil-pds/config/tranquil-pds.env
|
||||
set +a
|
||||
podman-compose -f /srv/bspds/docker-compose.yml down
|
||||
podman-compose -f /srv/tranquil-pds/docker-compose.yml down
|
||||
eend $?
|
||||
}
|
||||
EOF
|
||||
chmod +x /etc/init.d/bspds
|
||||
chmod +x /etc/init.d/tranquil-pds
|
||||
```
|
||||
## 7. Initialize Services
|
||||
Start services:
|
||||
```sh
|
||||
rc-service bspds start
|
||||
rc-service tranquil-pds start
|
||||
sleep 15
|
||||
```
|
||||
|
||||
Create the minio bucket:
|
||||
```sh
|
||||
source /srv/bspds/config/bspds.env
|
||||
podman run --rm --network bspds_default \
|
||||
source /srv/tranquil-pds/config/tranquil-pds.env
|
||||
podman run --rm --network tranquil-pds_default \
|
||||
-e MINIO_ROOT_USER="$MINIO_ROOT_USER" \
|
||||
-e MINIO_ROOT_PASSWORD="$MINIO_ROOT_PASSWORD" \
|
||||
docker.io/minio/mc:RELEASE.2025-07-16T15-35-03Z \
|
||||
@@ -246,8 +246,8 @@ apk add rustup
|
||||
rustup-init -y
|
||||
source ~/.cargo/env
|
||||
cargo install sqlx-cli --no-default-features --features postgres
|
||||
DB_IP=$(podman inspect bspds-db-1 --format '{{.NetworkSettings.Networks.bspds_default.IPAddress}}')
|
||||
DATABASE_URL="postgres://bspds:$DB_PASSWORD@$DB_IP:5432/pds" sqlx migrate run --source /opt/bspds/migrations
|
||||
DB_IP=$(podman inspect tranquil-pds-db-1 --format '{{.NetworkSettings.Networks.tranquil-pds_default.IPAddress}}')
|
||||
DATABASE_URL="postgres://tranquil_pds:$DB_PASSWORD@$DB_IP:5432/pds" sqlx migrate run --source /opt/tranquil-pds/migrations
|
||||
```
|
||||
## 8. Obtain Wildcard SSL Certificate
|
||||
User handles are served as subdomains (e.g., `alice.pds.example.com`), so you need a wildcard certificate. Wildcard certs require DNS-01 validation.
|
||||
@@ -255,16 +255,16 @@ User handles are served as subdomains (e.g., `alice.pds.example.com`), so you ne
|
||||
Create temporary self-signed cert to start services:
|
||||
```sh
|
||||
openssl req -x509 -nodes -days 1 -newkey rsa:2048 \
|
||||
-keyout /srv/bspds/data/certs/privkey.pem \
|
||||
-out /srv/bspds/data/certs/fullchain.pem \
|
||||
-keyout /srv/tranquil-pds/data/certs/privkey.pem \
|
||||
-out /srv/tranquil-pds/data/certs/fullchain.pem \
|
||||
-subj "/CN=pds.example.com"
|
||||
rc-service bspds restart
|
||||
rc-service tranquil-pds restart
|
||||
```
|
||||
|
||||
Get a wildcard certificate using DNS validation:
|
||||
```sh
|
||||
podman run --rm -it \
|
||||
-v /srv/bspds/data/certs:/etc/letsencrypt \
|
||||
-v /srv/tranquil-pds/data/certs:/etc/letsencrypt \
|
||||
docker.io/certbot/certbot:v5.2.2 certonly \
|
||||
--manual --preferred-challenges dns \
|
||||
-d pds.example.com -d '*.pds.example.com' \
|
||||
@@ -274,13 +274,13 @@ Follow the prompts to add TXT records to your DNS. Note: manual mode doesn't aut
|
||||
|
||||
Link certificates and restart:
|
||||
```sh
|
||||
ln -sf /srv/bspds/data/certs/live/pds.example.com/fullchain.pem /srv/bspds/data/certs/fullchain.pem
|
||||
ln -sf /srv/bspds/data/certs/live/pds.example.com/privkey.pem /srv/bspds/data/certs/privkey.pem
|
||||
rc-service bspds restart
|
||||
ln -sf /srv/tranquil-pds/data/certs/live/pds.example.com/fullchain.pem /srv/tranquil-pds/data/certs/fullchain.pem
|
||||
ln -sf /srv/tranquil-pds/data/certs/live/pds.example.com/privkey.pem /srv/tranquil-pds/data/certs/privkey.pem
|
||||
rc-service tranquil-pds restart
|
||||
```
|
||||
## 9. Enable Service at Boot
|
||||
```sh
|
||||
rc-update add bspds
|
||||
rc-update add tranquil-pds
|
||||
```
|
||||
## 10. Configure Firewall
|
||||
```sh
|
||||
@@ -305,7 +305,7 @@ rc-update add ip6tables
|
||||
## 11. Certificate Renewal
|
||||
Add to root's crontab (`crontab -e`):
|
||||
```
|
||||
0 0 * * * podman run --rm -v /srv/bspds/data/certs:/etc/letsencrypt -v /srv/bspds/data/acme:/var/www/acme docker.io/certbot/certbot:v5.2.2 renew --quiet && rc-service bspds restart
|
||||
0 0 * * * podman run --rm -v /srv/tranquil-pds/data/certs:/etc/letsencrypt -v /srv/tranquil-pds/data/acme:/var/www/acme docker.io/certbot/certbot:v5.2.2 renew --quiet && rc-service tranquil-pds restart
|
||||
```
|
||||
---
|
||||
# Verification and Maintenance
|
||||
@@ -317,36 +317,36 @@ curl -s https://pds.example.com/.well-known/atproto-did
|
||||
## View Logs
|
||||
**Debian:**
|
||||
```bash
|
||||
journalctl -u bspds-app -f
|
||||
podman logs -f bspds-app
|
||||
journalctl -u tranquil-pds-app -f
|
||||
podman logs -f tranquil-pds-app
|
||||
```
|
||||
**Alpine:**
|
||||
```sh
|
||||
podman-compose -f /srv/bspds/docker-compose.yml logs -f
|
||||
podman logs -f bspds-bspds-1
|
||||
podman-compose -f /srv/tranquil-pds/docker-compose.yml logs -f
|
||||
podman logs -f tranquil-pds-tranquil-pds-1
|
||||
```
|
||||
## Update BSPDS
|
||||
## Update Tranquil PDS
|
||||
```sh
|
||||
cd /opt/bspds
|
||||
cd /opt/tranquil-pds
|
||||
git pull
|
||||
podman build -t bspds:latest .
|
||||
podman build -t tranquil-pds:latest .
|
||||
```
|
||||
|
||||
Debian:
|
||||
```bash
|
||||
systemctl restart bspds-app
|
||||
systemctl restart tranquil-pds-app
|
||||
```
|
||||
|
||||
Alpine:
|
||||
```sh
|
||||
rc-service bspds restart
|
||||
rc-service tranquil-pds restart
|
||||
```
|
||||
## Backup Database
|
||||
**Debian:**
|
||||
```bash
|
||||
podman exec bspds-db pg_dump -U bspds pds > /var/backups/pds-$(date +%Y%m%d).sql
|
||||
podman exec tranquil-pds-db pg_dump -U tranquil_pds pds > /var/backups/pds-$(date +%Y%m%d).sql
|
||||
```
|
||||
**Alpine:**
|
||||
```sh
|
||||
podman exec bspds-db-1 pg_dump -U bspds pds > /var/backups/pds-$(date +%Y%m%d).sql
|
||||
podman exec tranquil-pds-db-1 pg_dump -U tranquil_pds pds > /var/backups/pds-$(date +%Y%m%d).sql
|
||||
```
|
||||
|
||||
+40
-43
@@ -1,7 +1,7 @@
|
||||
# BSPDS Production Installation on Debian
|
||||
# Tranquil PDS Production Installation on Debian
|
||||
> **Warning**: These instructions are untested and theoretical, written from the top of Lewis' head. They may contain errors or omissions. This warning will be removed once the guide has been verified.
|
||||
|
||||
This guide covers installing BSPDS on Debian 13 "Trixie" (current stable as of December 2025).
|
||||
This guide covers installing Tranquil PDS on Debian 13 "Trixie".
|
||||
|
||||
## Prerequisites
|
||||
- A VPS with at least 2GB RAM and 20GB disk
|
||||
@@ -19,16 +19,15 @@ curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
|
||||
source ~/.cargo/env
|
||||
rustup default stable
|
||||
```
|
||||
This installs the latest stable Rust (1.92+ as of December 2025).
|
||||
This installs the latest stable Rust.
|
||||
## 3. Install postgres
|
||||
Debian 13 includes PostgreSQL 17:
|
||||
```bash
|
||||
apt install -y postgresql postgresql-contrib
|
||||
systemctl enable postgresql
|
||||
systemctl start postgresql
|
||||
sudo -u postgres psql -c "CREATE USER bspds WITH PASSWORD 'your-secure-password';"
|
||||
sudo -u postgres psql -c "CREATE DATABASE pds OWNER bspds;"
|
||||
sudo -u postgres psql -c "GRANT ALL PRIVILEGES ON DATABASE pds TO bspds;"
|
||||
sudo -u postgres psql -c "CREATE USER tranquil_pds WITH PASSWORD 'your-secure-password';"
|
||||
sudo -u postgres psql -c "CREATE DATABASE pds OWNER tranquil_pds;"
|
||||
sudo -u postgres psql -c "GRANT ALL PRIVILEGES ON DATABASE pds TO tranquil_pds;"
|
||||
```
|
||||
## 4. Install minio
|
||||
```bash
|
||||
@@ -71,7 +70,6 @@ mc alias set local http://localhost:9000 minioadmin your-minio-password
|
||||
mc mb local/pds-blobs
|
||||
```
|
||||
## 5. Install valkey
|
||||
Debian 13 includes Valkey 8:
|
||||
```bash
|
||||
apt install -y valkey
|
||||
systemctl enable valkey-server
|
||||
@@ -83,11 +81,11 @@ curl -fsSL https://deno.land/install.sh | sh
|
||||
export PATH="$HOME/.deno/bin:$PATH"
|
||||
echo 'export PATH="$HOME/.deno/bin:$PATH"' >> ~/.bashrc
|
||||
```
|
||||
## 7. Clone and Build BSPDS
|
||||
## 7. Clone and Build Tranquil PDS
|
||||
```bash
|
||||
cd /opt
|
||||
git clone https://tangled.org/lewis.moe/bspds-sandbox bspds
|
||||
cd bspds
|
||||
git clone https://tangled.org/lewis.moe/bspds-sandbox tranquil-pds
|
||||
cd tranquil-pds
|
||||
cd frontend
|
||||
deno task build
|
||||
cd ..
|
||||
@@ -96,51 +94,50 @@ cargo build --release
|
||||
## 8. Install sqlx-cli and Run Migrations
|
||||
```bash
|
||||
cargo install sqlx-cli --no-default-features --features postgres
|
||||
export DATABASE_URL="postgres://bspds:your-secure-password@localhost:5432/pds"
|
||||
export DATABASE_URL="postgres://tranquil_pds:your-secure-password@localhost:5432/pds"
|
||||
sqlx migrate run
|
||||
```
|
||||
## 9. Configure BSPDS
|
||||
## 9. Configure Tranquil PDS
|
||||
```bash
|
||||
mkdir -p /etc/bspds
|
||||
cp /opt/bspds/.env.example /etc/bspds/bspds.env
|
||||
chmod 600 /etc/bspds/bspds.env
|
||||
mkdir -p /etc/tranquil-pds
|
||||
cp /opt/tranquil-pds/.env.example /etc/tranquil-pds/tranquil-pds.env
|
||||
chmod 600 /etc/tranquil-pds/tranquil-pds.env
|
||||
```
|
||||
Edit `/etc/bspds/bspds.env` and fill in your values. Generate secrets with:
|
||||
Edit `/etc/tranquil-pds/tranquil-pds.env` and fill in your values. Generate secrets with:
|
||||
```bash
|
||||
openssl rand -base64 48
|
||||
```
|
||||
## 10. Create Systemd Service
|
||||
```bash
|
||||
useradd -r -s /sbin/nologin bspds
|
||||
cp /opt/bspds/target/release/bspds /usr/local/bin/
|
||||
mkdir -p /var/lib/bspds
|
||||
cp -r /opt/bspds/frontend/dist /var/lib/bspds/frontend
|
||||
chown -R bspds:bspds /var/lib/bspds
|
||||
cat > /etc/systemd/system/bspds.service << 'EOF'
|
||||
useradd -r -s /sbin/nologin tranquil-pds
|
||||
cp /opt/tranquil-pds/target/release/tranquil-pds /usr/local/bin/
|
||||
mkdir -p /var/lib/tranquil-pds
|
||||
cp -r /opt/tranquil-pds/frontend/dist /var/lib/tranquil-pds/frontend
|
||||
chown -R tranquil-pds:tranquil-pds /var/lib/tranquil-pds
|
||||
cat > /etc/systemd/system/tranquil-pds.service << 'EOF'
|
||||
[Unit]
|
||||
Description=BSPDS - AT Protocol PDS
|
||||
Description=Tranquil PDS - AT Protocol PDS
|
||||
After=network.target postgresql.service minio.service
|
||||
[Service]
|
||||
Type=simple
|
||||
User=bspds
|
||||
Group=bspds
|
||||
EnvironmentFile=/etc/bspds/bspds.env
|
||||
Environment=FRONTEND_DIR=/var/lib/bspds/frontend
|
||||
ExecStart=/usr/local/bin/bspds
|
||||
User=tranquil-pds
|
||||
Group=tranquil-pds
|
||||
EnvironmentFile=/etc/tranquil-pds/tranquil-pds.env
|
||||
Environment=FRONTEND_DIR=/var/lib/tranquil-pds/frontend
|
||||
ExecStart=/usr/local/bin/tranquil-pds
|
||||
Restart=always
|
||||
RestartSec=5
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
EOF
|
||||
systemctl daemon-reload
|
||||
systemctl enable bspds
|
||||
systemctl start bspds
|
||||
systemctl enable tranquil-pds
|
||||
systemctl start tranquil-pds
|
||||
```
|
||||
## 11. Install and Configure nginx
|
||||
Debian 13 includes nginx 1.26:
|
||||
```bash
|
||||
apt install -y nginx certbot python3-certbot-nginx
|
||||
cat > /etc/nginx/sites-available/bspds << 'EOF'
|
||||
cat > /etc/nginx/sites-available/tranquil-pds << 'EOF'
|
||||
server {
|
||||
listen 80;
|
||||
listen [::]:80;
|
||||
@@ -158,7 +155,7 @@ server {
|
||||
}
|
||||
}
|
||||
EOF
|
||||
ln -s /etc/nginx/sites-available/bspds /etc/nginx/sites-enabled/
|
||||
ln -s /etc/nginx/sites-available/tranquil-pds /etc/nginx/sites-enabled/
|
||||
rm -f /etc/nginx/sites-enabled/default
|
||||
nginx -t
|
||||
systemctl reload nginx
|
||||
@@ -192,26 +189,26 @@ ufw enable
|
||||
```
|
||||
## 14. Verify Installation
|
||||
```bash
|
||||
systemctl status bspds
|
||||
systemctl status tranquil-pds
|
||||
curl -s https://pds.example.com/xrpc/_health | jq
|
||||
curl -s https://pds.example.com/.well-known/atproto-did
|
||||
```
|
||||
## Maintenance
|
||||
View logs:
|
||||
```bash
|
||||
journalctl -u bspds -f
|
||||
journalctl -u tranquil-pds -f
|
||||
```
|
||||
Update BSPDS:
|
||||
Update Tranquil PDS:
|
||||
```bash
|
||||
cd /opt/bspds
|
||||
cd /opt/tranquil-pds
|
||||
git pull
|
||||
cd frontend && deno task build && cd ..
|
||||
cargo build --release
|
||||
systemctl stop bspds
|
||||
cp target/release/bspds /usr/local/bin/
|
||||
cp -r frontend/dist /var/lib/bspds/frontend
|
||||
DATABASE_URL="postgres://bspds:your-secure-password@localhost:5432/pds" sqlx migrate run
|
||||
systemctl start bspds
|
||||
systemctl stop tranquil-pds
|
||||
cp target/release/tranquil-pds /usr/local/bin/
|
||||
cp -r frontend/dist /var/lib/tranquil-pds/frontend
|
||||
DATABASE_URL="postgres://tranquil_pds:your-secure-password@localhost:5432/pds" sqlx migrate run
|
||||
systemctl start tranquil-pds
|
||||
```
|
||||
Backup database:
|
||||
```bash
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# BSPDS on Kubernetes
|
||||
# Tranquil PDS on Kubernetes
|
||||
|
||||
If you're reaching for kubernetes for this app, you're experienced enough to know how to spin up:
|
||||
|
||||
|
||||
+36
-37
@@ -1,6 +1,6 @@
|
||||
# BSPDS Production Installation on OpenBSD
|
||||
# Tranquil PDS Production Installation on OpenBSD
|
||||
> **Warning**: These instructions are untested and theoretical, written from the top of Lewis' head. They may contain errors or omissions. This warning will be removed once the guide has been verified.
|
||||
This guide covers installing BSPDS on OpenBSD 7.8 (current release as of December 2025).
|
||||
This guide covers installing Tranquil PDS on OpenBSD 7.8.
|
||||
## Prerequisites
|
||||
- A VPS with at least 2GB RAM and 20GB disk
|
||||
- A domain name pointing to your server's IP
|
||||
@@ -16,7 +16,7 @@ pkg_add curl git
|
||||
```sh
|
||||
pkg_add rust
|
||||
```
|
||||
OpenBSD 7.8 ships Rust 1.82+. For the latest stable (1.92+), use rustup:
|
||||
OpenBSD ships Rust in ports. For the latest stable, use rustup:
|
||||
```sh
|
||||
pkg_add rustup
|
||||
rustup-init -y
|
||||
@@ -24,7 +24,6 @@ source ~/.cargo/env
|
||||
rustup default stable
|
||||
```
|
||||
## 3. Install postgres
|
||||
OpenBSD 7.8 includes PostgreSQL 17 (PostgreSQL 18 may not yet be in ports):
|
||||
```sh
|
||||
pkg_add postgresql-server postgresql-client
|
||||
mkdir -p /var/postgresql/data
|
||||
@@ -32,9 +31,9 @@ chown _postgresql:_postgresql /var/postgresql/data
|
||||
su - _postgresql -c "initdb -D /var/postgresql/data -U postgres -A scram-sha-256"
|
||||
rcctl enable postgresql
|
||||
rcctl start postgresql
|
||||
psql -U postgres -c "CREATE USER bspds WITH PASSWORD 'your-secure-password';"
|
||||
psql -U postgres -c "CREATE DATABASE pds OWNER bspds;"
|
||||
psql -U postgres -c "GRANT ALL PRIVILEGES ON DATABASE pds TO bspds;"
|
||||
psql -U postgres -c "CREATE USER tranquil_pds WITH PASSWORD 'your-secure-password';"
|
||||
psql -U postgres -c "CREATE DATABASE pds OWNER tranquil_pds;"
|
||||
psql -U postgres -c "GRANT ALL PRIVILEGES ON DATABASE pds TO tranquil_pds;"
|
||||
```
|
||||
## 4. Install minio
|
||||
OpenBSD doesn't have a minio package. Options:
|
||||
@@ -93,11 +92,11 @@ curl -fsSL https://deno.land/install.sh | sh
|
||||
export PATH="$HOME/.deno/bin:$PATH"
|
||||
echo 'export PATH="$HOME/.deno/bin:$PATH"' >> ~/.profile
|
||||
```
|
||||
## 7. Clone and Build BSPDS
|
||||
## 7. Clone and Build Tranquil PDS
|
||||
```sh
|
||||
mkdir -p /opt && cd /opt
|
||||
git clone https://tangled.org/lewis.moe/bspds-sandbox bspds
|
||||
cd bspds
|
||||
git clone https://tangled.org/lewis.moe/bspds-sandbox tranquil-pds
|
||||
cd tranquil-pds
|
||||
cd frontend
|
||||
deno task build
|
||||
cd ..
|
||||
@@ -106,46 +105,46 @@ cargo build --release
|
||||
## 8. Install sqlx-cli and Run Migrations
|
||||
```sh
|
||||
cargo install sqlx-cli --no-default-features --features postgres
|
||||
export DATABASE_URL="postgres://bspds:your-secure-password@localhost:5432/pds"
|
||||
export DATABASE_URL="postgres://tranquil_pds:your-secure-password@localhost:5432/pds"
|
||||
sqlx migrate run
|
||||
```
|
||||
## 9. Configure BSPDS
|
||||
## 9. Configure Tranquil PDS
|
||||
```sh
|
||||
mkdir -p /etc/bspds
|
||||
cp /opt/bspds/.env.example /etc/bspds/bspds.conf
|
||||
chmod 600 /etc/bspds/bspds.conf
|
||||
mkdir -p /etc/tranquil-pds
|
||||
cp /opt/tranquil-pds/.env.example /etc/tranquil-pds/tranquil-pds.conf
|
||||
chmod 600 /etc/tranquil-pds/tranquil-pds.conf
|
||||
```
|
||||
Edit `/etc/bspds/bspds.conf` and fill in your values. Generate secrets with:
|
||||
Edit `/etc/tranquil-pds/tranquil-pds.conf` and fill in your values. Generate secrets with:
|
||||
```sh
|
||||
openssl rand -base64 48
|
||||
```
|
||||
## 10. Create rc.d Service
|
||||
```sh
|
||||
useradd -d /var/empty -s /sbin/nologin _bspds
|
||||
cp /opt/bspds/target/release/bspds /usr/local/bin/
|
||||
mkdir -p /var/bspds
|
||||
cp -r /opt/bspds/frontend/dist /var/bspds/frontend
|
||||
chown -R _bspds:_bspds /var/bspds
|
||||
cat > /etc/rc.d/bspds << 'EOF'
|
||||
useradd -d /var/empty -s /sbin/nologin _tranquil_pds
|
||||
cp /opt/tranquil-pds/target/release/tranquil-pds /usr/local/bin/
|
||||
mkdir -p /var/tranquil-pds
|
||||
cp -r /opt/tranquil-pds/frontend/dist /var/tranquil-pds/frontend
|
||||
chown -R _tranquil_pds:_tranquil_pds /var/tranquil-pds
|
||||
cat > /etc/rc.d/tranquil_pds << 'EOF'
|
||||
#!/bin/ksh
|
||||
daemon="/usr/local/bin/bspds"
|
||||
daemon_user="_bspds"
|
||||
daemon="/usr/local/bin/tranquil-pds"
|
||||
daemon_user="_tranquil_pds"
|
||||
daemon_logger="daemon.info"
|
||||
. /etc/rc.d/rc.subr
|
||||
rc_pre() {
|
||||
export FRONTEND_DIR=/var/bspds/frontend
|
||||
export FRONTEND_DIR=/var/tranquil-pds/frontend
|
||||
while IFS='=' read -r key value; do
|
||||
case "$key" in
|
||||
\#*|"") continue ;;
|
||||
esac
|
||||
export "$key=$value"
|
||||
done < /etc/bspds/bspds.conf
|
||||
done < /etc/tranquil-pds/tranquil-pds.conf
|
||||
}
|
||||
rc_cmd $1
|
||||
EOF
|
||||
chmod +x /etc/rc.d/bspds
|
||||
rcctl enable bspds
|
||||
rcctl start bspds
|
||||
chmod +x /etc/rc.d/tranquil_pds
|
||||
rcctl enable tranquil_pds
|
||||
rcctl start tranquil_pds
|
||||
```
|
||||
## 11. Install and Configure nginx
|
||||
```sh
|
||||
@@ -227,7 +226,7 @@ pfctl -f /etc/pf.conf
|
||||
```
|
||||
## 14. Verify Installation
|
||||
```sh
|
||||
rcctl check bspds
|
||||
rcctl check tranquil_pds
|
||||
ftp -o - https://pds.example.com/xrpc/_health
|
||||
ftp -o - https://pds.example.com/.well-known/atproto-did
|
||||
```
|
||||
@@ -236,17 +235,17 @@ View logs:
|
||||
```sh
|
||||
tail -f /var/log/daemon
|
||||
```
|
||||
Update BSPDS:
|
||||
Update Tranquil PDS:
|
||||
```sh
|
||||
cd /opt/bspds
|
||||
cd /opt/tranquil-pds
|
||||
git pull
|
||||
cd frontend && deno task build && cd ..
|
||||
cargo build --release
|
||||
rcctl stop bspds
|
||||
cp target/release/bspds /usr/local/bin/
|
||||
cp -r frontend/dist /var/bspds/frontend
|
||||
DATABASE_URL="postgres://bspds:your-secure-password@localhost:5432/pds" sqlx migrate run
|
||||
rcctl start bspds
|
||||
rcctl stop tranquil_pds
|
||||
cp target/release/tranquil-pds /usr/local/bin/
|
||||
cp -r frontend/dist /var/tranquil-pds/frontend
|
||||
DATABASE_URL="postgres://tranquil_pds:your-secure-password@localhost:5432/pds" sqlx migrate run
|
||||
rcctl start tranquil_pds
|
||||
```
|
||||
Backup database:
|
||||
```sh
|
||||
|
||||
Reference in New Issue
Block a user