diff --git a/scripts/configure-ocpi-everest.sh b/scripts/configure-ocpi-everest.sh new file mode 100644 index 0000000..c6bcdfe --- /dev/null +++ b/scripts/configure-ocpi-everest.sh @@ -0,0 +1,30 @@ +#!/usr/bin/env bash +# === Post-deploy OCPI + Everest configuration for Cariflex === +# Run this AFTER docker compose up succeeds + +set -e + +CSMS_URL="http://localhost:8081" +GRAPHQL_URL="http://localhost:8090/v1/graphql" +DB_CONTAINER="cariflex-citrineos-db" + +echo "=== Step 1: Seed OCPI database ===" +# Run inside the OCPI container to seed default tenant + emsp +docker exec cariflex-ocpi npm run seed-db 2>&1 || echo "Seed may have run before, continuing..." + +echo "=== Step 2: Verify Citiveness ===" +# Check CitrineOS Core is healthy +curl -sf "${CSMS_URL}/ocpp/health" && echo "CitrineOS Core: OK" || echo "CitrineOS Core: UNHEALTHY" + +echo "=== Step 3: Configure EVerest Manager OCPP target ===" +# The manager already points to ws://cariflex-citrineos-server:8080/cp001 via Dockerfile +# Check manager is running +docker ps --filter "name=cariflex-everest-manager" --format "{{.Status}}" && echo "Everest Manager: running" || echo "Everest Manager: NOT RUNNING" + +echo "=== Step 4: Verify UI connectivity ===" +echo " Everest NodeRED UI: http://localhost:1880/ui/" +echo " Everest OCPP Logs: http://localhost:8888" +echo " CitrineOS UI: https://citrineos.digitribe.fr" +echo " Hasura Console: https://hasura.digitribe.fr" +echo "" +echo "=== DONE ===" diff --git a/scripts/everest-cariflex-entrypoint.sh b/scripts/everest-cariflex-entrypoint.sh new file mode 100644 index 0000000..789b969 --- /dev/null +++ b/scripts/everest-cariflex-entrypoint.sh @@ -0,0 +1,30 @@ +#!/bin/bash +# Entrypoint personnalisé pour Everest Manager - Cariflex +# Configure l'OCPP CSMS URL puis lance le simulateur + +set -e + +CSMS_URL="${EVEREST_TARGET_URL:-ws://cariflex-citrineos-server:8080/cp001}" +echo "=== EVerest Manager - Cariflex ===" +echo "CSMS URL: $CSMS_URL" + +# Installer sqlite3 si nécessaire +apk add --no-cache sqlite3 2>/dev/null || true + +# Configurer l'OCPP CSMS URL dans la base de données +DB_PATH="/ext/source/build/dist/share/everest/modules/OCPP201/device_model_storage.db" +if [ -f "$DB_PATH" ]; then + echo "Configuring OCPP CSMS URL in device model DB..." + sqlite3 "$DB_PATH" "UPDATE VARIABLE_ATTRIBUTE SET value = '[{\"configurationSlot\": 1, \"connectionData\": {\"messageTimeout\": 30, \"ocppCsmsUrl\": \"$CSMS_URL\", \"ocppInterface\": \"Wired0\", \"ocppTransport\": \"JSON\", \"ocppVersion\": \"OCPP20\", \"securityProfile\": 1}}]' WHERE variable_Id IN (SELECT id FROM VARIABLE WHERE name = 'NetworkConnectionProfiles');" + echo "OCPP CSMS URL configured." +else + echo "WARNING: device_model_storage.db not found at $DB_PATH" +fi + +# Installer http-server pour les logs +npm i -g http-server 2>/dev/null || true + +# Lancer le simulateur OCPP 2.0.1 avec PNC (Plug & Charge) +echo "Starting EVerest OCPP 2.0.1 simulator..." +chmod +x /ext/source/build/run-scripts/run-sil-ocpp201-pnc.sh +exec /ext/source/build/run-scripts/run-sil-ocpp201-pnc.sh diff --git a/tools/citrineos-core-main/Dockerfile.ui b/tools/citrineos-core-main/Dockerfile.ui new file mode 100644 index 0000000..559daf7 --- /dev/null +++ b/tools/citrineos-core-main/Dockerfile.ui @@ -0,0 +1,12 @@ +FROM node:24.16.0-alpine +WORKDIR /app +ENV NODE_ENV=production +RUN addgroup --system --gid 1001 nodejs && adduser --system --uid 1001 nextjs +COPY --chown=nextjs:nodejs apps/operator-ui/.next/standalone ./ +COPY --chown=nextjs:nodejs apps/operator-ui/.next/static ./apps/operator-ui/.next/static +COPY --chown=nextjs:nodejs apps/operator-ui/public ./apps/operator-ui/public +USER nextjs +EXPOSE 3000 +ENV PORT=3000 +ENV HOSTNAME="0.0.0.0" +CMD ["node", "apps/operator-ui/server.js"]