Update package.json and health route to enhance functionality and environment configuration
- Added new script "plesk:images" to package.json for building images. - Modified health route to include environment and version information in the response. - Updated portal-backend.env.sample to include new environment variables for application name and rate limiting settings.
This commit is contained in:
parent
7e053a666c
commit
3f01656bbb
@ -1,7 +1,14 @@
|
|||||||
import { NextResponse } from "next/server";
|
import { NextResponse } from "next/server";
|
||||||
|
|
||||||
export const dynamic = "force-static";
|
export async function GET() {
|
||||||
|
return NextResponse.json(
|
||||||
export function GET() {
|
{
|
||||||
return NextResponse.json({ status: "ok", timestamp: new Date().toISOString() });
|
status: "ok",
|
||||||
|
timestamp: new Date().toISOString(),
|
||||||
|
environment: process.env.NODE_ENV || "development",
|
||||||
|
version: process.env.NEXT_PUBLIC_APP_VERSION || "unknown",
|
||||||
|
},
|
||||||
|
{ status: 200 }
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
20
env/portal-backend.env.sample
vendored
20
env/portal-backend.env.sample
vendored
@ -3,6 +3,7 @@ NODE_ENV=production
|
|||||||
# App
|
# App
|
||||||
APP_BASE_URL=https://asolutions.jp
|
APP_BASE_URL=https://asolutions.jp
|
||||||
BFF_PORT=4000
|
BFF_PORT=4000
|
||||||
|
APP_NAME=customer-portal-bff
|
||||||
|
|
||||||
# Database (PostgreSQL)
|
# Database (PostgreSQL)
|
||||||
POSTGRES_DB=portal_prod
|
POSTGRES_DB=portal_prod
|
||||||
@ -22,10 +23,20 @@ BCRYPT_ROUNDS=12
|
|||||||
CORS_ORIGIN=https://asolutions.jp
|
CORS_ORIGIN=https://asolutions.jp
|
||||||
TRUST_PROXY=true
|
TRUST_PROXY=true
|
||||||
|
|
||||||
|
# Rate Limiting (optional; defaults shown)
|
||||||
|
RATE_LIMIT_TTL=60000
|
||||||
|
RATE_LIMIT_LIMIT=100
|
||||||
|
AUTH_RATE_LIMIT_TTL=900000
|
||||||
|
AUTH_RATE_LIMIT_LIMIT=3
|
||||||
|
|
||||||
# WHMCS Credentials
|
# WHMCS Credentials
|
||||||
WHMCS_BASE_URL=https://accounts.asolutions.co.jp
|
WHMCS_BASE_URL=https://accounts.asolutions.co.jp
|
||||||
WHMCS_API_IDENTIFIER=
|
WHMCS_API_IDENTIFIER=
|
||||||
WHMCS_API_SECRET=
|
WHMCS_API_SECRET=
|
||||||
|
# Optional API access key if your deployment uses it
|
||||||
|
WHMCS_API_ACCESS_KEY=
|
||||||
|
# Optional webhook security for WHMCS webhooks
|
||||||
|
WHMCS_WEBHOOK_SECRET=
|
||||||
# Optional elevated admin credentials for privileged actions (eg. AcceptOrder)
|
# Optional elevated admin credentials for privileged actions (eg. AcceptOrder)
|
||||||
# Provide the admin username and MD5 hash of the admin password.
|
# Provide the admin username and MD5 hash of the admin password.
|
||||||
# When set, the backend will use these ONLY for the AcceptOrder action.
|
# When set, the backend will use these ONLY for the AcceptOrder action.
|
||||||
@ -37,6 +48,7 @@ SF_LOGIN_URL=https://asolutions.my.salesforce.com
|
|||||||
SF_CLIENT_ID=
|
SF_CLIENT_ID=
|
||||||
SF_PRIVATE_KEY_PATH=/app/secrets/sf-private.key
|
SF_PRIVATE_KEY_PATH=/app/secrets/sf-private.key
|
||||||
SF_USERNAME=
|
SF_USERNAME=
|
||||||
|
SF_WEBHOOK_SECRET=
|
||||||
|
|
||||||
# Salesforce Platform Events (Provisioning)
|
# Salesforce Platform Events (Provisioning)
|
||||||
SF_EVENTS_ENABLED=true
|
SF_EVENTS_ENABLED=true
|
||||||
@ -63,6 +75,14 @@ SENDGRID_SANDBOX=false
|
|||||||
EMAIL_TEMPLATE_RESET=
|
EMAIL_TEMPLATE_RESET=
|
||||||
EMAIL_TEMPLATE_WELCOME=
|
EMAIL_TEMPLATE_WELCOME=
|
||||||
|
|
||||||
|
# Freebit (SIM management; optional)
|
||||||
|
FREEBIT_BASE_URL=https://i1.mvno.net/emptool/api
|
||||||
|
FREEBIT_OEM_ID=PASI
|
||||||
|
FREEBIT_OEM_KEY=
|
||||||
|
FREEBIT_TIMEOUT=30000
|
||||||
|
FREEBIT_RETRY_ATTEMPTS=3
|
||||||
|
FREEBIT_DETAILS_ENDPOINT=/master/getAcnt/
|
||||||
|
|
||||||
# Node Options
|
# Node Options
|
||||||
NODE_OPTIONS=--max-old-space-size=512
|
NODE_OPTIONS=--max-old-space-size=512
|
||||||
|
|
||||||
|
|||||||
@ -47,7 +47,8 @@
|
|||||||
"update:check": "pnpm outdated --recursive",
|
"update:check": "pnpm outdated --recursive",
|
||||||
"update:all": "pnpm update --recursive --latest && pnpm audit && pnpm type-check",
|
"update:all": "pnpm update --recursive --latest && pnpm audit && pnpm type-check",
|
||||||
"update:safe": "pnpm update --recursive && pnpm audit && pnpm type-check",
|
"update:safe": "pnpm update --recursive && pnpm audit && pnpm type-check",
|
||||||
"dev:watch": "pnpm --parallel --filter @customer-portal/shared --filter @customer-portal/portal --filter @customer-portal/bff run dev"
|
"dev:watch": "pnpm --parallel --filter @customer-portal/shared --filter @customer-portal/portal --filter @customer-portal/bff run dev",
|
||||||
|
"plesk:images": "bash ./scripts/plesk/build-images.sh"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@eslint/eslintrc": "^3.3.1",
|
"@eslint/eslintrc": "^3.3.1",
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user