Compare commits
8 Commits
v1.2.11-rc
...
v1.2.14
| Author | SHA1 | Date | |
|---|---|---|---|
| b1859c15ce | |||
| 6085cc05dc | |||
| bcf2d60da6 | |||
| f4fdb89ba4 | |||
| 9de3931e33 | |||
| b10dbcb23f | |||
| 65bb9c620a | |||
| 63853ffa89 |
@@ -50,12 +50,15 @@ jobs:
|
|||||||
uses: actions/cache@v4
|
uses: actions/cache@v4
|
||||||
with:
|
with:
|
||||||
path: .turbo
|
path: .turbo
|
||||||
key: ${{ runner.os }}-turbo-${{ github.sha }}
|
key: ${{ runner.os }}-turbo-global-${{ github.sha }}
|
||||||
restore-keys: |
|
restore-keys: |
|
||||||
|
${{ runner.os }}-turbo-global-
|
||||||
${{ runner.os }}-turbo-
|
${{ runner.os }}-turbo-
|
||||||
|
|
||||||
- name: 🧪 QA Checks
|
- name: 🧪 QA Checks
|
||||||
run: npx turbo run check:mdx lint typecheck test
|
env:
|
||||||
|
TURBO_TELEMETRY_DISABLED: "1"
|
||||||
|
run: npx turbo run check:mdx lint typecheck test --cache-dir=".turbo"
|
||||||
|
|
||||||
- name: 🏗️ Build
|
- name: 🏗️ Build
|
||||||
run: pnpm build
|
run: pnpm build
|
||||||
|
|||||||
@@ -175,15 +175,18 @@ jobs:
|
|||||||
uses: actions/cache@v4
|
uses: actions/cache@v4
|
||||||
with:
|
with:
|
||||||
path: .turbo
|
path: .turbo
|
||||||
key: ${{ runner.os }}-turbo-${{ github.sha }}
|
key: ${{ runner.os }}-turbo-global-${{ github.sha }}
|
||||||
restore-keys: |
|
restore-keys: |
|
||||||
|
${{ runner.os }}-turbo-global-
|
||||||
${{ runner.os }}-turbo-
|
${{ runner.os }}-turbo-
|
||||||
|
|
||||||
- name: 🔒 Security Audit
|
- name: 🔒 Security Audit
|
||||||
run: pnpm audit --audit-level high
|
run: pnpm audit --audit-level high
|
||||||
- name: 🧪 QA Checks
|
- name: 🧪 QA Checks
|
||||||
if: github.event.inputs.skip_checks != 'true'
|
if: github.event.inputs.skip_checks != 'true'
|
||||||
run: npx turbo run lint check:spell typecheck test
|
env:
|
||||||
|
TURBO_TELEMETRY_DISABLED: "1"
|
||||||
|
run: npx turbo run lint check:spell typecheck test --cache-dir=".turbo"
|
||||||
|
|
||||||
# ──────────────────────────────────────────────────────────────────────────────
|
# ──────────────────────────────────────────────────────────────────────────────
|
||||||
# JOB 3: Build & Push
|
# JOB 3: Build & Push
|
||||||
@@ -389,7 +392,7 @@ jobs:
|
|||||||
name: 🧪 Smoke Test
|
name: 🧪 Smoke Test
|
||||||
needs: [prepare, deploy]
|
needs: [prepare, deploy]
|
||||||
continue-on-error: true
|
continue-on-error: true
|
||||||
if: needs.deploy.result == 'success'
|
if: needs.deploy.result == 'success' && github.ref_type != 'tag'
|
||||||
runs-on: docker
|
runs-on: docker
|
||||||
container:
|
container:
|
||||||
image: catthehacker/ubuntu:act-latest
|
image: catthehacker/ubuntu:act-latest
|
||||||
@@ -422,7 +425,7 @@ jobs:
|
|||||||
name: ⚡ Lighthouse
|
name: ⚡ Lighthouse
|
||||||
needs: [prepare, deploy]
|
needs: [prepare, deploy]
|
||||||
continue-on-error: true
|
continue-on-error: true
|
||||||
if: success() && needs.prepare.outputs.target != 'skip'
|
if: success() && needs.prepare.outputs.target != 'skip' && github.ref_type != 'tag'
|
||||||
runs-on: docker
|
runs-on: docker
|
||||||
container:
|
container:
|
||||||
image: catthehacker/ubuntu:act-latest
|
image: catthehacker/ubuntu:act-latest
|
||||||
@@ -497,7 +500,7 @@ jobs:
|
|||||||
name: ♿ WCAG
|
name: ♿ WCAG
|
||||||
needs: [prepare, deploy, smoke_test]
|
needs: [prepare, deploy, smoke_test]
|
||||||
continue-on-error: true
|
continue-on-error: true
|
||||||
if: success() && needs.prepare.outputs.target != 'skip'
|
if: success() && needs.prepare.outputs.target != 'skip' && github.ref_type != 'tag'
|
||||||
runs-on: docker
|
runs-on: docker
|
||||||
container:
|
container:
|
||||||
image: catthehacker/ubuntu:act-latest
|
image: catthehacker/ubuntu:act-latest
|
||||||
@@ -579,7 +582,7 @@ jobs:
|
|||||||
name: 🛡️ Quality Gates
|
name: 🛡️ Quality Gates
|
||||||
needs: [prepare, deploy, smoke_test]
|
needs: [prepare, deploy, smoke_test]
|
||||||
continue-on-error: true
|
continue-on-error: true
|
||||||
if: success() && needs.prepare.outputs.target != 'skip'
|
if: success() && needs.prepare.outputs.target != 'skip' && github.ref_type != 'tag'
|
||||||
runs-on: docker
|
runs-on: docker
|
||||||
container:
|
container:
|
||||||
image: catthehacker/ubuntu:act-latest
|
image: catthehacker/ubuntu:act-latest
|
||||||
|
|||||||
@@ -10,10 +10,38 @@ const intlMiddleware = createMiddleware({
|
|||||||
defaultLocale: 'en',
|
defaultLocale: 'en',
|
||||||
});
|
});
|
||||||
|
|
||||||
export default function middleware(request: NextRequest) {
|
const imgproxyStatus = { isDown: false, lastCheck: 0 };
|
||||||
|
|
||||||
|
async function isImgproxyDown() {
|
||||||
|
const now = Date.now();
|
||||||
|
if (now - imgproxyStatus.lastCheck > 60000) {
|
||||||
|
try {
|
||||||
|
const imgproxyUrl = process.env.IMGPROXY_URL || 'https://img.infra.mintel.me';
|
||||||
|
const checkUrl = imgproxyUrl.startsWith('http') ? imgproxyUrl : `https://${imgproxyUrl}`;
|
||||||
|
const res = await fetch(checkUrl, { signal: AbortSignal.timeout(2000) });
|
||||||
|
imgproxyStatus.isDown = res.status >= 500;
|
||||||
|
} catch (e) {
|
||||||
|
imgproxyStatus.isDown = true;
|
||||||
|
}
|
||||||
|
imgproxyStatus.lastCheck = now;
|
||||||
|
}
|
||||||
|
return imgproxyStatus.isDown;
|
||||||
|
}
|
||||||
|
|
||||||
|
export default async function middleware(request: NextRequest) {
|
||||||
const { method, url, headers } = request;
|
const { method, url, headers } = request;
|
||||||
const { pathname } = request.nextUrl;
|
const { pathname } = request.nextUrl;
|
||||||
|
|
||||||
|
if (pathname.startsWith('/_img/')) {
|
||||||
|
if (await isImgproxyDown()) {
|
||||||
|
const originalUrl = request.nextUrl.searchParams.get('url');
|
||||||
|
if (originalUrl) {
|
||||||
|
return NextResponse.redirect(originalUrl);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return NextResponse.next();
|
||||||
|
}
|
||||||
|
|
||||||
// Explicit bypass for infrastructure routes to avoid locale redirects/interception
|
// Explicit bypass for infrastructure routes to avoid locale redirects/interception
|
||||||
if (
|
if (
|
||||||
pathname.startsWith('/stats') ||
|
pathname.startsWith('/stats') ||
|
||||||
@@ -97,7 +125,7 @@ export default function middleware(request: NextRequest) {
|
|||||||
|
|
||||||
export const config = {
|
export const config = {
|
||||||
matcher: [
|
matcher: [
|
||||||
'/((?!api|_next/static|_next/image|_img|favicon.ico|manifest.webmanifest|.*\\.(?:svg|png|jpg|jpeg|gif|webp|pdf|txt|vcf|xml|webm|mp4|map)$).*)',
|
'/((?!api|_next/static|_next/image|favicon.ico|manifest.webmanifest|.*\\.(?:svg|png|jpg|jpeg|gif|webp|pdf|txt|vcf|xml|webm|mp4|map)$).*)',
|
||||||
'/(de|en)/:path*',
|
'/(de|en)/:path*',
|
||||||
'/(de|en)/:path*',
|
'/(de|en)/:path*',
|
||||||
],
|
],
|
||||||
|
|||||||
@@ -126,7 +126,7 @@
|
|||||||
"prepare": "husky",
|
"prepare": "husky",
|
||||||
"preinstall": "npx only-allow pnpm"
|
"preinstall": "npx only-allow pnpm"
|
||||||
},
|
},
|
||||||
"version": "1.0.0",
|
"version": "1.0.1-rc.0",
|
||||||
"pnpm": {
|
"pnpm": {
|
||||||
"overrides": {
|
"overrides": {
|
||||||
"next": "16.1.6",
|
"next": "16.1.6",
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
@import 'tailwindcss';
|
@import 'tailwindcss';
|
||||||
|
@config "../tailwind.config.cjs";
|
||||||
|
|
||||||
@theme {
|
@theme {
|
||||||
--font-sans:
|
--font-sans:
|
||||||
@@ -46,6 +47,18 @@
|
|||||||
--animate-slight-fade-in-from-bottom: slight-fade-in-from-bottom 0.8s
|
--animate-slight-fade-in-from-bottom: slight-fade-in-from-bottom 0.8s
|
||||||
cubic-bezier(0.16, 1, 0.3, 1) forwards;
|
cubic-bezier(0.16, 1, 0.3, 1) forwards;
|
||||||
--animate-gradient-x: gradient-x 15s ease infinite;
|
--animate-gradient-x: gradient-x 15s ease infinite;
|
||||||
|
--animate-draw-stroke: draw-stroke 1.8s ease-in-out 0.5s forwards;
|
||||||
|
|
||||||
|
@keyframes draw-stroke {
|
||||||
|
from {
|
||||||
|
stroke-dasharray: 1;
|
||||||
|
stroke-dashoffset: 1;
|
||||||
|
}
|
||||||
|
to {
|
||||||
|
stroke-dasharray: 1;
|
||||||
|
stroke-dashoffset: 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@keyframes gradient-x {
|
@keyframes gradient-x {
|
||||||
0%,
|
0%,
|
||||||
|
|||||||
32
turbo.json
32
turbo.json
@@ -1,19 +1,51 @@
|
|||||||
{
|
{
|
||||||
"$schema": "https://turbo.build/schema.json",
|
"$schema": "https://turbo.build/schema.json",
|
||||||
|
"globalDependencies": [
|
||||||
|
"pnpm-lock.yaml",
|
||||||
|
".gitea/workflows/ci.yml",
|
||||||
|
".gitea/workflows/deploy.yml"
|
||||||
|
],
|
||||||
"tasks": {
|
"tasks": {
|
||||||
"lint": {
|
"lint": {
|
||||||
|
"inputs": [
|
||||||
|
"app/**/*.tsx",
|
||||||
|
"app/**/*.ts",
|
||||||
|
"components/**/*.tsx",
|
||||||
|
"components/**/*.ts",
|
||||||
|
"lib/**/*.ts",
|
||||||
|
"eslint.config.mjs"
|
||||||
|
],
|
||||||
"outputs": []
|
"outputs": []
|
||||||
},
|
},
|
||||||
"typecheck": {
|
"typecheck": {
|
||||||
|
"inputs": [
|
||||||
|
"app/**/*.tsx",
|
||||||
|
"app/**/*.ts",
|
||||||
|
"components/**/*.tsx",
|
||||||
|
"components/**/*.ts",
|
||||||
|
"lib/**/*.ts",
|
||||||
|
"tsconfig.json"
|
||||||
|
],
|
||||||
"outputs": []
|
"outputs": []
|
||||||
},
|
},
|
||||||
"test": {
|
"test": {
|
||||||
|
"inputs": [
|
||||||
|
"app/**/*.tsx",
|
||||||
|
"app/**/*.ts",
|
||||||
|
"components/**/*.tsx",
|
||||||
|
"components/**/*.ts",
|
||||||
|
"lib/**/*.ts",
|
||||||
|
"tests/**/*.ts",
|
||||||
|
"vitest.config.mts"
|
||||||
|
],
|
||||||
"outputs": []
|
"outputs": []
|
||||||
},
|
},
|
||||||
"check:spell": {
|
"check:spell": {
|
||||||
|
"inputs": ["content/**/*.{md,mdx}", "app/**/*.tsx", "components/**/*.tsx", "cspell.json"],
|
||||||
"outputs": []
|
"outputs": []
|
||||||
},
|
},
|
||||||
"check:mdx": {
|
"check:mdx": {
|
||||||
|
"inputs": ["content/**/*.{md,mdx}", "scripts/validate-mdx.mjs"],
|
||||||
"outputs": []
|
"outputs": []
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user