Compare commits
10 Commits
8184fece1b
...
7c6effc66e
Author | SHA1 | Date | |
---|---|---|---|
7c6effc66e | |||
f5443aaf2b | |||
6fa1904a50 | |||
2848465630 | |||
547ab3dc85 | |||
5cd8a98101 | |||
1036526e1c | |||
b543376207 | |||
de9f968d78 | |||
0dabe6e399 |
@ -37,6 +37,7 @@ next-env.d.ts
|
||||
|
||||
# Kubernetes
|
||||
/manifest/
|
||||
Earthfile
|
||||
|
||||
# Content collections
|
||||
.content-collections
|
@ -27,9 +27,8 @@ run:
|
||||
COPY +build/app/.next/standalone /app
|
||||
COPY +build/app/.next/static /app/.next/static
|
||||
COPY +build/app/public /app/public
|
||||
RUN mkdir -p /app/.next/cache
|
||||
|
||||
EXPOSE 3000
|
||||
CMD [ "node", "server.js" ]
|
||||
|
||||
SAVE IMAGE --push ghcr.io/xe/techaro-lol
|
||||
SAVE IMAGE --push registry.default.svc.alrest.xeserv.us/techaro/www
|
14
app/healthz/route.ts
Normal file
14
app/healthz/route.ts
Normal file
@ -0,0 +1,14 @@
|
||||
import { NextRequest, NextResponse } from "next/server";
|
||||
|
||||
export const GET = async (req: NextRequest) => {
|
||||
if (req.headers.get("user-agent") !== "healthz") {
|
||||
return NextResponse.json({ error: "Not found" }, { status: 404 });
|
||||
}
|
||||
|
||||
return new Response("OK", {
|
||||
status: 200,
|
||||
headers: {
|
||||
"Content-Type": "text/plain",
|
||||
},
|
||||
});
|
||||
};
|
@ -13,7 +13,7 @@ spec:
|
||||
service: techaro-lol
|
||||
port: 80
|
||||
replicas:
|
||||
min: 1
|
||||
min: 0
|
||||
max: 10
|
||||
scaledownPeriod: 300
|
||||
scalingMetric:
|
||||
|
@ -16,7 +16,7 @@ spec:
|
||||
claimName: techaro-lol-temp
|
||||
containers:
|
||||
- name: main
|
||||
image: ghcr.io/xe/techaro-lol:latest
|
||||
image: reg.xeiaso.net/techaro/www:latest
|
||||
imagePullPolicy: "Always"
|
||||
resources:
|
||||
limits:
|
||||
@ -44,12 +44,10 @@ spec:
|
||||
type: RuntimeDefault
|
||||
livenessProbe:
|
||||
httpGet:
|
||||
path: /_healthz
|
||||
path: /healthz
|
||||
port: 3000
|
||||
httpHeaders:
|
||||
- name: x-real-ip
|
||||
value: "100.100.100.100"
|
||||
- name: user-agent
|
||||
value: "Kubernetes healthchecks"
|
||||
value: "healthz"
|
||||
initialDelaySeconds: 3
|
||||
periodSeconds: 3
|
@ -4,7 +4,7 @@ import { NextRequest, NextResponse } from "next/server";
|
||||
export const config = {
|
||||
// matcher tells Next.js which routes to run the middleware on.
|
||||
// This runs the middleware on all routes except for static assets.
|
||||
matcher: ["/((?!_next/static|_next/image|favicon.ico|_healthz).*)"],
|
||||
matcher: ["/((?!_next/static|_next/image|favicon.ico|healthz|.well-known/.*).*)"],
|
||||
};
|
||||
|
||||
const aj = arcjet({
|
||||
@ -16,6 +16,7 @@ const aj = arcjet({
|
||||
"CATEGORY:SEARCH_ENGINE",
|
||||
"CATEGORY:PREVIEW",
|
||||
"CATEGORY:SOCIAL",
|
||||
"GO_HTTP",
|
||||
],
|
||||
}),
|
||||
],
|
||||
@ -23,11 +24,8 @@ const aj = arcjet({
|
||||
|
||||
export default async function middleware(req: NextRequest) {
|
||||
const decision = await aj.protect(req);
|
||||
console.log(decision);
|
||||
|
||||
if (
|
||||
// If this deny comes from a bot rule then block the request. You can
|
||||
// customize this logic to fit your needs e.g. changing the status code.
|
||||
decision.isDenied() &&
|
||||
decision.reason.isBot()
|
||||
) {
|
||||
|
@ -1,8 +1,10 @@
|
||||
/** @type {import('next').NextConfig} */
|
||||
|
||||
import { withContentCollections } from "@content-collections/next";
|
||||
import createMDX from '@next/mdx';
|
||||
|
||||
const nextConfig = {
|
||||
pageExtensions: ['js', 'jsx', 'md', 'mdx', 'ts', 'tsx'],
|
||||
output: "standalone",
|
||||
images: {
|
||||
remotePatterns: [
|
||||
@ -16,4 +18,6 @@ const nextConfig = {
|
||||
},
|
||||
};
|
||||
|
||||
export default withContentCollections(nextConfig);
|
||||
const withMDX = createMDX({});
|
||||
|
||||
export default withContentCollections(withMDX(nextConfig));
|
||||
|
1764
package-lock.json
generated
1764
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@ -12,7 +12,11 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"@arcjet/next": "^1.0.0-alpha.26",
|
||||
"@mdx-js/loader": "^3.0.1",
|
||||
"@mdx-js/react": "^3.0.1",
|
||||
"@next/mdx": "^14.2.14",
|
||||
"@tabler/icons-react": "^3.17.0",
|
||||
"@types/mdx": "^2.0.13",
|
||||
"date-fns": "^4.1.0",
|
||||
"feed": "^4.2.2",
|
||||
"lucide-react": "^0.399.0",
|
||||
|
@ -1 +0,0 @@
|
||||
OK
|
Loading…
x
Reference in New Issue
Block a user