You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

49 lines
1.1 KiB

# -*- mode: shell-script -*-
PDS_LOCAL_DATADIR=/var/lib/bluesky
PDS_DATADIR="$SERVICE_DATASTORE$PDS_LOCAL_DATADIR"
PDS_ENV_FILE="$PDS_DATADIR/.env"
bluesky:init() {
init-config-add "
$SERVICE_NAME:
env_file:
- \"$PDS_ENV_FILE\"
"
[ -e "$PDS_ENV_FILE" ] && return
local admin_password=$(password:get admin internal) || {
echo "Failed to get admin password" >&2
return 1
}
mkdir -p "${PDS_ENV_FILE%/*}"
cat > "$PDS_ENV_FILE" <<EOF
PDS_JWT_SECRET=$(openssl rand -hex 16)
PDS_ADMIN_PASSWORD=${admin_password}
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=${PDS_LOCAL_DATADIR}
PDS_BLOBSTORE_DISK_LOCATION=${PDS_LOCAL_DATADIR}/blocks
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
EOF
}