déplacement .Keys et config

This commit is contained in:
Cyril Rouillon 2024-10-16 09:30:41 +02:00
parent 8e1261cfa7
commit 848fc4909e
11 changed files with 71 additions and 15 deletions

2
.gitignore vendored
View File

@ -1,10 +1,10 @@
backend/node_modules
backend/.Keys.js
client/.angular
client/node_modules
client/.vscode
.Keys.js
.vscode
data/
vendor/

View File

@ -40,5 +40,8 @@ GET http://localhost:3000/api/favorite/getAll
# Prod
git clone https://gitlab.cyro-technology.com/cyril/Jucundus
cd Jucundus
docker Compose up -d
npm run start
Dashboard Agendash
https://jucundus-api.saucisse.ninja/dash/

View File

@ -32,6 +32,6 @@
<body class="mat-app-background">
<app-root></app-root>
<script src="runtime.475575d3cc22a138.js" type="module"></script><script src="polyfills.febf6ea84d149d1b.js" type="module"></script><script src="main.5bb5111fcbed767e.js" type="module"></script></body>
<script src="runtime.475575d3cc22a138.js" type="module"></script><script src="polyfills.febf6ea84d149d1b.js" type="module"></script><script src="main.f88d7f0fb1b9344b.js" type="module"></script></body>
</html>

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1,10 +1,29 @@
server {
listen 80;
server_name jucundus.saucisse.ninja;
listen 80;
location / {
root /usr/share/nginx/html;
index index.html;
try_files $uri $uri/ /index.html;
}
gzip on;
gzip_http_version 1.1;
gzip_disable "MSIE [1-6]\.";
gzip_min_length 256;
gzip_vary on;
gzip_proxied expired no-cache no-store private auth;
gzip_types text/plain text/css application/json application/javascript application/x-javascript text/xml application/xml application/xml+rss text/javascript;
gzip_comp_level 9;
client_max_body_size 5M;
proxy_read_timeout 200s;
index index.html;
location / {
include /etc/nginx/mime.types;
root /usr/share/nginx/html;
add_header Cache-Control "public, max-age=1M";
try_files $uri $uri/ /index.html =404;
}
location /healthcheck {
access_log off;
add_header 'Content-Type' 'text/plain';
return 200 "Healthy\n";
}
}

View File

@ -4,5 +4,5 @@ export const environment = {
production: true,
logLevel: NgxLoggerLevel.OFF,
serverLogLevel: NgxLoggerLevel.ERROR,
ServeurURL: "https://jucundus.saucisse.ninja:3000/backend"
ServeurURL: "https://jucundus-api.saucisse.ninja"
};

29
config.js Normal file
View File

@ -0,0 +1,29 @@
const config = {
db: {
connectionString: "mongodb://db:27017",
dbName: "jucundus",
},
session: {
sessionCollection: "Session",
sessionConfig: {
name: "jucundus.sid",
cookie: {
maxAge: 1000 * 60 * 60 * 24 * 30, // 30 days
httpOnly: true, // only accessible by the server
secure: true,
},
resave: false, // don't save session if unmodified
saveUninitialized: true,
}
},
jwtOptions: {
issuer: "jucundus.com",
audience: "yoursite",
},
agent :{
ApiAgentURL: 'jucundus-agent1.saucisse.ninja/api',
token: '861v48gr4YTHJTUre0reg40g8e6r8r64eggv1r4e6g4r81PKREVJ8g6reg46r8eg416reST6ger84g14er86e',
}
};
module.exports = { config };

View File

@ -14,6 +14,8 @@ services:
working_dir: /backend
volumes:
- ./backend:/backend
- ./.Keys.js:/backend/.Keys.js
- ./config-dev.js:/backend/config.js
ports:
- "3000:3000"
- "9228:9229"

View File

@ -10,10 +10,14 @@ services:
- backend-network
backend:
image: node:20
image: node:20
restart: always
hostname: jucundus-api.saucisse.ninja
working_dir: /backend
volumes:
- ./backend:/backend
- ./.Keys.js:/backend/.Keys.js
- ./config.js:/backend/config.js
ports:
- "3000"
command: ["sh", "-c", "npm install && npm run start"]
@ -23,11 +27,10 @@ services:
- backend-network
labels:
- "traefik.enable=true"
- "traefik.http.routers.backend.rule=Host(`jucundus.saucisse.ninja`) && PathPrefix(`/backend`)"
- "traefik.http.routers.backend.rule=Host(`jucundus-api.saucisse.ninja`)"
- "traefik.http.routers.backend.entrypoints=websecure"
- "traefik.http.routers.backend.tls=true"
- "traefik.http.routers.backend.tls.certresolver=myresolver"
- "traefik.http.services.backend.loadbalancer.server.port=3000"
client:
image: nginx:latest