From f79b3f8f267da40cb1955c048fe106280ce35fc2 Mon Sep 17 00:00:00 2001 From: NicolasCantu Date: Wed, 24 Sep 2025 18:29:11 +0200 Subject: [PATCH] refactor(config): drop local.4nkweb.com (http) usage; enforce https lecoffreio.4nkweb.com\n\n- Remove CORS default for local.4nkweb.com:3000\n- Default APP_HOST to https://lecoffreio.4nkweb.com\n- Remove obsolete nginx conf --- confs/nginx/local.4nkweb.com-3000.conf | 7 ------- logs/restart.out | 15 +++++++++++++++ src/config/index.ts | 5 ++--- src/config/stripe.ts | 2 +- 4 files changed, 18 insertions(+), 11 deletions(-) delete mode 100644 confs/nginx/local.4nkweb.com-3000.conf diff --git a/confs/nginx/local.4nkweb.com-3000.conf b/confs/nginx/local.4nkweb.com-3000.conf deleted file mode 100644 index a958acd..0000000 --- a/confs/nginx/local.4nkweb.com-3000.conf +++ /dev/null @@ -1,7 +0,0 @@ -server { - listen 3000; - server_name local.4nkweb.com; - - # Redirige vers le front final en conservant chemin + query - return 301 https://dev3.4nkweb.com/idnot/callback$is_args$args; -} diff --git a/logs/restart.out b/logs/restart.out index acd28f9..29ab1ed 100644 --- a/logs/restart.out +++ b/logs/restart.out @@ -928,3 +928,18 @@ Full error response: { statusCode: 200 } } +❌ [ERROR] 2025-09-24T16:26:14.020Z HTTP GET /login - 404 +──────────────────────────────────────────────────────────────────────────────── +{ + duration: 0, + request: { + ip: '::ffff:45.135.193.254', + method: 'GET', + url: '/login', + userAgent: 'Go-http-client/1.1' + }, + requestId: 'req_1758731174020_yqpyn3ptj', + response: { + statusCode: 404 + } +} diff --git a/src/config/index.ts b/src/config/index.ts index 3a39278..d6926e8 100644 --- a/src/config/index.ts +++ b/src/config/index.ts @@ -5,7 +5,7 @@ dotenv.config(); export const config = { port: process.env.PORT || 8080, defaultStorage: process.env.DEFAULT_STORAGE || 'https://dev3.4nkweb.com/storage', - appHost: process.env.APP_HOST || 'http://localhost:3000', + appHost: process.env.APP_HOST || 'https://localhost:3000', // Déterminer dynamiquement l'origine CORS à partir d'APP_HOST si possible cors: (() => { @@ -39,8 +39,7 @@ export const config = { .filter((r): r is RegExp => !!r); const defaultRegexList: RegExp[] = [ - /^https:\/\/.*\.4nkweb\.com$/, - /^http:\/\/local\.4nkweb\.com:3000$/ + /^https:\/\/.*\.4nkweb\.com$/ ]; const regexList = regexFromEnv.length > 0 ? regexFromEnv : defaultRegexList; diff --git a/src/config/stripe.ts b/src/config/stripe.ts index 267b1da..59cb68d 100644 --- a/src/config/stripe.ts +++ b/src/config/stripe.ts @@ -1,5 +1,5 @@ export const stripeConfig = { STRIPE_SECRET_KEY: process.env.STRIPE_SECRET_KEY, STRIPE_WEBHOOK_SECRET: process.env.STRIPE_WEBHOOK_SECRET, - APP_HOST: process.env.APP_HOST || 'http://localhost:3000', + APP_HOST: process.env.APP_HOST || 'https://lecoffreio.4nkweb.com', };