mirror of
https://tangled.org/tranquil.farm/tranquil-pds
synced 2026-09-03 16:56:54 +00:00
feat: filesystem blob storage
This commit is contained in:
@@ -7,7 +7,8 @@ This guide covers deploying Tranquil PDS using containers with podman.
|
||||
|
||||
## Prerequisites
|
||||
|
||||
- A VPS with at least 2GB RAM and 20GB disk
|
||||
- A VPS with at least 2GB RAM
|
||||
- Disk space for blobs (depends on usage; plan for ~1GB per active user as a baseline)
|
||||
- A domain name pointing to your server's IP
|
||||
- A **wildcard TLS certificate** for `*.pds.example.com` (user handles are served as subdomains)
|
||||
- Root or sudo access
|
||||
@@ -42,7 +43,7 @@ For production setups with proper service management, continue to either the Deb
|
||||
|
||||
## Standalone Containers (No Compose)
|
||||
|
||||
If you already have postgres, valkey, and minio running on the host (eg., from the [Debian install guide](install-debian.md)), you can run just the app containers.
|
||||
If you already have postgres and valkey running on the host (eg., from the [Debian install guide](install-debian.md)), you can run just the app containers.
|
||||
|
||||
Build the images:
|
||||
```sh
|
||||
@@ -50,11 +51,12 @@ podman build -t tranquil-pds:latest .
|
||||
podman build -t tranquil-pds-frontend:latest ./frontend
|
||||
```
|
||||
|
||||
Run the backend with host networking (so it can access postgres/valkey/minio on localhost):
|
||||
Run the backend with host networking (so it can access postgres/valkey on localhost) and mount the blob storage:
|
||||
```sh
|
||||
podman run -d --name tranquil-pds \
|
||||
--network=host \
|
||||
--env-file /etc/tranquil-pds/tranquil-pds.env \
|
||||
-v /var/lib/tranquil:/var/lib/tranquil:Z \
|
||||
tranquil-pds:latest
|
||||
```
|
||||
|
||||
@@ -104,7 +106,7 @@ apt install -y podman
|
||||
|
||||
```bash
|
||||
mkdir -p /etc/containers/systemd
|
||||
mkdir -p /srv/tranquil-pds/{postgres,minio,valkey,certs,acme,config}
|
||||
mkdir -p /srv/tranquil-pds/{postgres,valkey,blobs,backups,certs,acme,config}
|
||||
```
|
||||
|
||||
## Create Environment File
|
||||
@@ -152,26 +154,16 @@ podman build -t tranquil-pds-frontend:latest ./frontend
|
||||
```bash
|
||||
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 -
|
||||
```
|
||||
|
||||
## Start Services and Initialize
|
||||
|
||||
```bash
|
||||
systemctl daemon-reload
|
||||
systemctl start tranquil-pds-db tranquil-pds-minio tranquil-pds-valkey
|
||||
systemctl start tranquil-pds-db tranquil-pds-valkey
|
||||
sleep 10
|
||||
```
|
||||
|
||||
Create the minio buckets:
|
||||
```bash
|
||||
podman run --rm --pod tranquil-pds \
|
||||
-e MINIO_ROOT_USER=minioadmin \
|
||||
-e MINIO_ROOT_PASSWORD=your-minio-password \
|
||||
cgr.dev/chainguard/minio-client:latest-dev \
|
||||
sh -c "mc alias set local http://localhost:9000 \$MINIO_ROOT_USER \$MINIO_ROOT_PASSWORD && mc mb --ignore-existing local/pds-blobs && mc mb --ignore-existing local/pds-backups"
|
||||
```
|
||||
|
||||
Run migrations:
|
||||
```bash
|
||||
cargo install sqlx-cli --no-default-features --features postgres
|
||||
@@ -215,7 +207,7 @@ systemctl restart tranquil-pds-nginx
|
||||
## Enable All Services
|
||||
|
||||
```bash
|
||||
systemctl enable tranquil-pds-db tranquil-pds-minio tranquil-pds-valkey tranquil-pds-app tranquil-pds-frontend tranquil-pds-nginx
|
||||
systemctl enable tranquil-pds-db tranquil-pds-valkey tranquil-pds-app tranquil-pds-frontend tranquil-pds-nginx
|
||||
```
|
||||
|
||||
## Configure Firewall
|
||||
@@ -260,7 +252,7 @@ rc-service podman start
|
||||
|
||||
```sh
|
||||
mkdir -p /srv/tranquil-pds/{data,config}
|
||||
mkdir -p /srv/tranquil-pds/data/{postgres,minio,valkey,certs,acme}
|
||||
mkdir -p /srv/tranquil-pds/data/{postgres,valkey,blobs,backups,certs,acme}
|
||||
```
|
||||
|
||||
## Clone Repository and Build Images
|
||||
@@ -342,16 +334,6 @@ rc-service tranquil-pds start
|
||||
sleep 15
|
||||
```
|
||||
|
||||
Create the minio buckets:
|
||||
```sh
|
||||
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" \
|
||||
cgr.dev/chainguard/minio-client:latest-dev \
|
||||
sh -c 'mc alias set local http://minio:9000 $MINIO_ROOT_USER $MINIO_ROOT_PASSWORD && mc mb --ignore-existing local/pds-blobs && mc mb --ignore-existing local/pds-backups'
|
||||
```
|
||||
|
||||
Run migrations:
|
||||
```sh
|
||||
apk add rustup
|
||||
|
||||
+11
-41
@@ -4,7 +4,8 @@ This guide covers installing Tranquil PDS on Debian 13.
|
||||
|
||||
## Prerequisites
|
||||
|
||||
- A VPS with at least 2GB RAM and 20GB disk
|
||||
- A VPS with at least 2GB RAM
|
||||
- Disk space for blobs (depends on usage; plan for ~1GB per active user as a baseline)
|
||||
- A domain name pointing to your server's IP
|
||||
- A wildcard TLS certificate for `*.pds.example.com` (user handles are served as subdomains)
|
||||
- Root or sudo access
|
||||
@@ -37,49 +38,13 @@ 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;"
|
||||
```
|
||||
|
||||
## Install minio
|
||||
## Create Blob Storage Directories
|
||||
|
||||
```bash
|
||||
curl -O https://dl.min.io/server/minio/release/linux-amd64/minio
|
||||
chmod +x minio
|
||||
mv minio /usr/local/bin/
|
||||
mkdir -p /var/lib/minio/data
|
||||
useradd -r -s /sbin/nologin minio-user
|
||||
chown -R minio-user:minio-user /var/lib/minio
|
||||
cat > /etc/default/minio << 'EOF'
|
||||
MINIO_ROOT_USER=minioadmin
|
||||
MINIO_ROOT_PASSWORD=your-minio-password
|
||||
MINIO_VOLUMES="/var/lib/minio/data"
|
||||
MINIO_OPTS="--console-address :9001"
|
||||
EOF
|
||||
cat > /etc/systemd/system/minio.service << 'EOF'
|
||||
[Unit]
|
||||
Description=MinIO Object Storage
|
||||
After=network.target
|
||||
[Service]
|
||||
User=minio-user
|
||||
Group=minio-user
|
||||
EnvironmentFile=/etc/default/minio
|
||||
ExecStart=/usr/local/bin/minio server $MINIO_VOLUMES $MINIO_OPTS
|
||||
Restart=always
|
||||
LimitNOFILE=65536
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
EOF
|
||||
systemctl daemon-reload
|
||||
systemctl enable minio
|
||||
systemctl start minio
|
||||
mkdir -p /var/lib/tranquil/blobs /var/lib/tranquil/backups
|
||||
```
|
||||
|
||||
Create the buckets (wait a few seconds for minio to start):
|
||||
```bash
|
||||
curl -O https://dl.min.io/client/mc/release/linux-amd64/mc
|
||||
chmod +x mc
|
||||
mv mc /usr/local/bin/
|
||||
mc alias set local http://localhost:9000 minioadmin your-minio-password
|
||||
mc mb local/pds-blobs
|
||||
mc mb local/pds-backups
|
||||
```
|
||||
We'll set ownership after creating the service user.
|
||||
|
||||
## Install valkey
|
||||
|
||||
@@ -142,12 +107,13 @@ chown -R www-data:www-data /var/www/tranquil-pds
|
||||
|
||||
```bash
|
||||
useradd -r -s /sbin/nologin tranquil-pds
|
||||
chown -R tranquil-pds:tranquil-pds /var/lib/tranquil
|
||||
cp /opt/tranquil-pds/target/release/tranquil-pds /usr/local/bin/
|
||||
|
||||
cat > /etc/systemd/system/tranquil-pds.service << 'EOF'
|
||||
[Unit]
|
||||
Description=Tranquil PDS - AT Protocol PDS
|
||||
After=network.target postgresql.service minio.service
|
||||
After=network.target postgresql.service
|
||||
[Service]
|
||||
Type=simple
|
||||
User=tranquil-pds
|
||||
@@ -156,6 +122,10 @@ EnvironmentFile=/etc/tranquil-pds/tranquil-pds.env
|
||||
ExecStart=/usr/local/bin/tranquil-pds
|
||||
Restart=always
|
||||
RestartSec=5
|
||||
ProtectSystem=strict
|
||||
ProtectHome=true
|
||||
PrivateTmp=true
|
||||
ReadWritePaths=/var/lib/tranquil
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
EOF
|
||||
|
||||
@@ -4,15 +4,15 @@ If you're reaching for kubernetes for this app, you're experienced enough to kno
|
||||
|
||||
- cloudnativepg (or your preferred postgres operator)
|
||||
- valkey
|
||||
- s3-compatible object storage (minio operator, or just use a managed service)
|
||||
- a PersistentVolume for blob storage
|
||||
- the app itself (it's just a container with some env vars)
|
||||
|
||||
You'll need a wildcard TLS certificate for `*.your-pds-hostname.example.com`. User handles are served as subdomains.
|
||||
|
||||
The container image expects:
|
||||
- `DATABASE_URL` - postgres connection string
|
||||
- `S3_ENDPOINT`, `AWS_ACCESS_KEY_ID`, `AWS_SECRET_ACCESS_KEY`, `S3_BUCKET`
|
||||
- `BACKUP_S3_BUCKET` - bucket for repo backups (optional but recommended)
|
||||
- `BLOB_STORAGE_PATH` - path to blob storage (mount a PV here)
|
||||
- `BACKUP_STORAGE_PATH` - path for repo backups (optional but recommended)
|
||||
- `VALKEY_URL` - redis:// connection string
|
||||
- `PDS_HOSTNAME` - your PDS hostname (without protocol)
|
||||
- `JWT_SECRET`, `DPOP_SECRET`, `MASTER_KEY` - generate with `openssl rand -base64 48`
|
||||
|
||||
Reference in New Issue
Block a user