cursed PDS patches
pds.Dockerfile edited
18 lines 1.1 kB view raw
1FROM ghcr.io/bluesky-social/pds:0.4 2 3# 1 = bypass int validation for PDS_PORT so we can use unix sockets instead 4# 2 = x-forwarded-for hack because the entire js ecosystem can not handle unix sockets correctly (https://www.npmjs.com/package/trustproxy) 5# 3,4,5 = tid suffix trick 6RUN sed -i "s/common_1.envInt)('PDS_PORT/common_1.envStr)('PDS_PORT/" /app/node_modules/@atproto/pds/dist/config/env.js \ 7 && sed -i "s/'trust proxy'/'trust proxy', (ip) => ip == undefined/" /app/node_modules/@atproto/pds/dist/index.js \ 8 && sed -i 's/"use strict"/"use strict"; let lastRkeyPrefix/' /app/node_modules/@atproto/pds/dist/repo/prepare.js \ 9 && sed -i "s/const rkey/let rkey/" /app/node_modules/@atproto/pds/dist/repo/prepare.js \ 10 && sed -i "s/(0, syntax_1.ensureValidRecordKey)(rkey);/if (!opts.rkey) {\ 11 const SUFFIX = 'kopper';\ 12 let prefix = rkey.substr(0,13-SUFFIX.length);\ 13 if (lastRkeyPrefix != prefix) {\ 14 lastRkeyPrefix = prefix;\ 15 rkey = prefix + SUFFIX;\ 16 }\ 17 };\ 18 (0, syntax_1.ensureValidRecordKey)(rkey);/" /app/node_modules/@atproto/pds/dist/repo/prepare.js