-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: mastodon webfinger for vercel next.js
- Loading branch information
Showing
13 changed files
with
236 additions
and
46 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -47,3 +47,6 @@ resources/_gen/ | |
package-lock.json | ||
|
||
.hintrc | ||
static/.next | ||
static/node_modules | ||
.next |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"compilerOptions": { | ||
"paths": { | ||
"@/*": ["./*"] | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
/** @type {import('next').NextConfig} */ | ||
const nextConfig = {} | ||
|
||
module.exports = { | ||
|
||
exportPathMap: async function (defaultPathMap) { | ||
return { | ||
'/': { page: '/' } | ||
} | ||
}, | ||
async rewrites() { | ||
return [ | ||
{ | ||
source: '/.well-known/webfinger', | ||
destination: '/api/.well-known/webfinger' | ||
}, | ||
{ | ||
source: '/.well-known/nodeinfo', | ||
destination: '/api/.well-known/nodeinfo' | ||
}, | ||
{ | ||
source: '/.well-known/host-meta', | ||
destination: '/api/.well-known/host-meta' | ||
} | ||
]; | ||
}, | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,36 +1,43 @@ | ||
{ | ||
"name": "eallion.com", | ||
"version": "v2.0.2", | ||
"description": "eallion.com hugo blog", | ||
"private": true, | ||
"scripts": { | ||
"build": "hugo --cleanDestinationDir --forceSyncStatic --gc --ignoreCache --minify --enableGitInfo", | ||
"server": "start http://192.168.0.5:1313 && hugo server -w -D -p 1313 --bind 0.0.0.0 --contentDir example --forceSyncStatic --ignoreCache --noHTTPCache --disableFastRender -e production --enableGitInfo", | ||
"new": "node scripts/post_title_prompt.js && bash scripts/format_filename.sh", | ||
"preview": "start http://192.168.0.5:1313 && hugo server -w -D -p 1313 --bind 0.0.0.0 --contentDir content --forceSyncStatic --ignoreCache --noHTTPCache --disableFastRender -e production --enableGitInfo", | ||
"update": "git submodule update --remote --merge", | ||
"start": "start http://192.168.0.5:1313 && hugo server -w -D -p 1313 --bind 0.0.0.0 --contentDir example --forceSyncStatic --ignoreCache --noHTTPCache --disableFastRender -e production --enableGitInfo", | ||
"vercel": "node scripts/hugo_version.js && hugo --cleanDestinationDir --forceSyncStatic --gc --ignoreCache --minify --enableGitInfo" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/eallion/eallion.com" | ||
}, | ||
"keywords": [ | ||
"hugo", | ||
"theme", | ||
"blog", | ||
"eallion" | ||
], | ||
"author": "Charles Chin", | ||
"license": "GLWTPL", | ||
"bugs": { | ||
"url": "https://github.com/eallion/eallion.com/issues" | ||
}, | ||
"homepage": "https://github.com/eallion/eallion.com#readme", | ||
"dependencies": { | ||
"axios": "^1.4.0", | ||
"fs": "^0.0.1-security", | ||
"generate-changelog": "^1.8.0" | ||
} | ||
"name": "eallion.com", | ||
"version": "v2.0.2", | ||
"description": "eallion.com hugo blog", | ||
"private": true, | ||
"scripts": { | ||
"hugo": "hugo --cleanDestinationDir --forceSyncStatic --gc --ignoreCache --minify --enableGitInfo", | ||
"server": "start http://192.168.0.5:1313 && hugo server -w -D -p 1313 --bind 0.0.0.0 --contentDir example --forceSyncStatic --ignoreCache --noHTTPCache --disableFastRender -e production --enableGitInfo", | ||
"new": "node scripts/post_title_prompt.js && bash scripts/format_filename.sh", | ||
"preview": "start http://192.168.0.5:1313 && hugo server -w -D -p 1313 --bind 0.0.0.0 --contentDir content --forceSyncStatic --ignoreCache --noHTTPCache --disableFastRender -e production --enableGitInfo", | ||
"update": "git submodule update --remote --merge", | ||
"start": "next start", | ||
"dev": "next dev", | ||
"lint": "next lint", | ||
"build": "next build", | ||
"vercel": "node scripts/hugo_version.js && hugo --cleanDestinationDir --forceSyncStatic --gc --ignoreCache --minify --enableGitInfo && next build" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/eallion/eallion.com" | ||
}, | ||
"keywords": [ | ||
"hugo", | ||
"theme", | ||
"blog", | ||
"eallion" | ||
], | ||
"author": "Charles Chin", | ||
"license": "GLWTPL", | ||
"bugs": { | ||
"url": "https://github.com/eallion/eallion.com/issues" | ||
}, | ||
"homepage": "https://github.com/eallion/eallion.com#readme", | ||
"dependencies": { | ||
"axios": "^1.4.0", | ||
"fs": "^0.0.1-security", | ||
"generate-changelog": "^1.8.0", | ||
"next": "13.4.12", | ||
"next.js": "^1.0.3", | ||
"react": "18.2.0", | ||
"react-dom": "18.2.0" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
// api/host-meta.js | ||
|
||
export default (req, res) => { | ||
|
||
const hostMeta = ` | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<XRD xmlns="http://docs.oasis-open.org/ns/xri/xrd-1.0"> | ||
<Link rel="lrdd" type="application/xrd+xml" template="https://example.com/api/webfinger?resource={uri}"/> | ||
</XRD> | ||
`; | ||
|
||
res.setHeader('Content-Type', 'application/xrd+xml'); | ||
res.status(200).send(hostMeta); | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
export default function handler(req, res) { | ||
res.send(`{ | ||
"links": [ | ||
{ | ||
"rel": "http://nodeinfo.diaspora.software/ns/schema/2.0", | ||
"href": "https://m.eallion.com/nodeinfo/2.0" | ||
} | ||
] | ||
}`); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
export default function handler(req, res) { | ||
res.send(`{ | ||
"subject": "acct:[email protected]", | ||
"aliases": [ | ||
"https://m.eallion.com/users/eallion", | ||
"https://m.eallion.com/@eallion" | ||
], | ||
"links": [ | ||
{ | ||
"rel": "http://webfinger.net/rel/profile-page", | ||
"type": "text/html", | ||
"href": "https://m.eallion.com/@eallion" | ||
}, | ||
{ | ||
"rel": "self", | ||
"type": "application/activity+json", | ||
"href": "https://m.eallion.com/users/eallion" | ||
} | ||
] | ||
}`); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<XRD xmlns="http://docs.oasis-open.org/ns/xri/xrd-1.0"><Link rel="lrdd" type="application/xrd+xml" template="https://m.eallion.com/.well-known/webfinger?resource={uri}"></Link></XRD> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"links": [ | ||
{ | ||
"rel": "http://nodeinfo.diaspora.software/ns/schema/2.0", | ||
"href": "https://m.eallion.com/nodeinfo/2.0" | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
{ | ||
"subject": "acct:[email protected]", | ||
"aliases": [ | ||
"https://m.eallion.com/users/eallion", | ||
"https://m.eallion.com/@eallion" | ||
], | ||
"links": [ | ||
{ | ||
"rel": "http://webfinger.net/rel/profile-page", | ||
"type": "text/html", | ||
"href": "https://m.eallion.com/@eallion" | ||
}, | ||
{ | ||
"rel": "self", | ||
"type": "application/activity+json", | ||
"href": "https://m.eallion.com/users/eallion" | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,70 @@ | ||
{ | ||
"github": { | ||
"silent": false | ||
"github": { | ||
"silent": true | ||
}, | ||
"build": { | ||
"env": { | ||
"HUGO_VERSION": "0.116.1" | ||
} | ||
}, | ||
"git": { | ||
"deploymentEnabled": { | ||
"main": false | ||
} | ||
}, | ||
"headers": [ | ||
{ | ||
"source": "/.well-known/webfinger", | ||
"headers": [ | ||
{ | ||
"key": "Access-Control-Allow-Origin", | ||
"value": "*" | ||
}, | ||
{ | ||
"key": "Content-Type", | ||
"value": "application/jrd+json" | ||
} | ||
] | ||
}, | ||
"build": { | ||
"env": { | ||
"HUGO_VERSION": "0.116.1" | ||
{ | ||
"source": "/.well-known/nodeinfo", | ||
"headers": [ | ||
{ | ||
"key": "Access-Control-Allow-Origin", | ||
"value": "*" | ||
}, | ||
{ | ||
"key": "Content-Type", | ||
"value": "application/jrd+json" | ||
} | ||
] | ||
}, | ||
"git": { | ||
"deploymentEnabled": { | ||
"main": false | ||
{ | ||
"source": "/.well-known/host-meta", | ||
"headers": [ | ||
{ | ||
"key": "Access-Control-Allow-Origin", | ||
"value": "*" | ||
}, | ||
{ | ||
"key": "Content-Type", | ||
"value": "application/xrd+xml" | ||
} | ||
] | ||
} | ||
], | ||
"rewrites": [ | ||
{ | ||
"source": "/.well-known/webfinger", | ||
"destination": "/api/.well-known/webfinger" | ||
}, | ||
{ | ||
"source": "/.well-known/nodeinfo", | ||
"destination": "/api/.well-known/nodeinfo" | ||
}, | ||
{ | ||
"source": "/.well-known/host-meta", | ||
"destination": "/api/.well-known/host-meta" | ||
} | ||
] | ||
} |