Commit a1f30017 authored by Pinon Gregory's avatar Pinon Gregory 🦉
Browse files

latest modification in vain effort to make that project work

parent 720f3160
DB_URL=ignite
DB_URL=172.18.0.1
DB_USER=ignite
DB_PASSWORD=oemcs2
DEFAULT_USER=admin
DEFAULT_PASSWORD=admin
JWT_SECRET=D94AD7C66DA6FE86FD91D478DF2AC
\ No newline at end of file
JWT_SECRET=D94AD7C66DA6FE86FD91D478DF2AC
......@@ -7,7 +7,7 @@ let file;
if (process.env.CI_JOB_STAGE) {
file = "./ci.env";
} else {
file = "./.env";
file = "./test.env";
}
const envFound = require("dotenv").config({ path: file });
......
File mode changed from 100755 to 100644
DB_URL=172.17.0.1
DB_URL=oemc-ywc.fr:10800
DB_USER=ignite
DB_PASSWORD=oemcs2
DEFAULT_USER=admin
......
......@@ -12,7 +12,6 @@ services:
- "3000:3000"
depends_on:
- "db"
- "socket"
socket:
build: socket-position
......@@ -21,6 +20,7 @@ services:
- "3001:3001"
depends_on:
- "db"
- "backend"
frontend:
build: frontend-supervision
......@@ -37,6 +37,7 @@ services:
ports:
- "3002:3000"
depends_on:
- "backend"
- "socket"
proxy:
......@@ -59,7 +60,7 @@ services:
image: oemcywc/localisation
depends_on:
- "socket"
# TODO : Database feeder sur chaque Raspi (arguments env)
secrets :
......
version: "3.7"
services:
db:
image: oemcywc/database
ports:
- "10800:10800"
extra_hosts:
- "oemc-ywc.fr:172.18.0.1"
backend:
#build: backend-supervision
......@@ -12,7 +15,8 @@ services:
- "3000:3000"
depends_on:
- "db"
- "socket"
extra_hosts:
- "oemc-ywc.fr:172.18.0.1"
socket:
#build: socket-position
......@@ -21,7 +25,10 @@ services:
- "3001:3001"
depends_on:
- "db"
- "backend"
extra_hosts:
- "oemc-ywc.fr:172.18.0.1"
frontend:
#build: frontend-supervision
image: oemcywc/frontend
......@@ -30,6 +37,8 @@ services:
depends_on:
- "socket"
- "backend"
extra_hosts:
- "oemc-ywc.fr:172.18.0.1"
notification:
#build: notification-server
......@@ -38,6 +47,8 @@ services:
- "3002:3000"
depends_on:
- "socket"
extra_hosts:
- "oemc-ywc.fr:172.18.0.1"
proxy:
#build: proxy-supervision
......@@ -53,12 +64,20 @@ services:
depends_on:
- "backend"
- "frontend"
extra_hosts:
- "oemc-ywc.fr:172.18.0.1"
localisation:
#build: localisation-watchdog
image: oemcywc/localisation
depends_on:
- "socket"
extra_hosts:
- "oemc-ywc.fr:172.18.0.1"
# TODO : Database feeder sur chaque Raspi (arguments env)
......
......@@ -18,11 +18,27 @@ let sql_cache;
let position_cache;
async function setup() {
await igniteClient.connect(
new IgniteClientConfiguration("oemc-ywc.fr:10800") // "10.132.18.35:10800"
.setUserName("ignite")
.setPassword("oemcs2")
);
let success = false;
let i = 0;
for (i = 0; i < 5 && !success; i++) {
try {
await igniteClient.connect(
new IgniteClientConfiguration("oemc-ywc.fr:10800")
.setUserName("ignite")
.setPassword("oemcs2")
);
success = true;
} catch (e) {
await new Promise((r) => setTimeout(r, 2000));
logger.warn(
`Ignite connection not working - Attempt ${i + 1}/5 - ${e.message}`,
{
tag: "db",
}
);
}
}
position_cache = await igniteClient.getOrCreateCache("positions");
sql_cache = await igniteClient.getOrCreateCache(
......@@ -386,8 +402,6 @@ io.on("connection", function (socket) {
// let tmp = await resCursor.getValue();
// if (tmp) list.push(tmp[0]);
// } while (resCursor.hasMore());
list.push("Edwige Weber")
list.push("Edmund Freud")
socket.emit("fromserver", list);
});
......
......@@ -19,7 +19,7 @@ http {
keepalive_timeout 65;
#gzip on;
server {
server_name nginx;
listen 80;
......@@ -63,4 +63,4 @@ http {
proxy_set_header Connection "upgrade";
}
}
}
\ No newline at end of file
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment