Compare commits
No commits in common. "7c6effc66e5cb0568a97ebe28391665c609ba786" and "8184fece1b9a14c1393e7431140048d502af3fcd" have entirely different histories.
7c6effc66e
...
8184fece1b
@ -37,7 +37,6 @@ next-env.d.ts
|
|||||||
|
|
||||||
# Kubernetes
|
# Kubernetes
|
||||||
/manifest/
|
/manifest/
|
||||||
Earthfile
|
|
||||||
|
|
||||||
# Content collections
|
# Content collections
|
||||||
.content-collections
|
.content-collections
|
@ -27,8 +27,9 @@ run:
|
|||||||
COPY +build/app/.next/standalone /app
|
COPY +build/app/.next/standalone /app
|
||||||
COPY +build/app/.next/static /app/.next/static
|
COPY +build/app/.next/static /app/.next/static
|
||||||
COPY +build/app/public /app/public
|
COPY +build/app/public /app/public
|
||||||
|
RUN mkdir -p /app/.next/cache
|
||||||
|
|
||||||
EXPOSE 3000
|
EXPOSE 3000
|
||||||
CMD [ "node", "server.js" ]
|
CMD [ "node", "server.js" ]
|
||||||
|
|
||||||
SAVE IMAGE --push registry.default.svc.alrest.xeserv.us/techaro/www
|
SAVE IMAGE --push ghcr.io/xe/techaro-lol
|
@ -1,14 +0,0 @@
|
|||||||
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
|
service: techaro-lol
|
||||||
port: 80
|
port: 80
|
||||||
replicas:
|
replicas:
|
||||||
min: 0
|
min: 1
|
||||||
max: 10
|
max: 10
|
||||||
scaledownPeriod: 300
|
scaledownPeriod: 300
|
||||||
scalingMetric:
|
scalingMetric:
|
||||||
|
@ -16,7 +16,7 @@ spec:
|
|||||||
claimName: techaro-lol-temp
|
claimName: techaro-lol-temp
|
||||||
containers:
|
containers:
|
||||||
- name: main
|
- name: main
|
||||||
image: reg.xeiaso.net/techaro/www:latest
|
image: ghcr.io/xe/techaro-lol:latest
|
||||||
imagePullPolicy: "Always"
|
imagePullPolicy: "Always"
|
||||||
resources:
|
resources:
|
||||||
limits:
|
limits:
|
||||||
@ -44,10 +44,12 @@ spec:
|
|||||||
type: RuntimeDefault
|
type: RuntimeDefault
|
||||||
livenessProbe:
|
livenessProbe:
|
||||||
httpGet:
|
httpGet:
|
||||||
path: /healthz
|
path: /_healthz
|
||||||
port: 3000
|
port: 3000
|
||||||
httpHeaders:
|
httpHeaders:
|
||||||
|
- name: x-real-ip
|
||||||
|
value: "100.100.100.100"
|
||||||
- name: user-agent
|
- name: user-agent
|
||||||
value: "healthz"
|
value: "Kubernetes healthchecks"
|
||||||
initialDelaySeconds: 3
|
initialDelaySeconds: 3
|
||||||
periodSeconds: 3
|
periodSeconds: 3
|
@ -4,7 +4,7 @@ import { NextRequest, NextResponse } from "next/server";
|
|||||||
export const config = {
|
export const config = {
|
||||||
// matcher tells Next.js which routes to run the middleware on.
|
// matcher tells Next.js which routes to run the middleware on.
|
||||||
// This runs the middleware on all routes except for static assets.
|
// This runs the middleware on all routes except for static assets.
|
||||||
matcher: ["/((?!_next/static|_next/image|favicon.ico|healthz|.well-known/.*).*)"],
|
matcher: ["/((?!_next/static|_next/image|favicon.ico|_healthz).*)"],
|
||||||
};
|
};
|
||||||
|
|
||||||
const aj = arcjet({
|
const aj = arcjet({
|
||||||
@ -16,7 +16,6 @@ const aj = arcjet({
|
|||||||
"CATEGORY:SEARCH_ENGINE",
|
"CATEGORY:SEARCH_ENGINE",
|
||||||
"CATEGORY:PREVIEW",
|
"CATEGORY:PREVIEW",
|
||||||
"CATEGORY:SOCIAL",
|
"CATEGORY:SOCIAL",
|
||||||
"GO_HTTP",
|
|
||||||
],
|
],
|
||||||
}),
|
}),
|
||||||
],
|
],
|
||||||
@ -24,8 +23,11 @@ const aj = arcjet({
|
|||||||
|
|
||||||
export default async function middleware(req: NextRequest) {
|
export default async function middleware(req: NextRequest) {
|
||||||
const decision = await aj.protect(req);
|
const decision = await aj.protect(req);
|
||||||
|
console.log(decision);
|
||||||
|
|
||||||
if (
|
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.isDenied() &&
|
||||||
decision.reason.isBot()
|
decision.reason.isBot()
|
||||||
) {
|
) {
|
||||||
|
@ -1,10 +1,8 @@
|
|||||||
/** @type {import('next').NextConfig} */
|
/** @type {import('next').NextConfig} */
|
||||||
|
|
||||||
import { withContentCollections } from "@content-collections/next";
|
import { withContentCollections } from "@content-collections/next";
|
||||||
import createMDX from '@next/mdx';
|
|
||||||
|
|
||||||
const nextConfig = {
|
const nextConfig = {
|
||||||
pageExtensions: ['js', 'jsx', 'md', 'mdx', 'ts', 'tsx'],
|
|
||||||
output: "standalone",
|
output: "standalone",
|
||||||
images: {
|
images: {
|
||||||
remotePatterns: [
|
remotePatterns: [
|
||||||
@ -18,6 +16,4 @@ const nextConfig = {
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
const withMDX = createMDX({});
|
export default withContentCollections(nextConfig);
|
||||||
|
|
||||||
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,11 +12,7 @@
|
|||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@arcjet/next": "^1.0.0-alpha.26",
|
"@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",
|
"@tabler/icons-react": "^3.17.0",
|
||||||
"@types/mdx": "^2.0.13",
|
|
||||||
"date-fns": "^4.1.0",
|
"date-fns": "^4.1.0",
|
||||||
"feed": "^4.2.2",
|
"feed": "^4.2.2",
|
||||||
"lucide-react": "^0.399.0",
|
"lucide-react": "^0.399.0",
|
||||||
|
1
public/_healthz
Normal file
1
public/_healthz
Normal file
@ -0,0 +1 @@
|
|||||||
|
OK
|
Loading…
x
Reference in New Issue
Block a user