website: fix go-get function (always fallback to authentik repo except hardcoded values) (#5767)
Signed-off-by: Jens Langhammer <jens@goauthentik.io>
This commit is contained in:
parent
a8067c1f0d
commit
60e911baf8
|
@ -2,18 +2,18 @@ const gitHubNamespace = "goauthentik";
|
||||||
|
|
||||||
exports.handler = async function (event, context) {
|
exports.handler = async function (event, context) {
|
||||||
let repo = "";
|
let repo = "";
|
||||||
if (event.path === "/") {
|
if (event.path.startsWith("/api")) {
|
||||||
repo = "/authentik";
|
repo = "client-go";
|
||||||
} else if (event.path.startsWith("/api")) {
|
} else if (event.path.startsWith("/terraform-provider-authentik")) {
|
||||||
repo = "/client-go";
|
repo = "terraform-provider-authentik";
|
||||||
} else {
|
} else {
|
||||||
repo = event.path;
|
repo = "authentik";
|
||||||
}
|
}
|
||||||
return {
|
return {
|
||||||
statusCode: 200,
|
statusCode: 200,
|
||||||
headers: {
|
headers: {
|
||||||
"content-type": "text/html",
|
"content-type": "text/html",
|
||||||
},
|
},
|
||||||
body: `<meta name="go-import" content="${event.headers.host}${event.path} git https://github.com/${gitHubNamespace}${repo}">`,
|
body: `<meta name="go-import" content="${event.headers.host}${event.path} git https://github.com/${gitHubNamespace}/${repo}">`,
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
Reference in New Issue