fix: partager le même commit entre recette et production
This commit is contained in:
@@ -22,4 +22,5 @@ jobs:
|
|||||||
working-directory: src/frontend
|
working-directory: src/frontend
|
||||||
run: |
|
run: |
|
||||||
npm ci
|
npm ci
|
||||||
|
npm test
|
||||||
npm run build
|
npm run build
|
||||||
|
|||||||
@@ -9,17 +9,22 @@ services:
|
|||||||
# Le dashboard doit repartir seul après un arrêt anormal du processus.
|
# Le dashboard doit repartir seul après un arrêt anormal du processus.
|
||||||
restart: always
|
restart: always
|
||||||
mem_limit: 512m
|
mem_limit: 512m
|
||||||
|
env_file:
|
||||||
|
- .env
|
||||||
environment:
|
environment:
|
||||||
- NODE_ENV=production
|
- NODE_ENV=${NODE_ENV:-production}
|
||||||
- DASHBOARD_ENV=recette
|
- DASHBOARD_ENV=${DASHBOARD_ENV:-recette}
|
||||||
- PORT=3001
|
- PORT=${PORT:-3001}
|
||||||
- JWT_SECRET=manus-dashboard-jwt-secret-2026-recette
|
- JWT_SECRET=${JWT_SECRET:?JWT_SECRET requis dans le fichier .env serveur}
|
||||||
- ADMIN_USERNAME=adminItinova
|
- ADMIN_USERNAME=${ADMIN_USERNAME:?ADMIN_USERNAME requis dans le fichier .env serveur}
|
||||||
- ADMIN_PASSWORD=Itinova69!
|
- ADMIN_PASSWORD=${ADMIN_PASSWORD:?ADMIN_PASSWORD requis dans le fichier .env serveur}
|
||||||
- GITEA_URL=https://git.recette.santinova-soft.org
|
- GITEA_URL=${GITEA_URL:?GITEA_URL requis dans le fichier .env serveur}
|
||||||
- GITEA_USERNAME=manus-admin
|
- GITEA_USERNAME=${GITEA_USERNAME:-manus-admin}
|
||||||
- GITEA_TOKEN=${GITEA_TOKEN:?GITEA_TOKEN requis dans le fichier .env serveur}
|
- GITEA_TOKEN=${GITEA_TOKEN:?GITEA_TOKEN requis dans le fichier .env serveur}
|
||||||
- GITEA_RECETTE_URL=http://gitea:3000
|
- GITEA_RECETTE_URL=${GITEA_RECETTE_URL:-http://gitea:3000}
|
||||||
|
- GITEA_RECETTE_PUBLIC_URL=${GITEA_RECETTE_PUBLIC_URL:-https://git.recette.santinova-soft.org}
|
||||||
|
- GITEA_RECETTE_TOKEN=${GITEA_RECETTE_TOKEN:-}
|
||||||
|
- GITEA_PROD_URL=${GITEA_PROD_URL:-https://git.santinova-soft.org}
|
||||||
- GITEA_TOKEN_PROD=${GITEA_TOKEN_PROD:-}
|
- GITEA_TOKEN_PROD=${GITEA_TOKEN_PROD:-}
|
||||||
- WEBHOOK_SECRET=${WEBHOOK_SECRET:?WEBHOOK_SECRET requis dans le fichier .env serveur}
|
- WEBHOOK_SECRET=${WEBHOOK_SECRET:?WEBHOOK_SECRET requis dans le fichier .env serveur}
|
||||||
- IA_REFERENTIEL_URL=${IA_REFERENTIEL_URL:-https://referentiel-ia.recette.santinova-soft.org}
|
- IA_REFERENTIEL_URL=${IA_REFERENTIEL_URL:-https://referentiel-ia.recette.santinova-soft.org}
|
||||||
@@ -35,12 +40,13 @@ services:
|
|||||||
- /opt/manus-deploy:/opt/manus-deploy
|
- /opt/manus-deploy:/opt/manus-deploy
|
||||||
extra_hosts:
|
extra_hosts:
|
||||||
- "git.santinova-soft.org:180.149.196.138"
|
- "git.santinova-soft.org:180.149.196.138"
|
||||||
|
- "git.recette.santinova-soft.org:78.138.58.109"
|
||||||
networks:
|
networks:
|
||||||
- web
|
- web
|
||||||
labels:
|
labels:
|
||||||
- "traefik.enable=true"
|
- "traefik.enable=true"
|
||||||
# Route HTTPS via dashboard.recette.santinova-soft.org
|
# Le domaine public est spécifique au serveur, mais le commit reste commun.
|
||||||
- "traefik.http.routers.manus-dashboard.rule=Host(`dashboard.recette.santinova-soft.org`)"
|
- "traefik.http.routers.manus-dashboard.rule=Host(`${DASHBOARD_DOMAIN:?DASHBOARD_DOMAIN requis dans le fichier .env serveur}`)"
|
||||||
- "traefik.http.routers.manus-dashboard.entrypoints=websecure"
|
- "traefik.http.routers.manus-dashboard.entrypoints=websecure"
|
||||||
- "traefik.http.routers.manus-dashboard.tls=true"
|
- "traefik.http.routers.manus-dashboard.tls=true"
|
||||||
- "traefik.http.routers.manus-dashboard.tls.certresolver=letsencrypt"
|
- "traefik.http.routers.manus-dashboard.tls.certresolver=letsencrypt"
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
<meta charset="UTF-8" />
|
<meta charset="UTF-8" />
|
||||||
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
|
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||||
<title>Dashboard Recette - Gestion des Applications</title>
|
<title>Dashboard - Gestion des Applications</title>
|
||||||
</head>
|
</head>
|
||||||
<body class="bg-dark-900 text-white">
|
<body class="bg-dark-900 text-white">
|
||||||
<div id="root"></div>
|
<div id="root"></div>
|
||||||
|
|||||||
@@ -5,6 +5,7 @@
|
|||||||
"type": "module",
|
"type": "module",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "vite",
|
"dev": "vite",
|
||||||
|
"test": "node --test test/*.test.mjs",
|
||||||
"build": "vite build",
|
"build": "vite build",
|
||||||
"preview": "vite preview"
|
"preview": "vite preview"
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -14,6 +14,7 @@ import {
|
|||||||
ChevronDown,
|
ChevronDown,
|
||||||
} from 'lucide-react';
|
} from 'lucide-react';
|
||||||
import { getAvailableStacks, createApp, getGiteaRepos } from '../utils/api';
|
import { getAvailableStacks, createApp, getGiteaRepos } from '../utils/api';
|
||||||
|
import { APP_DOMAIN_SUFFIX, ENVIRONMENT_LABEL_LOWER } from '../utils/environment';
|
||||||
|
|
||||||
const STEPS = [
|
const STEPS = [
|
||||||
{ id: 1, title: 'Informations', icon: FileText },
|
{ id: 1, title: 'Informations', icon: FileText },
|
||||||
@@ -180,7 +181,7 @@ export default function AddAppModal({ isOpen, onClose, onSuccess }) {
|
|||||||
Ajouter une application
|
Ajouter une application
|
||||||
</h2>
|
</h2>
|
||||||
<p className="text-sm text-gray-400 mt-0.5">
|
<p className="text-sm text-gray-400 mt-0.5">
|
||||||
Déployez une nouvelle application sur le serveur de recette
|
Déployez une nouvelle application sur le serveur de {ENVIRONMENT_LABEL_LOWER}
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
<button
|
<button
|
||||||
@@ -271,7 +272,7 @@ export default function AddAppModal({ isOpen, onClose, onSuccess }) {
|
|||||||
}`}
|
}`}
|
||||||
/>
|
/>
|
||||||
<span className="px-3 py-2.5 bg-dark-600 border border-dark-500 border-l-0 rounded-r-lg text-gray-400 text-sm whitespace-nowrap">
|
<span className="px-3 py-2.5 bg-dark-600 border border-dark-500 border-l-0 rounded-r-lg text-gray-400 text-sm whitespace-nowrap">
|
||||||
.recette.santinova-soft.org
|
.{APP_DOMAIN_SUFFIX}
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
{errors.subdomain && (
|
{errors.subdomain && (
|
||||||
@@ -280,7 +281,7 @@ export default function AddAppModal({ isOpen, onClose, onSuccess }) {
|
|||||||
{formData.subdomain && !errors.subdomain && (
|
{formData.subdomain && !errors.subdomain && (
|
||||||
<p className="text-gray-500 text-xs mt-1 flex items-center gap-1">
|
<p className="text-gray-500 text-xs mt-1 flex items-center gap-1">
|
||||||
<Globe className="w-3 h-3" />
|
<Globe className="w-3 h-3" />
|
||||||
URL: https://{formData.subdomain}.recette.santinova-soft.org
|
URL: https://{formData.subdomain}.{APP_DOMAIN_SUFFIX}
|
||||||
</p>
|
</p>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
@@ -545,7 +546,7 @@ export default function AddAppModal({ isOpen, onClose, onSuccess }) {
|
|||||||
L'application est en cours de déploiement. Suivez la progression dans l'onglet Déploiements.
|
L'application est en cours de déploiement. Suivez la progression dans l'onglet Déploiements.
|
||||||
</p>
|
</p>
|
||||||
<p className="text-gray-500 mt-2 text-xs">
|
<p className="text-gray-500 mt-2 text-xs">
|
||||||
URL: https://{formData.subdomain}.recette.santinova-soft.org
|
URL: https://{formData.subdomain}.{APP_DOMAIN_SUFFIX}
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
) : (
|
) : (
|
||||||
@@ -573,7 +574,7 @@ export default function AddAppModal({ isOpen, onClose, onSuccess }) {
|
|||||||
<div className="flex justify-between items-center px-4 py-3">
|
<div className="flex justify-between items-center px-4 py-3">
|
||||||
<span className="text-gray-400 text-sm">URL</span>
|
<span className="text-gray-400 text-sm">URL</span>
|
||||||
<span className="text-primary-400 text-sm">
|
<span className="text-primary-400 text-sm">
|
||||||
https://{formData.subdomain}.recette.santinova-soft.org
|
https://{formData.subdomain}.{APP_DOMAIN_SUFFIX}
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
<div className="flex justify-between items-center px-4 py-3">
|
<div className="flex justify-between items-center px-4 py-3">
|
||||||
|
|||||||
@@ -12,6 +12,7 @@ import { LayoutList, TerminalSquare, ShieldCheck,
|
|||||||
Activity,
|
Activity,
|
||||||
BookOpen,
|
BookOpen,
|
||||||
} from 'lucide-react';
|
} from 'lucide-react';
|
||||||
|
import { ENVIRONMENT_LABEL } from '../utils/environment';
|
||||||
const navItems = [
|
const navItems = [
|
||||||
{ id: 'dashboard', label: 'Tableau de bord', icon: LayoutDashboard },
|
{ id: 'dashboard', label: 'Tableau de bord', icon: LayoutDashboard },
|
||||||
{ id: 'apps', label: 'Applications', icon: Box },
|
{ id: 'apps', label: 'Applications', icon: Box },
|
||||||
@@ -40,7 +41,7 @@ export default function Sidebar({
|
|||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<h1 className="text-lg font-bold text-white">Dashboard</h1>
|
<h1 className="text-lg font-bold text-white">Dashboard</h1>
|
||||||
<p className="text-xs text-gray-500">Recette</p>
|
<p className="text-xs text-gray-500">{ENVIRONMENT_LABEL}</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ import {
|
|||||||
import { getApps, getSystemInfo } from '../utils/api';
|
import { getApps, getSystemInfo } from '../utils/api';
|
||||||
import StatusBadge from '../components/StatusBadge';
|
import StatusBadge from '../components/StatusBadge';
|
||||||
import { sortAppsWithInfraFirst } from '../utils/appSorting';
|
import { sortAppsWithInfraFirst } from '../utils/appSorting';
|
||||||
|
import { ENVIRONMENT_LABEL, GITEA_HOST, GITEA_URL, SERVER_PUBLIC_IP } from '../utils/environment';
|
||||||
|
|
||||||
function StatCard({ icon: Icon, label, value, color, subtext }) {
|
function StatCard({ icon: Icon, label, value, color, subtext }) {
|
||||||
return (
|
return (
|
||||||
@@ -101,7 +102,7 @@ export default function DashboardPage({ apps }) {
|
|||||||
<div className="flex items-center justify-between py-2 border-b border-dark-700">
|
<div className="flex items-center justify-between py-2 border-b border-dark-700">
|
||||||
<span className="text-sm text-gray-400">Serveur</span>
|
<span className="text-sm text-gray-400">Serveur</span>
|
||||||
<span className="text-sm text-gray-200">
|
<span className="text-sm text-gray-200">
|
||||||
78.138.58.109 (Recette)
|
{SERVER_PUBLIC_IP} ({ENVIRONMENT_LABEL})
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
<div className="flex items-center justify-between py-2 border-b border-dark-700">
|
<div className="flex items-center justify-between py-2 border-b border-dark-700">
|
||||||
@@ -114,12 +115,12 @@ export default function DashboardPage({ apps }) {
|
|||||||
<div className="flex items-center justify-between py-2 border-b border-dark-700">
|
<div className="flex items-center justify-between py-2 border-b border-dark-700">
|
||||||
<span className="text-sm text-gray-400">Gitea</span>
|
<span className="text-sm text-gray-400">Gitea</span>
|
||||||
<a
|
<a
|
||||||
href="https://git.recette.santinova-soft.org"
|
href={GITEA_URL}
|
||||||
target="_blank"
|
target="_blank"
|
||||||
rel="noopener noreferrer"
|
rel="noopener noreferrer"
|
||||||
className="text-sm text-primary-400 hover:text-primary-300"
|
className="text-sm text-primary-400 hover:text-primary-300"
|
||||||
>
|
>
|
||||||
git.recette.santinova-soft.org
|
{GITEA_HOST}
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
<div className="flex items-center justify-between py-2 border-b border-dark-700">
|
<div className="flex items-center justify-between py-2 border-b border-dark-700">
|
||||||
|
|||||||
@@ -19,6 +19,7 @@ import {
|
|||||||
ShieldCheck,
|
ShieldCheck,
|
||||||
} from 'lucide-react';
|
} from 'lucide-react';
|
||||||
import { approveGiteaTokenRotation, getGiteaRepos, getGiteaCommits, getGiteaTokenRotation, getGiteaWorkflowRuns, getGiteaWorkflowSummary, prepareGiteaTokenRotation } from '../utils/api';
|
import { approveGiteaTokenRotation, getGiteaRepos, getGiteaCommits, getGiteaTokenRotation, getGiteaWorkflowRuns, getGiteaWorkflowSummary, prepareGiteaTokenRotation } from '../utils/api';
|
||||||
|
import { GITEA_HOST, GITEA_URL } from '../utils/environment';
|
||||||
|
|
||||||
function formatDate(dateStr) {
|
function formatDate(dateStr) {
|
||||||
if (!dateStr) return 'N/A';
|
if (!dateStr) return 'N/A';
|
||||||
@@ -137,12 +138,12 @@ export default function GiteaPage() {
|
|||||||
<p className="text-gray-400 mt-1">
|
<p className="text-gray-400 mt-1">
|
||||||
Explorez les dépôts sur{' '}
|
Explorez les dépôts sur{' '}
|
||||||
<a
|
<a
|
||||||
href="https://git.recette.santinova-soft.org"
|
href={GITEA_URL}
|
||||||
target="_blank"
|
target="_blank"
|
||||||
rel="noopener noreferrer"
|
rel="noopener noreferrer"
|
||||||
className="text-primary-400 hover:text-primary-300"
|
className="text-primary-400 hover:text-primary-300"
|
||||||
>
|
>
|
||||||
git.recette.santinova-soft.org
|
{GITEA_HOST}
|
||||||
</a>
|
</a>
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
import React, { useState } from 'react';
|
import React, { useState } from 'react';
|
||||||
import { Lock, User, AlertCircle, Server } from 'lucide-react';
|
import { Lock, User, AlertCircle, Server } from 'lucide-react';
|
||||||
import { login } from '../utils/api';
|
import { login } from '../utils/api';
|
||||||
|
import { ENVIRONMENT_LABEL, ENVIRONMENT_LABEL_LOWER } from '../utils/environment';
|
||||||
|
|
||||||
export default function LoginPage({ onLogin }) {
|
export default function LoginPage({ onLogin }) {
|
||||||
const [username, setUsername] = useState('');
|
const [username, setUsername] = useState('');
|
||||||
@@ -34,7 +35,7 @@ export default function LoginPage({ onLogin }) {
|
|||||||
<div className="inline-flex items-center justify-center w-16 h-16 rounded-2xl bg-primary-600 mb-4">
|
<div className="inline-flex items-center justify-center w-16 h-16 rounded-2xl bg-primary-600 mb-4">
|
||||||
<Server className="w-8 h-8 text-white" />
|
<Server className="w-8 h-8 text-white" />
|
||||||
</div>
|
</div>
|
||||||
<h1 className="text-2xl font-bold text-white">Dashboard Recette</h1>
|
<h1 className="text-2xl font-bold text-white">Dashboard {ENVIRONMENT_LABEL}</h1>
|
||||||
<p className="text-gray-400 mt-2">Gestion des applications</p>
|
<p className="text-gray-400 mt-2">Gestion des applications</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -130,7 +131,7 @@ export default function LoginPage({ onLogin }) {
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<p className="text-center text-gray-600 text-sm mt-6">
|
<p className="text-center text-gray-600 text-sm mt-6">
|
||||||
Santinova Soft — Serveur de recette
|
Santinova Soft — Serveur de {ENVIRONMENT_LABEL_LOWER}
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
import React, { useState, useEffect, useRef, useCallback } from 'react';
|
import React, { useState, useEffect, useRef, useCallback } from 'react';
|
||||||
import { Terminal, Wifi, WifiOff, X, Plus, ChevronDown } from 'lucide-react';
|
import { Terminal, Wifi, WifiOff, X, Plus, ChevronDown } from 'lucide-react';
|
||||||
|
import { DEFAULT_SSH_PRESET, ENVIRONMENT_LABEL, SERVER_PUBLIC_IP } from '../utils/environment';
|
||||||
|
|
||||||
// Serveurs SSH prédéfinis
|
// Serveurs SSH prédéfinis
|
||||||
const PRESET_SERVERS = [
|
const PRESET_SERVERS = [
|
||||||
@@ -30,8 +31,8 @@ export default function TerminalPage() {
|
|||||||
|
|
||||||
// Formulaire de connexion
|
// Formulaire de connexion
|
||||||
const [form, setForm] = useState({
|
const [form, setForm] = useState({
|
||||||
preset: 'recette',
|
preset: DEFAULT_SSH_PRESET,
|
||||||
host: '78.138.58.109',
|
host: SERVER_PUBLIC_IP,
|
||||||
port: 22,
|
port: 22,
|
||||||
username: 'root',
|
username: 'root',
|
||||||
password: '',
|
password: '',
|
||||||
@@ -116,7 +117,7 @@ export default function TerminalPage() {
|
|||||||
fitAddonRef.current = fitAddon;
|
fitAddonRef.current = fitAddon;
|
||||||
|
|
||||||
term.writeln('\x1b[1;34m╔══════════════════════════════════════════════════╗\x1b[0m');
|
term.writeln('\x1b[1;34m╔══════════════════════════════════════════════════╗\x1b[0m');
|
||||||
term.writeln('\x1b[1;34m║ Terminal SSH — Dashboard Recette Santinova ║\x1b[0m');
|
term.writeln(`\x1b[1;34m║ Terminal SSH — Dashboard ${ENVIRONMENT_LABEL} Santinova ║\x1b[0m`);
|
||||||
term.writeln('\x1b[1;34m╚══════════════════════════════════════════════════╝\x1b[0m');
|
term.writeln('\x1b[1;34m╚══════════════════════════════════════════════════╝\x1b[0m');
|
||||||
term.writeln('');
|
term.writeln('');
|
||||||
term.writeln('\x1b[90mSélectionnez un serveur et connectez-vous pour démarrer.\x1b[0m');
|
term.writeln('\x1b[90mSélectionnez un serveur et connectez-vous pour démarrer.\x1b[0m');
|
||||||
|
|||||||
39
src/frontend/src/utils/environment.js
Normal file
39
src/frontend/src/utils/environment.js
Normal file
@@ -0,0 +1,39 @@
|
|||||||
|
/**
|
||||||
|
* Identité de l'environnement courant, déterminée par le domaine public.
|
||||||
|
* Le même artefact frontend peut ainsi être construit et exécuté en recette
|
||||||
|
* comme en production sans branche ni modification de code spécifique.
|
||||||
|
*/
|
||||||
|
export function getEnvironmentConfig(hostname) {
|
||||||
|
const normalizedHostname = hostname.toLowerCase();
|
||||||
|
const isRecette =
|
||||||
|
normalizedHostname.includes('recette') ||
|
||||||
|
normalizedHostname === 'localhost' ||
|
||||||
|
normalizedHostname === '127.0.0.1';
|
||||||
|
|
||||||
|
return {
|
||||||
|
isRecette,
|
||||||
|
label: isRecette ? 'Recette' : 'Production',
|
||||||
|
labelLower: isRecette ? 'recette' : 'production',
|
||||||
|
serverPublicIp: isRecette ? '78.138.58.109' : '180.149.196.138',
|
||||||
|
giteaUrl: isRecette
|
||||||
|
? 'https://git.recette.santinova-soft.org'
|
||||||
|
: 'https://git.santinova-soft.org',
|
||||||
|
appDomainSuffix: isRecette
|
||||||
|
? 'recette.santinova-soft.org'
|
||||||
|
: 'santinova-soft.org',
|
||||||
|
defaultSshPreset: isRecette ? 'recette' : 'production',
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
const currentHostname = typeof window === 'undefined' ? 'localhost' : window.location.hostname;
|
||||||
|
const environment = getEnvironmentConfig(currentHostname);
|
||||||
|
|
||||||
|
export const IS_RECETTE = environment.isRecette;
|
||||||
|
export const ENVIRONMENT_LABEL = environment.label;
|
||||||
|
export const ENVIRONMENT_LABEL_LOWER = environment.labelLower;
|
||||||
|
export const SERVER_PUBLIC_IP = environment.serverPublicIp;
|
||||||
|
export const GITEA_URL = environment.giteaUrl;
|
||||||
|
export const GITEA_HOST = new URL(GITEA_URL).hostname;
|
||||||
|
export const APP_DOMAIN_SUFFIX = environment.appDomainSuffix;
|
||||||
|
export const DEFAULT_SSH_PRESET = environment.defaultSshPreset;
|
||||||
|
|
||||||
27
src/frontend/test/environment.test.mjs
Normal file
27
src/frontend/test/environment.test.mjs
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
import assert from 'node:assert/strict';
|
||||||
|
import test from 'node:test';
|
||||||
|
|
||||||
|
import { getEnvironmentConfig } from '../src/utils/environment.js';
|
||||||
|
|
||||||
|
test('détecte le dashboard de recette depuis son domaine public', () => {
|
||||||
|
const config = getEnvironmentConfig('dashboard.recette.santinova-soft.org');
|
||||||
|
assert.equal(config.isRecette, true);
|
||||||
|
assert.equal(config.label, 'Recette');
|
||||||
|
assert.equal(config.serverPublicIp, '78.138.58.109');
|
||||||
|
assert.equal(config.giteaUrl, 'https://git.recette.santinova-soft.org');
|
||||||
|
assert.equal(config.appDomainSuffix, 'recette.santinova-soft.org');
|
||||||
|
});
|
||||||
|
|
||||||
|
test('détecte le dashboard de production depuis son domaine public', () => {
|
||||||
|
const config = getEnvironmentConfig('dashboard.santinova-soft.org');
|
||||||
|
assert.equal(config.isRecette, false);
|
||||||
|
assert.equal(config.label, 'Production');
|
||||||
|
assert.equal(config.serverPublicIp, '180.149.196.138');
|
||||||
|
assert.equal(config.giteaUrl, 'https://git.santinova-soft.org');
|
||||||
|
assert.equal(config.appDomainSuffix, 'santinova-soft.org');
|
||||||
|
});
|
||||||
|
|
||||||
|
test('utilise la recette pour le développement local', () => {
|
||||||
|
assert.equal(getEnvironmentConfig('localhost').isRecette, true);
|
||||||
|
assert.equal(getEnvironmentConfig('127.0.0.1').isRecette, true);
|
||||||
|
});
|
||||||
Reference in New Issue
Block a user