char/topaz-flake
git clone https://git.t4t.associates/char/topaz-flake
e6f2612
main
1{ pkgs , lib , config , tranquil , ...} : 2{ 3services . bluesky-pds = { 4enable = true ; 5settings = { 6PDS_HOSTNAME = "pds2.bun.how" ; 7PDS_PORT = 6280 ; 8 9PDS_INVITE_REQUIRED = "true" ; 10PDS_RATE_LIMITS_ENABLED = "false" ; 11 12PDS_BLOB_UPLOAD_LIMIT = "1073741824" ; 13 14PDS_DID_PLC_URL = "https://plc.directory" ; 15PDS_BSKY_APP_VIEW_URL = "https://api.pop1.bsky.app" ; 16PDS_BSKY_APP_VIEW_DID = "did:web:api.bsky.app" ; 17PDS_REPORT_SERVICE_URL = "https://mod.bsky.app" ; 18PDS_REPORT_SERVICE_DID = "did:plc:ar7c4by46qjdydhdevvrndac" ; 19PDS_CRAWLERS = "https://bsky.network" ; 20 21}; 22environmentFiles = [ "/srv/pds/.env" ]; 23}; 24 25services . nginx . virtualHosts .${ config . services . bluesky-pds . settings . PDS_HOSTNAME } = { 26forceSSL = true ; 27enableACME = true ; 28 29locations . "/" = { 30proxyPass = "http://127.0.0.1: ${ toString config . services . bluesky-pds . settings . PDS_PORT } " ; 31proxyWebsockets = true ; 32extraConfig = '' 33client_max_body_size 1G; 34proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; 35'' ; 36}; 37 38locations . "= /" . extraConfig = '' 39default_type text/plain; 40return 200 "pds2.bun.how"; 41'' ; 42 43locations . "/xrpc/app.bsky.ageassurance.getState" . extraConfig = '' 44default_type application/json; 45add_header access-control-allow-headers $http_access_control_request_headers always; 46add_header access-control-allow-origin "*" always; 47return 200 '{"state":{"lastInitiatedAt":"2025-07-25T01:40:38.406Z","status":"assured","access":"full"},"metadata":{"accountCreatedAt":"2024-10-17T13:55:48.833Z"}}'; 48'' ; 49}; 50 51services . tranquil-pds = { 52enable = true ; 53 54# `nix run nixpkgs#openssl -- rand -base64 48` 55# for JWT_SECRET, DPOP_SECRET, MASTER_KEY 56environmentFiles = [ "/srv/tranquil-pds/.env" ]; 57database . createLocally = true ; 58settings = { 59server = { 60host = "127.0.0.2" ; 61port = 6281 ; 62hostname = "pds3.bun.how" ; 63age_assurance_override = true ; 64}; 65}; 66}; 67 68services . nginx . virtualHosts .${ config . services . tranquil-pds . settings . server . hostname } = { 69forceSSL = true ; 70enableACME = true ; 71 72locations . "/" = { 73proxyPass = "http:// ${ config . services . tranquil-pds . settings . server . host } : ${ toString config . services . tranquil-pds . settings . server . port } " ; 74proxyWebsockets = true ; 75extraConfig = '' 76client_max_body_size 10G; 77proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; 78proxy_hide_header Access-Control-Allow-Headers; 79proxy_hide_header Access-Control-Allow-Origin; 80add_header access-control-allow-headers $http_access_control_request_headers always; 81add_header access-control-allow-origin "*" always; 82'' ; 83}; 84 85locations . "/xrpc/app.bsky.ageassurance.getState" . extraConfig = '' 86default_type application/json; 87add_header access-control-allow-headers $http_access_control_request_headers always; 88add_header access-control-allow-origin "*" always; 89return 200 '{"state":{"lastInitiatedAt":"2025-07-25T01:40:38.406Z","status":"assured","access":"full"},"metadata":{"accountCreatedAt":"2024-10-17T13:55:48.833Z"}}'; 90'' ; 91}; 92}