Compare commits

..

No commits in common. "cf27f3a9dd5cd8f22d6a0a5ca63096197f449517" and "7694adce3fe43b0f88bd7e3e70f03a8ccb915ab6" have entirely different histories.

4 changed files with 18 additions and 21 deletions

View file

@ -12,9 +12,6 @@ export const config = ngx("", [
...ngx.listen(),
...ngx.letsEncrypt("pds.bun.how"),
],
ngx("if ($http_user_agent ~ (freundica\.de))", [
"return 444"
]),
ngx("location /", [
"client_max_body_size 1G",
"proxy_pass http://127.0.0.7:2583",

View file

@ -8,7 +8,6 @@
"dependencies": {
"@atproto/common": "^0.4.5",
"@atproto/pds": "0.4.77",
"@marshift/strawberry": "^1.5.1",
"dotenv": "^16.4.5",
"express": "^4.21.1"
},

View file

@ -17,9 +17,6 @@ importers:
'@atproto/pds':
specifier: 0.4.77
version: 0.4.77
'@marshift/strawberry':
specifier: ^1.5.1
version: 1.5.1
dotenv:
specifier: ^16.4.5
version: 16.4.7
@ -453,9 +450,6 @@ packages:
resolution: {integrity: sha512-O8jcjabXaleOG9DQ0+ARXWZBTfnP4WNAqzuiJK7ll44AmxGKv/J2M4TPjxjY3znBCfvBXFzucm1twdyFybFqEA==}
engines: {node: '>=12'}
'@marshift/strawberry@1.5.1':
resolution: {integrity: sha512-OtZo6kKA06ceaf9j41r+6UxKAhqHzUnw8jYokLbVHqkQeW88SCxyOlZKOW7uoefnjWQXZcclg5v9xd+NtVe9oA==}
'@noble/curves@1.7.0':
resolution: {integrity: sha512-UTMhXK9SeDhFJVrHeUJ5uZlI6ajXg10O6Ddocf9S6GjbSBVZsJo88HzKwXznNfGpMTRDyJkqMjNDPYgf0qFWnw==}
engines: {node: ^14.21.3 || >=16}
@ -2707,8 +2701,6 @@ snapshots:
wrap-ansi: 8.1.0
wrap-ansi-cjs: wrap-ansi@7.0.0
'@marshift/strawberry@1.5.1': {}
'@noble/curves@1.7.0':
dependencies:
'@noble/hashes': 1.6.0

View file

@ -1,11 +1,20 @@
const provider = require("@atproto/pds/dist/oauth/provider.js");
const { after } = require("@marshift/strawberry");
const { OAuthProvider } = require("@atproto/oauth-provider");
after(provider, "PdsOAuthProvider", (_args, provider) => {
after(provider.clientManager.hooks, "onClientInfo", ([clientId], info) => {
if (clientId === "https://aglais.pages.dev/oauth/client-metadata.json") {
info.isFirstParty = true;
info.isTrusted = true;
}
});
});
const origProvider = provider.PdsOAuthProvider;
class OAuthProviderDetour extends origProvider {
constructor(opts) {
super(opts);
const oClientInfo = this.clientManager.hooks.onClientInfo;
this.clientManager.hooks.onClientInfo = (clientId) => {
const info = oClientInfo(clientId);
if (clientId === "https://aglais.pages.dev/oauth/client-metadata.json") {
info.isFirstParty = true;
info.isTrusted = true;
}
return info;
};
}
}
provider.PdsOAuthProvider = OAuthProviderDetour;