From 921a2eab8931ff6f8e049aef7daa72b1ebaf527c Mon Sep 17 00:00:00 2001 From: Francois Petit Date: Mon, 9 Mar 2026 08:50:10 +0100 Subject: [PATCH 1/5] chore: make with ai + packages - make all with ai module - fix vulnerable deps --- Makefile | 12 +++++------- package-lock.json | 14 +++++++------- package.json | 3 ++- 3 files changed, 14 insertions(+), 15 deletions(-) diff --git a/Makefile b/Makefile index 4c67379a..8d26101e 100644 --- a/Makefile +++ b/Makefile @@ -2,21 +2,19 @@ include make/config.mk # === Global === -all : volumes certs colima install build +all: volumes certs colima install + COMPOSE_PROFILES=ai $(D_COMPOSE) build + COMPOSE_PROFILES=ai $(D_COMPOSE) up -d + +no-ai : volumes certs colima install build $(D_COMPOSE) up -d dev: volumes certs colima install build-dev $(D_COMPOSE_DEV) up -d -ai: volumes certs colima - npm i - COMPOSE_PROFILES=ai $(D_COMPOSE) build - COMPOSE_PROFILES=ai $(D_COMPOSE) up -d - volumes: @mkdir -p $(DATABASE_PATH) $(UPLOADS_PATH) @chmod -R 777 $(VOLUMES_PATH) -# @docker run --rm -v $(VOLUMES_PATH):/tmp/v alpine sh -c "chown -R 1001:204 /tmp/v && chmod -R 775 /tmp/v" start : $(D_COMPOSE) start diff --git a/package-lock.json b/package-lock.json index 3daec1fa..4c2b3b2c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1880,9 +1880,9 @@ } }, "node_modules/@hono/node-server": { - "version": "1.19.9", - "resolved": "https://registry.npmjs.org/@hono/node-server/-/node-server-1.19.9.tgz", - "integrity": "sha512-vHL6w3ecZsky+8P5MD+eFfaGTyCeOHUIFYMGpQGbrBTSmNNoxv0if69rEZ5giu36weC5saFuznL411gRX7bJDw==", + "version": "1.19.10", + "resolved": "https://registry.npmjs.org/@hono/node-server/-/node-server-1.19.10.tgz", + "integrity": "sha512-hZ7nOssGqRgyV3FVVQdfi+U4q02uB23bpnYpdvNXkYTRRyWx84b7yf1ans+dnJ/7h41sGL3CeQTfO+ZGxuO+Iw==", "devOptional": true, "license": "MIT", "engines": { @@ -7473,9 +7473,9 @@ } }, "node_modules/flatted": { - "version": "3.3.4", - "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.3.4.tgz", - "integrity": "sha512-3+mMldrTAPdta5kjX2G2J7iX4zxtnwpdA8Tr2ZSjkyPSanvbZAcy6flmtnXbEybHrDcU9641lxrMfFuUxVz9vA==", + "version": "3.4.0", + "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.4.0.tgz", + "integrity": "sha512-kC6Bb+ooptOIvWj5B63EQWkF0FEnNjV2ZNkLMLZRDDduIiWeFF4iKnslwhiWxjAdbg4NzTNo6h0qLuvFrcx+Sw==", "license": "ISC" }, "node_modules/flubber": { @@ -9721,7 +9721,7 @@ "version": "0.5.2", "resolved": "https://registry.npmjs.org/magicast/-/magicast-0.5.2.tgz", "integrity": "sha512-E3ZJh4J3S9KfwdjZhe2afj6R9lGIN5Pher1pF39UGrXRqq/VDaGVIGN13BjHd2u8B61hArAGOnso7nBOouW3TQ==", - "devOptional": true, + "dev": true, "license": "MIT", "dependencies": { "@babel/parser": "^7.29.0", diff --git a/package.json b/package.json index 3fac590f..3e5168dc 100644 --- a/package.json +++ b/package.json @@ -74,6 +74,7 @@ }, "overrides": { "lodash": "4.17.23", - "hono": "^4.11.7" + "hono": "^4.11.7", + "@hono/node-server": "1.19.10" } } From f2135600f6178b3f6e83129be2fb99ab433da9e5 Mon Sep 17 00:00:00 2001 From: Francois Petit Date: Mon, 9 Mar 2026 08:50:31 +0100 Subject: [PATCH 2/5] chore: packahe.lock --- package-lock.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package-lock.json b/package-lock.json index 4c2b3b2c..202bb2bb 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9721,7 +9721,7 @@ "version": "0.5.2", "resolved": "https://registry.npmjs.org/magicast/-/magicast-0.5.2.tgz", "integrity": "sha512-E3ZJh4J3S9KfwdjZhe2afj6R9lGIN5Pher1pF39UGrXRqq/VDaGVIGN13BjHd2u8B61hArAGOnso7nBOouW3TQ==", - "dev": true, + "devOptional": true, "license": "MIT", "dependencies": { "@babel/parser": "^7.29.0", From 17cf890aa81f4a781ceb8ced35fb087380152d56 Mon Sep 17 00:00:00 2001 From: Francois Petit Date: Mon, 9 Mar 2026 09:09:29 +0100 Subject: [PATCH 3/5] fix(block): dockerfile - copy and prune --- srcs/blockchain/Dockerfile | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/srcs/blockchain/Dockerfile b/srcs/blockchain/Dockerfile index 25085ab5..18a01b78 100644 --- a/srcs/blockchain/Dockerfile +++ b/srcs/blockchain/Dockerfile @@ -43,8 +43,9 @@ RUN apk add --no-cache wget # 5) Installer UNIQUEMENT les dépendances runtime du workspace users COPY package-lock.json ./package-lock.json COPY srcs/blockchain/package.json ./package.json -# audit and fund are done in builder -RUN npm install --omit=dev --no-audit --no-fund + +COPY --from=builder /app/node_modules ./node_modules +RUN npm prune --omit=dev # 6) Injecter le package interne @transcendence/core (compilé) RUN mkdir -p node_modules/@transcendence From 910ed7e7c3d42c41e8431c03f9721c0204ae7332 Mon Sep 17 00:00:00 2001 From: Francois Petit Date: Mon, 9 Mar 2026 09:39:53 +0100 Subject: [PATCH 4/5] chore: makefile - adapt targets for ai --- Makefile | 40 ++++++++++++++++++++++++++-------------- make/config.mk | 1 + 2 files changed, 27 insertions(+), 14 deletions(-) diff --git a/Makefile b/Makefile index 8d26101e..45f421ad 100644 --- a/Makefile +++ b/Makefile @@ -3,10 +3,11 @@ include make/config.mk # === Global === all: volumes certs colima install - COMPOSE_PROFILES=ai $(D_COMPOSE) build - COMPOSE_PROFILES=ai $(D_COMPOSE) up -d + $(D_COMPOSE_AI) build + $(D_COMPOSE_AI) up -d -no-ai : volumes certs colima install build +no-ai : volumes certs colima install + $(D_COMPOSE) build $(D_COMPOSE) up -d dev: volumes certs colima install build-dev @@ -16,17 +17,26 @@ volumes: @mkdir -p $(DATABASE_PATH) $(UPLOADS_PATH) @chmod -R 777 $(VOLUMES_PATH) -start : - $(D_COMPOSE) start +start: + $(D_COMPOSE_AI) start +stop: + $(D_COMPOSE_AI) stop +down: + $(D_COMPOSE_AI) down + + start-dev : $(D_COMPOSE_DEV) start -stop : - $(D_COMPOSE) stop -down : - $(D_COMPOSE) down down-dev : $(D_COMPOSE_DEV) down +start-noai : + $(D_COMPOSE) start +stop-noai : + $(D_COMPOSE) stop +down-noai : + $(D_COMPOSE) down + # --- Env files --- envs: @echo "Creating .env files from examples…" @@ -137,7 +147,7 @@ pong-ai: COMPOSE_PROFILES=ai $(D_COMPOSE) up -d --build $(PONG_AI_SERVICE_NAME) build: - $(D_COMPOSE) build + $(D_COMPOSE_AI) build build-dev: $(D_COMPOSE_DEV) build @@ -230,11 +240,13 @@ user-migrate-reset-dev: $(D_COMPOSE_DEV) exec ${UM_SERVICE_NAME} npx prisma migrate reset logs: - $(D_COMPOSE) logs -f + $(D_COMPOSE_AI) logs -f # generic rule : replace % with service name logs-%: $(CONTAINER_CMD) logs -f $* +logs-ai: + $(D_COMPOSE_AI) logs -f $(PONG_AI_SERVICE_NAME) logs-nginx: $(CONTAINER_CMD) logs -f $(PROXY_SERVICE_NAME) logs-redis: @@ -264,7 +276,7 @@ show: # xargs -r won't launch next command list is empty clean: @echo "Stopping and removing containers…" - @$(CONTAINER_CMD) ps -q | xargs -r $(CONTAINER_CMD) stop + @@$(D_COMPOSE_AI) stop @$(CONTAINER_CMD) ps -aq | xargs -r $(CONTAINER_CMD) rm -f @echo "Pruning unused resources (SAFE)…" $(CONTAINER_CMD) system prune -f @@ -281,7 +293,7 @@ fclean: clean @echo "Volume folder cleaned (structure preserved)" re : fclean all -re-ai: fclean ai +re-noai: fclean no-ai redev : fclean dev clean-pack: @@ -309,7 +321,7 @@ endif endif rm -rf $(VOLUMES_PATH) -.PHONY : all dev ai re re-ai redev clean fclean reset-hard clean-pack \ +.PHONY : all dev no-ai re re-noai redev clean fclean reset-hard clean-pack \ volumes certs envs install build build-dev \ start start-dev stop down down-dev \ nginx nginx-nc nginx-dev nginx-reload redis \ diff --git a/make/config.mk b/make/config.mk index 50189056..a3c4d1c0 100644 --- a/make/config.mk +++ b/make/config.mk @@ -25,3 +25,4 @@ COMPOSE_CMD := docker compose # Automatically injecting HOST_VOLUME_PATH at each compose command D_COMPOSE := HOST_VOLUME_PATH=$(VOLUMES_PATH) $(COMPOSE_CMD) -f srcs/docker-compose.yml D_COMPOSE_DEV := HOST_VOLUME_PATH=$(VOLUMES_PATH) $(COMPOSE_CMD) -f srcs/dev-docker-compose.yml +D_COMPOSE_AI := COMPOSE_PROFILES=ai $(D_COMPOSE) \ No newline at end of file From 9cbc343d0b8f8a2b9663db53f120fa8d730ac83d Mon Sep 17 00:00:00 2001 From: Francois Petit Date: Mon, 9 Mar 2026 09:47:59 +0100 Subject: [PATCH 5/5] fix: typo --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 45f421ad..2e48ca76 100644 --- a/Makefile +++ b/Makefile @@ -276,7 +276,7 @@ show: # xargs -r won't launch next command list is empty clean: @echo "Stopping and removing containers…" - @@$(D_COMPOSE_AI) stop + @$(D_COMPOSE_AI) stop @$(CONTAINER_CMD) ps -aq | xargs -r $(CONTAINER_CMD) rm -f @echo "Pruning unused resources (SAFE)…" $(CONTAINER_CMD) system prune -f