pdsinit/mkpdsenv.sh
2025-01-29 03:05:33 -08:00

37 lines
959 B
Bash

#!/bin/bash
if [ -f "pds.env" ]
then echo pds.env file already exists
exit
fi
while getopts u: flag
do
case "${flag}" in
u) userhandledomains=${OPTARG};;
esac
done
if [ -n "$userhandledomains" ]
then pshd="PDS_SERVICE_HANDLE_DOMAINS=$userhandledomains"
fi
echo "
PDS_HOSTNAME=$1
$pshd
PDS_JWT_SECRET=`openssl rand --hex 16`
PDS_ADMIN_PASSWORD=`openssl rand --hex 16`
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`
PDS_DATA_DIRECTORY=/data
PDS_BLOBSTORE_DISK_LOCATION=/data/blobs
PDS_BLOB_UPLOAD_LIMIT=52428800
PDS_DID_PLC_URL=https://plc.directory
PDS_BSKY_APP_VIEW_URL=https://api.bsky.app
PDS_BSKY_APP_VIEW_DID=did:web:api.bsky.app
PDS_REPORT_SERVICE_URL=https://mod.bsky.app
PDS_REPORT_SERVICE_DID=did:plc:ar7c4by46qjdydhdevvrndac
PDS_CRAWLERS=https://bsky.network
LOG_ENABLED=true
PDS_PORT=3000
NODE_ENV=production
" > pds.env