mirror of
https://github.com/turbomaster95/coderrrrr.git
synced 2025-08-01 02:02:24 +00:00
Compare commits
7 Commits
9803161404
...
1b51bafee1
Author | SHA1 | Date | |
---|---|---|---|
1b51bafee1 | |||
0a8601279e | |||
40883ac425 | |||
c371e69d19 | |||
a3709f0cb1 | |||
899dcb9efe | |||
2f877fe36b |
@ -11,13 +11,13 @@ export default async function (req: VercelRequest, res: VercelResponse) {
|
||||
res.status(200).setHeader("Content-Type", "application/activity+json").json({
|
||||
"@context": ["https://www.w3.org/ns/activitystreams", { "@language": "en-US" }],
|
||||
"type": "Person",
|
||||
"id": "https://coderrrrr.site/coder",
|
||||
"id": "https://coderrrrr.site/blog",
|
||||
"outbox": "https://coderrrrr.site/api/activitypub/outbox",
|
||||
"following": "https://coderrrrr.site/api/activitypub/following",
|
||||
"followers": "https://coderrrrr.site/api/activitypub/followers",
|
||||
"sharedInbox": "https://coderrrrr.site/api/activitypub/sharedInbox",
|
||||
"inbox": "https://coderrrrr.site/api/activitypub/inbox",
|
||||
"preferredUsername": "coder",
|
||||
"preferredUsername": "blog",
|
||||
"name": "Deva Midhun's blog",
|
||||
"discoverable": true,
|
||||
"indexable": true,
|
||||
@ -50,8 +50,8 @@ export default async function (req: VercelRequest, res: VercelResponse) {
|
||||
"publicKey": {
|
||||
"@context": "https://w3id.org/security/v1",
|
||||
"@type": "Key",
|
||||
"id": "https://coderrrrr.site/coder#main-key",
|
||||
"owner": "https://coderrrrr.site/coder",
|
||||
"id": "https://coderrrrr.site/blog#main-key",
|
||||
"owner": "https://coderrrrr.site/blog",
|
||||
"publicKeyPem": process.env.ACTIVITYPUB_PUBLIC_KEY || "MISSING_PUBLIC_KEY"
|
||||
}
|
||||
});
|
||||
|
7
api/activitypub/old.ts
Normal file
7
api/activitypub/old.ts
Normal file
@ -0,0 +1,7 @@
|
||||
import type { VercelRequest, VercelResponse } from "@vercel/node";
|
||||
|
||||
export default function (req: VercelRequest, res: VercelResponse) {
|
||||
res.status(410).json({
|
||||
error: "This account no longer exists."
|
||||
});
|
||||
};
|
@ -5,21 +5,21 @@ export default function (req: VercelRequest, res: VercelResponse) {
|
||||
res.statusCode = 200;
|
||||
res.setHeader("Content-Type", `application/jrd+json`);
|
||||
res.end(`{
|
||||
"subject": "acct:coder@coderrrrr.site",
|
||||
"subject": "acct:blog@coderrrrr.site",
|
||||
"aliases": [
|
||||
"https://coderrrrr.site/coder",
|
||||
"https://coderrrrr.site/@coder"
|
||||
"https://coderrrrr.site/blog",
|
||||
"https://coderrrrr.site/@blog"
|
||||
],
|
||||
"links": [
|
||||
{
|
||||
"rel": "http://webfinger.net/rel/profile-page",
|
||||
"type": "text/html",
|
||||
"href": "https://coderrrrr.site/coder"
|
||||
"href": "https://coderrrrr.site/blog"
|
||||
},
|
||||
{
|
||||
"rel": "self",
|
||||
"type": "application/activity+json",
|
||||
"href": "https://coderrrrr.site/coder"
|
||||
"href": "https://coderrrrr.site/blog"
|
||||
},
|
||||
{
|
||||
"rel": "http://ostatus.org/schema/1.0/subscribe",
|
||||
|
@ -1,4 +1,4 @@
|
||||
function verifySignature(signature:any, publicKeyJson:any) {
|
||||
function verifySignature(signature, publicKeyJson) {
|
||||
let signatureValid;
|
||||
|
||||
try {
|
||||
@ -12,3 +12,5 @@ function verifySignature(signature:any, publicKeyJson:any) {
|
||||
|
||||
return signatureValid;
|
||||
}
|
||||
|
||||
module.exports = { verifySignature };
|
||||
|
10
vercel.json
10
vercel.json
@ -1,12 +1,12 @@
|
||||
{
|
||||
"functions": {
|
||||
"api/**/*": {
|
||||
"maxDuration": 240
|
||||
"maxDuration": 60
|
||||
}
|
||||
},
|
||||
"crons": [{
|
||||
"path": "/api/activitypub/sendNote.ts",
|
||||
"schedule": "0 * * * *"
|
||||
"schedule": "0 0 * * *"
|
||||
}],
|
||||
"redirects": [
|
||||
{
|
||||
@ -32,9 +32,13 @@
|
||||
"destination": "/api/activitypub/authorize_interaction.ts"
|
||||
},
|
||||
{
|
||||
"source": "/coder",
|
||||
"source": "/blog",
|
||||
"destination": "/api/activitypub/actor.ts"
|
||||
},
|
||||
{
|
||||
"source": "/coder",
|
||||
"destination": "/api/activitypub/old.ts"
|
||||
},
|
||||
{
|
||||
"source": "/followers",
|
||||
"destination": "/api/activitypub/followers.ts"
|
||||
|
Loading…
x
Reference in New Issue
Block a user