security.txt
Signed-off-by: Martin Berg Alstad <git@martials.no>
This commit is contained in:
parent
c701a510f7
commit
1a2fec6a59
5
.env
5
.env
@ -1,2 +1,3 @@
|
|||||||
GIT_URL="https://git.martials.no"
|
DOMAIN="martials.no"
|
||||||
STATUS_URL="https://status.martials.no/status/home"
|
GIT_URL=https://git.$DOMAIN
|
||||||
|
STATUS_URL="https://status.$DOMAIN/status/home"
|
4
public/.well-known/security.txt
Normal file
4
public/.well-known/security.txt
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
Contact: mailto:security@martials.no
|
||||||
|
Expires: 2029-12-31T23:00:00.000Z
|
||||||
|
Preferred-Languages: no,en
|
||||||
|
Canonical: https://martials.no/.well-known/security.txt
|
1
src/env.d.ts
vendored
1
src/env.d.ts
vendored
@ -2,6 +2,7 @@
|
|||||||
/// <reference types="astro/client" />
|
/// <reference types="astro/client" />
|
||||||
|
|
||||||
interface ImportMetaEnv {
|
interface ImportMetaEnv {
|
||||||
|
readonly DOMAIN: string
|
||||||
readonly URL: string
|
readonly URL: string
|
||||||
readonly GIT_URL: string
|
readonly GIT_URL: string
|
||||||
readonly STATUS_URL: string
|
readonly STATUS_URL: string
|
||||||
|
15
src/pages/.well-known/security.txt.ts
Normal file
15
src/pages/.well-known/security.txt.ts
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
import type { APIRoute } from "astro"
|
||||||
|
|
||||||
|
function getSecurityTxt(site?: URL) {
|
||||||
|
const canonical = new URL("/.well-known/security.txt", site)
|
||||||
|
return `
|
||||||
|
Contact: mailto:security@martials.no
|
||||||
|
Expires: 2029-12-31T23:00:00.000Z
|
||||||
|
Preferred-Languages: no,en
|
||||||
|
Canonical: ${canonical.href}
|
||||||
|
`
|
||||||
|
}
|
||||||
|
|
||||||
|
export const GET: APIRoute = ({ site }) => {
|
||||||
|
return new Response(getSecurityTxt(site))
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user