From f0754f622a242fe134efc505697b983102f5455c Mon Sep 17 00:00:00 2001 From: dholms Date: Mon, 5 Feb 2024 17:25:55 -0600 Subject: [PATCH 1/3] createAccoutn error based on user agent --- packages/pds/src/api/com/atproto/server/createAccount.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/packages/pds/src/api/com/atproto/server/createAccount.ts b/packages/pds/src/api/com/atproto/server/createAccount.ts index fb4ff78708b..7a68061b2b9 100644 --- a/packages/pds/src/api/com/atproto/server/createAccount.ts +++ b/packages/pds/src/api/com/atproto/server/createAccount.ts @@ -30,6 +30,11 @@ export default function (server: Server, ctx: AppContext) { }, handler: async ({ input, req }) => { const hasAvailability = await ctx.signupLimiter.hasAvailability() + if (!hasAvailability && req.header('user-agent')?.startsWith('okhttp/')) { + throw new InvalidRequestError( + `We've had a burst of activity and are temporarily limiting signups. Please check back soon!`, + ) + } const { did, From 0c3a94cd5d0661068eef5a78e631e2140f7d51c4 Mon Sep 17 00:00:00 2001 From: dholms Date: Mon, 5 Feb 2024 17:31:13 -0600 Subject: [PATCH 2/3] comment --- packages/pds/src/api/com/atproto/server/createAccount.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/pds/src/api/com/atproto/server/createAccount.ts b/packages/pds/src/api/com/atproto/server/createAccount.ts index 7a68061b2b9..54d4ec5a564 100644 --- a/packages/pds/src/api/com/atproto/server/createAccount.ts +++ b/packages/pds/src/api/com/atproto/server/createAccount.ts @@ -30,6 +30,7 @@ export default function (server: Server, ctx: AppContext) { }, handler: async ({ input, req }) => { const hasAvailability = await ctx.signupLimiter.hasAvailability() + // temporary hack: don't queue android users (user-agent `okhttp/*`) since the latest version of app isn't rolled out on that platform yet if (!hasAvailability && req.header('user-agent')?.startsWith('okhttp/')) { throw new InvalidRequestError( `We've had a burst of activity and are temporarily limiting signups. Please check back soon!`, From 2c9088ee1cdf8e0d904165f48d5e26814eaf007f Mon Sep 17 00:00:00 2001 From: dholms Date: Mon, 5 Feb 2024 18:21:17 -0600 Subject: [PATCH 3/3] format --- .../mailer/templates/account-activated.hbs | 424 +++++++++++++++--- 1 file changed, 374 insertions(+), 50 deletions(-) diff --git a/packages/pds/src/mailer/templates/account-activated.hbs b/packages/pds/src/mailer/templates/account-activated.hbs index 58d459ae7b5..d29327fec43 100644 --- a/packages/pds/src/mailer/templates/account-activated.hbs +++ b/packages/pds/src/mailer/templates/account-activated.hbs @@ -1,139 +1,450 @@ - - - - - - + + + + + - -