move to per-script PDS modding, trust aglais as much as bsky.app
This commit is contained in:
parent
9f5531ca7d
commit
7694adce3f
5 changed files with 32 additions and 0 deletions
3
pds/allow-slurs.js
Normal file
3
pds/allow-slurs.js
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
// i like saying "#tranny" -- sue me
|
||||||
|
const slurs = require("@atproto/pds/dist/handle/explicit-slurs.js")
|
||||||
|
slurs.hasExplicitSlur = () => false;
|
|
@ -9,6 +9,9 @@ const pkg = require("@atproto/pds/package.json");
|
||||||
const slurs = require("@atproto/pds/dist/handle/explicit-slurs.js")
|
const slurs = require("@atproto/pds/dist/handle/explicit-slurs.js")
|
||||||
slurs.hasExplicitSlur = () => false;
|
slurs.hasExplicitSlur = () => false;
|
||||||
|
|
||||||
|
require("./allow-slurs.js");
|
||||||
|
require("./trust-aglais.js");
|
||||||
|
|
||||||
const process = require("node:process")
|
const process = require("node:process")
|
||||||
|
|
||||||
const main = async () => {
|
const main = async () => {
|
||||||
|
|
|
@ -13,5 +13,8 @@
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@types/express": "^5.0.0"
|
"@types/express": "^5.0.0"
|
||||||
|
},
|
||||||
|
"peerDependencies": {
|
||||||
|
"@atproto/oauth-provider": "^0.2.10"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,6 +11,9 @@ importers:
|
||||||
'@atproto/common':
|
'@atproto/common':
|
||||||
specifier: ^0.4.5
|
specifier: ^0.4.5
|
||||||
version: 0.4.5
|
version: 0.4.5
|
||||||
|
'@atproto/oauth-provider':
|
||||||
|
specifier: ^0.2.10
|
||||||
|
version: 0.2.10
|
||||||
'@atproto/pds':
|
'@atproto/pds':
|
||||||
specifier: 0.4.77
|
specifier: 0.4.77
|
||||||
version: 0.4.77
|
version: 0.4.77
|
||||||
|
|
20
pds/trust-aglais.js
Normal file
20
pds/trust-aglais.js
Normal file
|
@ -0,0 +1,20 @@
|
||||||
|
const provider = require("@atproto/pds/dist/oauth/provider.js");
|
||||||
|
const { OAuthProvider } = require("@atproto/oauth-provider");
|
||||||
|
|
||||||
|
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;
|
Loading…
Reference in a new issue