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

  1. # -*- mode: shell-script -*-
  2. PDS_LOCAL_DATADIR=/var/lib/bluesky
  3. PDS_DATADIR="$SERVICE_DATASTORE$PDS_LOCAL_DATADIR"
  4. PDS_ENV_FILE="$PDS_DATADIR/.env"
  5. bluesky:init() {
  6. init-config-add "
  7. $SERVICE_NAME:
  8. env_file:
  9. - \"$PDS_ENV_FILE\"
  10. "
  11. [ -e "$PDS_ENV_FILE" ] && return
  12. local admin_password=$(password:get admin internal) || {
  13. echo "Failed to get admin password" >&2
  14. return 1
  15. }
  16. mkdir -p "${PDS_ENV_FILE%/*}"
  17. cat > "$PDS_ENV_FILE" <<EOF
  18. PDS_JWT_SECRET=$(openssl rand -hex 16)
  19. PDS_ADMIN_PASSWORD=${admin_password}
  20. PDS_PLC_ROTATION_KEY_K256_PRIVATE_KEY_HEX=$(
  21. openssl ecparam --name secp256k1 --genkey --noout --outform DER |
  22. tail --bytes=+8 |
  23. head --bytes=32 |
  24. xxd --plain --cols 32
  25. )
  26. PDS_DATA_DIRECTORY=${PDS_LOCAL_DATADIR}
  27. PDS_BLOBSTORE_DISK_LOCATION=${PDS_LOCAL_DATADIR}/blocks
  28. PDS_BLOB_UPLOAD_LIMIT=52428800
  29. PDS_DID_PLC_URL=https://plc.directory
  30. PDS_BSKY_APP_VIEW_URL=https://api.bsky.app
  31. PDS_BSKY_APP_VIEW_DID=did:web:api.bsky.app
  32. PDS_REPORT_SERVICE_URL=https://mod.bsky.app
  33. PDS_REPORT_SERVICE_DID=did:plc:ar7c4by46qjdydhdevvrndac
  34. PDS_CRAWLERS=https://bsky.network
  35. LOG_ENABLED=true
  36. EOF
  37. }