1
mirror of https://github.com/jakejarvis/jarv.is.git synced 2025-07-03 13:46:38 -04:00

re-add external API rewrites

This commit is contained in:
2021-06-04 19:00:29 -04:00
parent bce45a1af5
commit 4598ee538c
4 changed files with 31 additions and 11 deletions

View File

@ -8,5 +8,4 @@
{{ partialCached "head/feeds" . -}}
{{ partial "head/canonical" . -}}
{{ partialCached "head/webmention" . -}}
{{ partialCached "head/indieauth" . -}}
{{ partial "head/schema" . -}}

View File

@ -1,2 +0,0 @@
<link rel="authorization_endpoint" href="https://indieauth.com/auth">
<link rel="token_endpoint" href="https://tokens.indieauth.com/token">

View File

@ -1,4 +1,4 @@
{{ with .Site.Params.social.webmentionIO }}
<link rel="webmention" href="https://webmention.io/{{ . }}/webmention">
<link rel="pingback" href="https://webmention.io/{{ . }}/xmlrpc">
{{ if .Site.Params.social.webmentionIO }}
<link rel="webmention" href="{{ "api/mention/" | absURL }}">
<link rel="pingback" href="{{ "api/ping/" | absURL }}">
{{ end }}

View File

@ -1,12 +1,35 @@
{
"name": "jarvis",
"alias": [ "jarv.is", "www.jarv.is" ],
"public": false,
"trailingSlash": true,
"cleanUrls": false,
"functions": {
"api/**/*.js": {
"runtime": "@vercel/node@1.11.0"
}
},
"rewrites": [
{ "source": "/favicon.ico", "destination": "/img/favicon.ico" },
{ "source": "/favicon-(.*).png", "destination": "/img/favicon-$1.png" },
{ "source": "/apple-touch-icon.png", "destination": "/img/apple-touch-icon.png" },
{ "source": "/apple-touch-icon-precomposed.png", "destination": "/img/apple-touch-icon.png" },
{ "source": "/safari-pinned-tab.svg", "destination": "/img/safari-pinned-tab.svg" }
{
"source": "/api/csp_wizard/",
"destination": "https://jarvis.report-uri.com/r/d/csp/enforce"
},
{
"source": "/api/report/",
"destination": "https://jarvis.report-uri.com/a/d/g"
},
{
"source": "/api/mention/",
"destination": "https://webmention.io/jarv.is/webmention"
},
{
"source": "/api/ping/",
"destination": "https://webmention.io/jarv.is/xmlrpc"
}
],
"redirects": [
{ "source": "/notes/:slug/amp.html", "destination": "/notes/:slug/", "statusCode": 301 },
@ -25,8 +48,8 @@
{ "source": "/img/me_hu1c1a997e30e234e83718deb8b3f52283_130509_320x320_resize_q90_lanczos.jpg", "destination": "/img/me.jpg" },
{ "source": "/y2k/(.*)", "destination": "https://jakejarvis.github.io/my-first-website/$1" },
{ "source": "/ios-trackers/(.*)", "destination": "https://jakejarvis.github.io/ios-trackers/$1" },
{ "source": "/awesome/", "destination": "https://synonymsforawesome.com/" },
{ "source": "/hugo-node/", "destination": "https://github.com/jakejarvis/hugo-extended" },
{ "source": "/awesome/(.*)", "destination": "https://synonymsforawesome.com/" },
{ "source": "/hugo-node/(.*)", "destination": "https://github.com/jakejarvis/hugo-extended" },
{ "source": "/comp20/(.*)", "destination": "https://jakejarvis.github.io/comp20/$1" },
{ "source": "/scrabble/(.*)", "destination": "https://jakejarvis.github.io/scrabble/$1" }
],
@ -62,11 +85,11 @@
},
{
"key": "Content-Security-Policy",
"value": "default-src 'self'; base-uri 'none'; connect-src 'self' api.github.com platform.twitter.com; font-src 'self'; form-action 'none'; frame-ancestors 'self'; frame-src 'self' jakejarvis.github.io buttons.github.io codepen.io cdpn.io platform.twitter.com www.youtube-nocookie.com; img-src 'self' data: https:; manifest-src 'self'; media-src 'self' data: https:; object-src 'none'; script-src 'self' buttons.github.io gist.github.com syndication.twitter.com platform.twitter.com 'sha256-1j1MKfE70TTCp5KmiC2YImxw2RMS52uCH5yXl1heG9U=' 'sha256-y3Xr/40/KQnUvqk/kZO5us6t3i/I49BsbYjsH8ELhVg=' 'sha256-JGG0npUp+0ABq/NY1azjpQ0WBtm+m5gU58mzF+2DCXY='; style-src 'self' 'unsafe-inline' github.githubassets.com; worker-src 'self'; block-all-mixed-content; report-uri https://jarvis.report-uri.com/r/d/csp/enforce; report-to default"
"value": "default-src 'self'; base-uri 'none'; connect-src 'self' api.github.com platform.twitter.com; font-src 'self'; form-action 'none'; frame-ancestors 'self'; frame-src 'self' jakejarvis.github.io buttons.github.io codepen.io platform.twitter.com www.youtube-nocookie.com; img-src 'self' data: https:; manifest-src 'self'; media-src 'self' data: https:; object-src 'none'; script-src 'self' buttons.github.io gist.github.com syndication.twitter.com platform.twitter.com 'sha256-1j1MKfE70TTCp5KmiC2YImxw2RMS52uCH5yXl1heG9U=' 'sha256-y3Xr/40/KQnUvqk/kZO5us6t3i/I49BsbYjsH8ELhVg=' 'sha256-JGG0npUp+0ABq/NY1azjpQ0WBtm+m5gU58mzF+2DCXY='; style-src 'self' 'unsafe-inline' github.githubassets.com; worker-src 'self'; block-all-mixed-content; report-uri https://jarv.is/api/csp_wizard/; report-to default"
},
{
"key": "Report-To",
"value": "{\"group\":\"default\",\"max_age\":604800,\"endpoints\":[{\"url\":\"https://jarvis.report-uri.com/a/d/g\"}],\"include_subdomains\":false}"
"value": "{\"group\":\"default\",\"max_age\":604800,\"endpoints\":[{\"url\":\"https://jarv.is/api/report/\"}],\"include_subdomains\":false}"
},
{
"key": "NEL",