refactor: use environment variable for GHOST_API_KEY

Replace hardcoded GHOST_API_KEY with process.env.GHOST_API_KEY in 
API routes to enhance security. Update Docker commands in the CI 
workflow to pass the GHOST_API_KEY as an environment variable. 
Add GHOST_API_KEY to the Next.js configuration for consistent 
access across the application.
This commit is contained in:
2025-02-12 17:30:31 +01:00
parent af35a071a7
commit b87b1d6237
4 changed files with 19 additions and 13 deletions

View File

@@ -3,7 +3,7 @@ import { NextResponse } from "next/server";
export const runtime = "nodejs"; // Force Node runtime
const GHOST_API_URL = "http://192.168.179.31:2368";
const GHOST_API_KEY = "067b8434f2e7f2a771dfcc45a7"; // Replace with your actual key
const GHOST_API_KEY = process.env.GHOST_API_KEY;
export async function GET() {
try {

View File

@@ -3,7 +3,7 @@ import { NextResponse } from "next/server";
export const runtime = "nodejs"; // Force Node runtime
const GHOST_API_URL = "http://192.168.179.31:2368";
const GHOST_API_KEY = "067b8434f2e7f2a771dfcc45a7"; // Replace with your actual key
const GHOST_API_KEY = process.env.GHOST_API_KEY;
export async function GET(request: Request) {
const { searchParams } = new URL(request.url);