959 B · 15 lines · Created 1y ago
123456789101112131415FROM ghcr.io/bluesky-social/pds:0.4
# 1 = bypass int validation for PDS_PORT so we can use unix sockets instead# 2 = x-forwarded-for hack because the entire js ecosystem can not handle unix sockets correctly (https://www.npmjs.com/package/trustproxy)# 3,4 = tid suffix trickRUN sed -i "s/envInt('PDS_PORT/envStr('PDS_PORT/" /app/node_modules/@atproto/pds/dist/config/env.js \ && sed -i "s/'trust proxy'/'trust proxy', (ip) => ip == undefined/" /app/node_modules/@atproto/pds/dist/index.js \ && sed -i 's/const knownSchemas/let lastRkeyPrefix=undefined; const knownSchemas/' /app/node_modules/@atproto/pds/dist/repo/prepare.js \ && sed -i "s/const nextRkey = TID.next();/let nextRkey = TID.next().toString();\n\ const SUFFIX = 'kopper';\n\ let prefix = nextRkey.substr(0,13-SUFFIX.length);\n\ if (lastRkeyPrefix != prefix) {\n\ lastRkeyPrefix = prefix;\n\ nextRkey = prefix + SUFFIX;\n\ }\n/" /app/node_modules/@atproto/pds/dist/repo/prepare.js