| 104 | |
| 105 | // Get config from env vars |
| 106 | function getPDSConfig(): |
| 107 | | { pdsUrl: string; handle: AtIdentifierString; password: string } |
| 108 | | undefined { |
| 109 | const pdsUrl = process.env.NPMX_PDS_URL |
| 110 | if (!pdsUrl) { |
| 111 | console.warn('[standard-site-sync] NPMX_PDS_URL not set, skipping sync') |
| 112 | return |
| 113 | } |
| 114 | |
| 115 | const handle = process.env.NPMX_IDENTIFIER |
| 116 | const password = process.env.NPMX_APP_PASSWORD |
| 117 | |
| 118 | if (!handle || !password || !isAtIdentifierString(handle)) { |
| 119 | console.warn('[standard-site-sync] NPMX_IDENTIFIER or NPMX_APP_PASSWORD not set, skipping sync') |
| 120 | return |
| 121 | } |
| 122 | |
| 123 | return { |
| 124 | pdsUrl, |
| 125 | handle, |
| 126 | password, |
| 127 | } |
| 128 | } |
| 129 | |
| 130 | async function syncsiteStandardDocuments(client: Client, documentsToSync: DocumentToSync[]) { |
| 131 | let currentCommit = await client.xrpc(com.atproto.sync.getLatestCommit, { |