fix atproto service pds, bsky, social-app for patch
This commit is contained in:
@@ -1,14 +1,89 @@
|
||||
diff --git a/services/bsky/api.js b/services/bsky/api.js
|
||||
index 56c769b9d..5d14c0057 100644
|
||||
--- a/services/bsky/api.js
|
||||
+++ b/services/bsky/api.js
|
||||
@@ -44,19 +44,62 @@ const assert = require('node:assert')
|
||||
--- a/services/bsky/api.js 2025-12-03 11:04:54
|
||||
+++ b/services/bsky/api.js 2025-12-03 11:00:02
|
||||
@@ -1,62 +1,105 @@
|
||||
/* eslint-env node */
|
||||
/* eslint-disable import/order */
|
||||
-
|
||||
+// https://github.com/bluesky-social/atproto/blob/main/services/bsky/api.js
|
||||
'use strict'
|
||||
|
||||
-const dd = require('dd-trace')
|
||||
+//const dd = require('dd-trace')
|
||||
+//
|
||||
+//dd.tracer
|
||||
+// .init()
|
||||
+// .use('http2', {
|
||||
+// client: true, // calls into dataplane
|
||||
+// server: false,
|
||||
+// })
|
||||
+// .use('express', {
|
||||
+// hooks: {
|
||||
+// request: (span, req) => {
|
||||
+// maintainXrpcResource(span, req)
|
||||
+// },
|
||||
+// },
|
||||
+// })
|
||||
|
||||
-dd.tracer
|
||||
- .init()
|
||||
- .use('http2', {
|
||||
- client: true, // calls into dataplane
|
||||
- server: false,
|
||||
- })
|
||||
- .use('express', {
|
||||
- hooks: {
|
||||
- request: (span, req) => {
|
||||
- maintainXrpcResource(span, req)
|
||||
- },
|
||||
- },
|
||||
- })
|
||||
-
|
||||
// modify tracer in order to track calls to dataplane as a service with proper resource names
|
||||
const DATAPLANE_PREFIX = '/bsky.Service/'
|
||||
-const origStartSpan = dd.tracer._tracer.startSpan
|
||||
-dd.tracer._tracer.startSpan = function (name, options) {
|
||||
- if (
|
||||
- name !== 'http.request' ||
|
||||
- options?.tags?.component !== 'http2' ||
|
||||
- !options?.tags?.['http.url']
|
||||
- ) {
|
||||
- return origStartSpan.call(this, name, options)
|
||||
- }
|
||||
- const uri = new URL(options.tags['http.url'])
|
||||
- if (!uri.pathname.startsWith(DATAPLANE_PREFIX)) {
|
||||
- return origStartSpan.call(this, name, options)
|
||||
- }
|
||||
- options.tags['service.name'] = 'dataplane-bsky'
|
||||
- options.tags['resource.name'] = uri.pathname.slice(DATAPLANE_PREFIX.length)
|
||||
- return origStartSpan.call(this, name, options)
|
||||
-}
|
||||
+//const origStartSpan = dd.tracer._tracer.startSpan
|
||||
+//dd.tracer._tracer.startSpan = function (name, options) {
|
||||
+// if (
|
||||
+// name !== 'http.request' ||
|
||||
+// options?.tags?.component !== 'http2' ||
|
||||
+// !options?.tags?.['http.url']
|
||||
+// ) {
|
||||
+// return origStartSpan.call(this, name, options)
|
||||
+// }
|
||||
+// const uri = new URL(options.tags['http.url'])
|
||||
+// if (!uri.pathname.startsWith(DATAPLANE_PREFIX)) {
|
||||
+// return origStartSpan.call(this, name, options)
|
||||
+// }
|
||||
+// options.tags['service.name'] = 'dataplane-bsky'
|
||||
+// options.tags['resource.name'] = uri.pathname.slice(DATAPLANE_PREFIX.length)
|
||||
+// return origStartSpan.call(this, name, options)
|
||||
+//}
|
||||
|
||||
// Tracer code above must come before anything else
|
||||
const assert = require('node:assert')
|
||||
const cluster = require('node:cluster')
|
||||
const path = require('node:path')
|
||||
|
||||
|
||||
-const { BskyAppView, ServerConfig } = require('@atproto/bsky')
|
||||
+const bsky = require('@atproto/bsky') // import all bsky features
|
||||
const { Secp256k1Keypair } = require('@atproto/crypto')
|
||||
-const { Secp256k1Keypair } = require('@atproto/crypto')
|
||||
+const bsky = require('/app/packages/bsky') // import all bsky features
|
||||
+const { Secp256k1Keypair } = require('/app/packages/crypto')
|
||||
|
||||
const main = async () => {
|
||||
const env = getEnv()
|
||||
@@ -70,7 +145,7 @@ index 56c769b9d..5d14c0057 100644
|
||||
}
|
||||
process.on('SIGTERM', shutdown)
|
||||
process.on('disconnect', shutdown) // when clustering
|
||||
@@ -64,6 +107,12 @@ const main = async () => {
|
||||
@@ -64,6 +107,12 @@
|
||||
|
||||
const getEnv = () => ({
|
||||
serviceSigningKey: process.env.BSKY_SERVICE_SIGNING_KEY || undefined,
|
||||
20
patching/4367-atproto-services-pds-index.diff
Normal file
20
patching/4367-atproto-services-pds-index.diff
Normal file
@@ -0,0 +1,20 @@
|
||||
--- a/services/pds/index.js 2025-12-03 11:04:54
|
||||
+++ b/services/pds/index.js 2025-12-02 22:11:39
|
||||
@@ -1,5 +1,5 @@
|
||||
/* eslint-env node */
|
||||
-
|
||||
+// https://github.com/bluesky-social/atproto/blob/main/services/pds/index.js
|
||||
'use strict'
|
||||
|
||||
const {
|
||||
@@ -8,8 +8,8 @@
|
||||
envToSecrets,
|
||||
httpLogger,
|
||||
readEnv,
|
||||
-} = require('@atproto/pds')
|
||||
-const pkg = require('@atproto/pds/package.json')
|
||||
+} = require('/app/packages/pds')
|
||||
+const pkg = require('/app/packages/pds/package.json')
|
||||
|
||||
const main = async () => {
|
||||
const env = readEnv()
|
||||
44
patching/8980-social-app-disable-proxy.diff
Normal file
44
patching/8980-social-app-disable-proxy.diff
Normal file
@@ -0,0 +1,44 @@
|
||||
diff --git a/src/state/session/agent.ts b/src/state/session/agent.ts
|
||||
index 36d19299b..ba095436a 100644
|
||||
--- a/src/state/session/agent.ts
|
||||
+++ b/src/state/session/agent.ts
|
||||
@@ -39,7 +39,8 @@ export function createPublicAgent() {
|
||||
configureModerationForGuest() // Side effect but only relevant for tests
|
||||
|
||||
const agent = new BskyAppAgent({service: PUBLIC_BSKY_SERVICE})
|
||||
- agent.configureProxy(BLUESKY_PROXY_HEADER.get())
|
||||
+ // Disable proxy for self-hosted environments
|
||||
+ // agent.configureProxy(BLUESKY_PROXY_HEADER.get())
|
||||
return agent
|
||||
}
|
||||
|
||||
@@ -77,7 +78,8 @@ export async function createAgentAndResume(
|
||||
}
|
||||
}
|
||||
|
||||
- agent.configureProxy(BLUESKY_PROXY_HEADER.get())
|
||||
+ // Disable proxy for self-hosted environments
|
||||
+ // agent.configureProxy(BLUESKY_PROXY_HEADER.get())
|
||||
|
||||
return agent.prepare(gates, moderation, onSessionChange)
|
||||
}
|
||||
@@ -112,7 +114,8 @@ export async function createAgentAndLogin(
|
||||
const gates = tryFetchGates(account.did, 'prefer-fresh-gates')
|
||||
const moderation = configureModerationForAccount(agent, account)
|
||||
|
||||
- agent.configureProxy(BLUESKY_PROXY_HEADER.get())
|
||||
+ // Disable proxy for self-hosted environments
|
||||
+ // agent.configureProxy(BLUESKY_PROXY_HEADER.get())
|
||||
|
||||
return agent.prepare(gates, moderation, onSessionChange)
|
||||
}
|
||||
@@ -201,7 +204,8 @@ export async function createAgentAndCreateAccount(
|
||||
logger.error(e, {message: `session: failed snoozeEmailConfirmationPrompt`})
|
||||
}
|
||||
|
||||
- agent.configureProxy(BLUESKY_PROXY_HEADER.get())
|
||||
+ // Disable proxy for self-hosted environments
|
||||
+ // agent.configureProxy(BLUESKY_PROXY_HEADER.get())
|
||||
|
||||
return agent.prepare(gates, moderation, onSessionChange)
|
||||
}
|
||||
@@ -1,10 +0,0 @@
|
||||
--- a/Dockerfile
|
||||
+++ b/Dockerfile
|
||||
@@ -37,6 +37,7 @@ RUN \. "$NVM_DIR/nvm.sh" && \
|
||||
echo "EXPO_PUBLIC_BUNDLE_IDENTIFIER=$EXPO_PUBLIC_BUNDLE_IDENTIFIER" >> .env && \
|
||||
echo "EXPO_PUBLIC_BUNDLE_DATE=$(date -u +"%y%m%d%H")" >> .env && \
|
||||
npm install --global yarn && \
|
||||
+ yarn config set network-timeout 600000 && \
|
||||
yarn && \
|
||||
yarn intl:build && \
|
||||
EXPO_PUBLIC_BUNDLE_IDENTIFIER=$EXPO_PUBLIC_BUNDLE_IDENTIFIER EXPO_PUBLIC_BUNDLE_DATE=$() yarn build-web
|
||||
Reference in New Issue
Block a user