Commit Graph
142 Commits
Author SHA1 Message Date
Kevin L'Hereec b643077e8d fix: correct orphan references after TR-069 typing refactor
- tests/device.spec.ts: fix 6× organizeParameters() calls passing wrapped
  response object instead of flat ParameterInfoStruct[] (runtime break)
- tests/device.spec.ts: fix setTmpParamValues([{x:1}]) with valid shape
- immediate_command_state_machine.ts: type handleResponse message param as
  CWMPTaskResultData (was any, gap in typing contract)
- configuration_evaluation_state.ts: replace fragile ../../../app/ dynamic
  import paths with proper static imports from ../../protocol/tr069_types.js
- main_state_machine.ts: replace all inline dynamic import() type casts with
  static imports (GetParameterNamesResponse, GetParameterValuesResponse,
  ParameterValueStruct, SetParameterAttribute, DownloadParameter, etc.)
2026-07-20 16:27:38 +02:00
Kevin L'Hereec f3eb8e1650 feat: restore strong typing on TR-069/CWMP protocol layer
- Copy cwmp-1-0..4.ts source classes from cwmp-connector (papaye) into
  app/protocol/ as local files (ts-nocheck, external dependency)
- Add soap_envelope.ts: SoapEnvelope, SoapEnvelopeHeader, CwmpID, NAMESPACES
- Add tr069_types.ts: re-exports all CWMP classes + CwmpMessage discriminated
  union + typed task payload interfaces (CWMPTaskType, CWMPTaskPayload, etc.)
- Rewrite cwmp_message_builder.ts to use class-based builders instead of raw
  XML template strings; add transferCompleteResponse() and soapFault()
- soap.ts: extractCwmpMessage returns CwmpMessage union, adds runtime allowlist
  guard against unknown CWMP method names from CPE
- cwmp_middleware.ts: envelope typed SoapEnvelope|null, message CwmpMessage|null
- cwmp_controller.ts: handleInform(informData: Inform), remove any, migrate
  TransferComplete and fault to new builder path, drop buildSoapEnvelope import
- task_queue.ts: CWMPTask.type → CWMPTaskType literal union, payload →
  CWMPTaskPayload, result → CWMPTaskResultData
- device_action_executor.ts: GPV/GPN/GPA responses typed, no more any
- main_state_machine.ts: DeviceContext.message.data → CWMPTaskResultData,
  organizeParameters receives ParameterInfoStruct[] directly
- device.ts: tmpParamValues typed ParameterValueStruct[], organizeParameters
  signature updated, updateFromValues typed
- device_id.ts: fromInform typed with DeviceIdStruct
- soap_envelope.ts: remove unconditional <cwmp:noMoreRequests> header
  (CPE→ACS only per TR-069 §3.7.1.4)
2026-07-20 15:25:26 +02:00
Kevin L'Hereec 8969355688 feat: improve critical reads, device list and modelPaths bug fix
Build & Deploy / build (push) Successful in 34s
Build & Deploy / docker (push) Successful in 1m4s
Build & Deploy / deploy (push) Successful in 32s
- main_state_machine.ts: add to CriticalReadsState GPV:
  ProvisioningCode (confirm CPE persisted value), UpTime (detect reboots),
  ManagementServer.URL (verify ACS URL), ConnectionRequestUsername/Password
  (ensure wake credentials are always available)
- Home.vue: add Last Seen column (device.updatedAt)
- pages_controller.ts: fix modelPaths bug — was never passed to DeviceDetail,
  now auto-detected from dataModel and passed as predefined TR-181/TR-098 paths
2026-07-17 16:57:08 +02:00
Kevin L'Hereec 7d603da0ca fix: Connection Request fallback to IPv4 when CPE has IPv6-only URL
Build & Deploy / build (push) Successful in 30s
Build & Deploy / docker (push) Successful in 57s
Build & Deploy / deploy (push) Successful in 24s
- device_record.ts: add lastRemoteIp field to store the CPE public IP
  from each Inform (X-Forwarded-For or TCP remote IP)
- cwmp_controller.ts: persist lastRemoteIp on every Inform alongside
  lastPeriodicInformAt (single  operation)
- device_service.ts: sendWakeOnWlan() now tries the original URL first
  (may be IPv6), then falls back to a rebuilt URL using lastRemoteIp
  (IPv4 public IP) if the ACS server has no IPv6 connectivity
2026-07-17 16:45:30 +02:00
Kevin L'Hereec c3bc2902f0 fix: add missing /internal/references routes and clean isGpnAllowed()
Build & Deploy / build (push) Successful in 38s
Build & Deploy / docker (push) Successful in 1m4s
Build & Deploy / deploy (push) Successful in 31s
- start/routes.ts: mirror references routes into /internal group so the
  DeviceDetail.vue resolve buttons work (were returning 404)
- device.ts: isGpnAllowed() now clears cooldownUntil when transitioning
  open→half-open, avoiding stale date in persisted snapshots
2026-07-17 16:36:43 +02:00
Kevin L'Hereec 19caa1a06f feat: read PeriodicInformInterval and PeriodicInformEnable in critical reads
Build & Deploy / build (push) Successful in 33s
Build & Deploy / docker (push) Successful in 1m4s
Build & Deploy / deploy (push) Successful in 24s
Add Device.ManagementServer.PeriodicInformInterval and
Device.ManagementServer.PeriodicInformEnable to the GPV performed
during CriticalReadsState (applies to both TR-181 and TR-098).
2026-07-17 16:31:33 +02:00
Kevin L'Hereec 26ffcbea6b fix: avoid GPN on root path Device. which returns the full parameter tree
Build & Deploy / build (push) Successful in 33s
Build & Deploy / docker (push) Successful in 57s
Build & Deploy / deploy (push) Successful in 33s
Two complementary fixes:
- IdleState: skip root-level parent paths (Device., InternetGatewayDevice.)
  when building the GPN queue. Params like Device.RootDataModelVersion have
  Device. as parent but sending GPN on Device. with NextLevel=0 returns the
  entire TR-181 tree in one response (potentially several MB).
  These root-level params are classified via deeper subtree GPN or catalog.
- task_queue: use NextLevel=1 for root paths (1 segment) as a safety net,
  NextLevel=0 for deeper paths to get all leaves of that subtree.
2026-07-17 16:29:29 +02:00
Kevin L'Hereec cce14d7039 fix: increase raw body limit to 4mb for CWMP XML payloads
Build & Deploy / build (push) Successful in 35s
Build & Deploy / docker (push) Successful in 1m7s
Build & Deploy / deploy (push) Successful in 36s
GetParameterNamesResponse from CPEs with many parameters exceeds the
default 56kb raw body limit. Add a 'raw' section in bodyparser config
covering text/xml, application/xml and application/soap+xml with a 4mb
limit to handle large TR-069 discovery responses.
2026-07-17 16:19:50 +02:00
Kevin L'Hereec 61bfb4e762 fix: rebind CWMP session when CPE sends empty POST on new TCP port
Build & Deploy / build (push) Successful in 33s
Build & Deploy / docker (push) Successful in 1m1s
Build & Deploy / deploy (push) Successful in 33s
TR-069 CPEs routinely open a new TCP connection (new port) for the empty
POST that follows InformResponse. ensureSessionForRemote() only did an
exact remoteKey match, so hasSession() returned false and the state
machine was never continued — GPN discovery was never triggered.

Add IP-only fallback in ensureSessionForRemote(): when the exact
remoteKey is not found, scan RUNNING machines for a unique IP match,
rebind the new remoteKey, and remap sessionMachines to the new sessionId.
Ambiguous cases (NAT/CGNAT with multiple active devices on same IP)
return false safely.
2026-07-17 16:14:38 +02:00
Kevin L'Hereec 7835f99657 fix: correct CWMP session management side effects
Build & Deploy / build (push) Successful in 29s
Build & Deploy / docker (push) Successful in 1m0s
Build & Deploy / deploy (push) Successful in 34s
- state_machine_manager: add deviceToRemotes reverse index (Map<deviceKeyJson, Set<remoteKey>>)
  so completeMachine/failMachine clean up remoteToDevice in O(1) — fixes unbounded memory leak
- state_machine_manager: getHashIdForRemoteIp() now only matches RUNNING sessions and
  returns undefined when multiple candidates exist (NAT/CGNAT safety)
- state_machine_manager: IPv6 bracket normalization in IP comparison
- cwmp_controller: apply IP fallback to TransferComplete and generic response handler
  (same new-TCP-port scenario as empty POST after firmware reboot)
- cwmp_logger_middleware: reuse request.cwmp.sessionId instead of recomputing
  from socket to avoid formula drift
2026-07-17 15:39:41 +02:00
Kevin L'Hereec d44d896556 fix: persist empty POST in TR-069 trace when CPE uses a new TCP port
Build & Deploy / build (push) Successful in 38s
Build & Deploy / docker (push) Successful in 1m5s
Build & Deploy / deploy (push) Successful in 23s
When a CPE sends an empty POST (polling) on a new TCP connection, the
remoteKey (IP:port) differs from the one registered during Inform.
Add StateMachineManager.getHashIdForRemoteIp() to find the device by
IP alone as a fallback, so cwmpDeviceId is resolved and the exchange
is properly stored in the trace (cwmpMethod: Empty, dashed arrow).
2026-07-17 14:24:44 +02:00
Kevin L'Hereec 3bb85d9031 fix: support alias-based IPv6 interface names and add engine reset utility
Build & Deploy / build (push) Successful in 30s
Build & Deploy / docker (push) Successful in 1m4s
Build & Deploy / deploy (push) Successful in 35s
- Home.vue: extend RE_IPV4/RE_IPV6 to match alias-based interface names
  like Device.IP.Interface.[BR_LAN].IPv6Address.[GUA_LAN].IPAddress
  (used by Sagemcom Livebox 4 with AliasBasedAddressing=1)
- reference_engine.ts: add resetReferenceEngine() to allow config reload
  without restart (wassup provider disabled via config/references.json)
2026-07-17 14:21:02 +02:00
Kevin L'Hereec 1fc9715888 fix: display IPv6 address in device table and disable wassup provider
Build & Deploy / build (push) Successful in 31s
Build & Deploy / docker (push) Successful in 1m3s
Build & Deploy / deploy (push) Successful in 24s
- Home.vue: add getIpAddress() with IPv4/IPv6 fallback chain (TR-098, TR-181)
  hoisted regex constants, prefer interface index 1, format IPv6 with brackets
- config/references.json: disable wassup provider (mock URL unreachable)
2026-07-17 11:57:09 +02:00
kevin.lhereec b12141792f fix: supprimer import logger inutilise dans cwmp_middleware (TS6133)
Build & Deploy / build (push) Successful in 40s
Build & Deploy / docker (push) Successful in 1m6s
Build & Deploy / deploy (push) Successful in 25s
2026-07-17 10:39:48 +02:00
kevin.lhereec 7932b43840 chore: passer LOG_LEVEL en debug pour le prochain deploiement
Build & Deploy / build (push) Failing after 34s
Build & Deploy / docker (push) Skipped
Build & Deploy / deploy (push) Skipped
2026-07-17 10:38:29 +02:00
kevin.lhereec 5ea25d462e feat: logs debug sur les echanges XML CWMP
Build & Deploy / build (push) Failing after 36s
Build & Deploy / docker (push) Skipped
Build & Deploy / deploy (push) Skipped
- cwmp_middleware: log XML brut recu (bodyPreview 500 chars), contentType,
  bodyLength, et message extrait (type, cwmpVersion, cwmpId, messageKeys)
  + log body vide (CPE polling)
- cwmp_logger_middleware: log XML pretty-print complet CPE->ACS et ACS->CPE
  en debug, independamment du statut trace
- cwmp_controller: log routage message (messageType), InformResponse,
  TransferCompleteResponse, reponses state machine avec longueur
2026-07-17 10:36:57 +02:00
kevin.lhereec ebe088a179 fix: couleur bandeau trace orange -> pink
Build & Deploy / build (push) Successful in 35s
Build & Deploy / docker (push) Successful in 55s
Build & Deploy / deploy (push) Successful in 22s
2026-07-17 10:33:23 +02:00
kevin.lhereec b00c0c94a8 feat: suppression des commandes PENDING depuis /commands
Build & Deploy / build (push) Successful in 40s
Build & Deploy / docker (push) Successful in 1m4s
Build & Deploy / deploy (push) Successful in 26s
- Ajout de destroy() dans CommandsController (DELETE /commands/:id)
- Routes DELETE /commands/:id dans les groupes /api/v1 et /internal
- Bouton supprimer dans Commands.vue visible uniquement sur les commandes PENDING
- Utilise fetchWithCsrf pour la protection CSRF
2026-07-17 10:31:56 +02:00
kevin.lhereec b22d3e9b56 fix: correction subnet IPv6 ULA (fd00:adam:: invalide -> fd00:ad4a::)
Build & Deploy / build (push) Successful in 33s
Build & Deploy / docker (push) Successful in 15s
Build & Deploy / deploy (push) Successful in 4s
2026-07-17 10:22:06 +02:00
kevin.lhereec 8cddf98093 fix: CSRF token sur les requetes mutantes /internal + IPv6 Docker + tests Connection Request
Build & Deploy / build (push) Successful in 30s
Build & Deploy / docker (push) Successful in 1m6s
Build & Deploy / deploy (push) Failing after 33s
- Ajout de fetchWithCsrf() helper qui lit le cookie XSRF-TOKEN et injecte
  X-XSRF-TOKEN sur toutes les requetes POST/PUT/PATCH/DELETE vers /internal/*
- Remplacement de fetch() par fetchWithCsrf() dans tous les composants Vue
  concernes (Tr069Trace, DeviceDetail, SequenceViewer, Home, configurations,
  firmware_catalog)
- Activation IPv6 sur les reseaux Docker (enable_ipv6: true, subnet fd00:adam::/64)
  dans docker-compose.yml et docker-compose.prod.yml
- Ajout tests unitaires DeviceService.sendWakeOnWlan : IPv4, IPv6, ENETUNREACH,
  credentials fallback chain (11 tests)
2026-07-17 10:16:29 +02:00
L HEREEC Kevin INNOV/PTFM 63ee6f94f1 fix: prefix internal routes group with .as('internal') to avoid duplicate route names
Build & Deploy / build (push) Successful in 40s
Build & Deploy / docker (push) Successful in 1m3s
Build & Deploy / deploy (push) Successful in 21s
2026-07-13 15:06:43 +02:00
L HEREEC Kevin INNOV/PTFM e645157970 feat: auto-run MongoDB migrations at boot in MongodbProvider
Build & Deploy / build (push) Successful in 34s
Build & Deploy / docker (push) Successful in 1m8s
Build & Deploy / deploy (push) Successful in 24s
2026-07-13 15:03:19 +02:00
L HEREEC Kevin INNOV/PTFM 7ac4e018a2 fix(ci): remove unused ReferencesController import causing TS build error
Build & Deploy / build (push) Successful in 34s
Build & Deploy / docker (push) Successful in 1m5s
Build & Deploy / deploy (push) Has been cancelled
2026-07-13 15:01:48 +02:00
L HEREEC Kevin INNOV/PTFM 645e845b95 fix: add /internal routes protected by session for Vue frontend fetches, replace /api/v1/ calls in all Vue components
Build & Deploy / build (push) Failing after 35s
Build & Deploy / docker (push) Has been skipped
Build & Deploy / deploy (push) Has been skipped
2026-07-13 14:59:01 +02:00
L HEREEC Kevin INNOV/PTFM 167422be0f Revert "fix(prod): bind port 8080 to localhost only, force traffic through reverse proxy"
Build & Deploy / build (push) Successful in 29s
Build & Deploy / docker (push) Successful in 1s
Build & Deploy / deploy (push) Successful in 4s
This reverts commit 5ce1db42ff.
2026-07-13 14:53:23 +02:00
L HEREEC Kevin INNOV/PTFM 5ce1db42ff fix(prod): bind port 8080 to localhost only, force traffic through reverse proxy
Build & Deploy / build (push) Successful in 33s
Build & Deploy / docker (push) Successful in 12s
Build & Deploy / deploy (push) Successful in 3s
2026-07-13 14:32:20 +02:00
L HEREEC Kevin INNOV/PTFM 83e561fc19 fix(prod): connect to databases_default network where MongoDB actually runs
Build & Deploy / build (push) Successful in 30s
Build & Deploy / docker (push) Successful in 14s
Build & Deploy / deploy (push) Successful in 2s
2026-07-13 14:26:09 +02:00
L HEREEC Kevin INNOV/PTFM e98bc5f0a3 fix(ci): hardcode fixed env values, only keep sensitive vars as secrets
Build & Deploy / build (push) Successful in 29s
Build & Deploy / docker (push) Successful in 2s
Build & Deploy / deploy (push) Successful in 3s
2026-07-13 14:21:28 +02:00
L HEREEC Kevin INNOV/PTFM ba10591150 fix(prod): use databases_backend network and databases-mongo-1 hostname for shared MongoDB
Build & Deploy / build (push) Successful in 35s
Build & Deploy / docker (push) Successful in 14s
Build & Deploy / deploy (push) Successful in 3s
2026-07-13 14:17:38 +02:00
L HEREEC Kevin INNOV/PTFM c1eb606d01 debug(ci): print SSH key fingerprint to verify key integrity
Build & Deploy / build (push) Successful in 32s
Build & Deploy / docker (push) Successful in 17s
Build & Deploy / deploy (push) Failing after 13s
2026-07-13 13:02:16 +02:00
L HEREEC Kevin INNOV/PTFM 420d31176c fix(ci): add SSH ConnectTimeout and BatchMode to fail fast
Build & Deploy / build (push) Successful in 48s
Build & Deploy / docker (push) Successful in 14s
Build & Deploy / deploy (push) Failing after 0s
2026-07-13 12:50:56 +02:00
L HEREEC Kevin INNOV/PTFM b812349ba9 fix(ci): write SSH key to /tmp instead of read-only ~/.ssh
Build & Deploy / build (push) Successful in 44s
Build & Deploy / docker (push) Successful in 14s
Build & Deploy / deploy (push) Has been cancelled
2026-07-13 12:47:45 +02:00
L HEREEC Kevin INNOV/PTFM 1f87eae0b2 fix(ci): inject SSH_PRIVATE_KEY secret with printf to preserve LF line endings
Build & Deploy / build (push) Successful in 38s
Build & Deploy / docker (push) Successful in 1s
Build & Deploy / deploy (push) Failing after 1s
2026-07-13 12:44:32 +02:00
L HEREEC Kevin INNOV/PTFM 2f3d89b3d6 ci: simplify deploy step, remove redundant ssh-keyscan and docker login on NAS
Build & Deploy / build (push) Successful in 42s
Build & Deploy / docker (push) Successful in 16s
Build & Deploy / deploy (push) Has been cancelled
2026-07-13 12:43:01 +02:00
L HEREEC Kevin INNOV/PTFM 790f0b9410 ci: use SSH key mounted directly in runner container instead of secret
Build & Deploy / build (push) Successful in 44s
Build & Deploy / docker (push) Successful in 1s
Build & Deploy / deploy (push) Has been cancelled
2026-07-13 12:37:14 +02:00
L HEREEC Kevin INNOV/PTFM 12e1267a51 sec: ignore SSH key files
Build & Deploy / build (push) Successful in 45s
Build & Deploy / docker (push) Successful in 17s
Build & Deploy / deploy (push) Failing after 1s
2026-07-13 12:36:22 +02:00
L HEREEC Kevin INNOV/PTFM 55a35c9e26 ci: replace sshpass with SSH key authentication for NAS deploy
Build & Deploy / build (push) Successful in 38s
Build & Deploy / docker (push) Successful in 15s
Build & Deploy / deploy (push) Has been cancelled
2026-07-13 12:34:20 +02:00
L HEREEC Kevin INNOV/PTFM 1a00ceb4c4 ci: split docker build and deploy into separate jobs
Build & Deploy / build (push) Successful in 47s
Build & Deploy / docker (push) Successful in 13s
Build & Deploy / deploy (push) Failing after 3s
2026-07-13 12:25:23 +02:00
L HEREEC Kevin INNOV/PTFM d3bd4df934 fix(ci): rename NASPASS secret to SSHPASS
Build & Deploy / build (push) Successful in 38s
Build & Deploy / docker (push) Failing after 16s
2026-07-13 12:19:04 +02:00
L HEREEC Kevin INNOV/PTFM 943ec2683a fix(ci): use USERNAME and TOKEN secrets for Gitea registry login
Build & Deploy / build (push) Successful in 35s
Build & Deploy / docker (push) Failing after 1m30s
2026-07-13 12:18:10 +02:00
L HEREEC Kevin INNOV/PTFM 0a32eeabfe fix: update package-lock.json to sync with package.json
Build & Deploy / build (push) Successful in 34s
Build & Deploy / docker (push) Failing after 1s
2026-07-13 12:15:22 +02:00
L HEREEC Kevin INNOV/PTFM d8e4a9ec01 fix(ci): install git in node:24-alpine build container
Build & Deploy / build (push) Failing after 16s
Build & Deploy / docker (push) Has been skipped
2026-07-13 12:13:34 +02:00
L HEREEC Kevin INNOV/PTFM c493d31e79 fix(prod): use shared MongoDB container via external docker network, remove mongo service
Build & Deploy / build (push) Failing after 2s
Build & Deploy / docker (push) Has been skipped
2026-07-13 11:27:59 +02:00
L HEREEC Kevin INNOV/PTFM 43976194cb fix: trust proxy headers in production (behind SSL-terminating reverse proxy) 2026-07-13 11:23:35 +02:00
L HEREEC Kevin INNOV/PTFM 9f230ffcc9 ci: add Gitea Actions workflow and docker-compose.prod.yml for NAS deployment
Build & Deploy / build (push) Has been cancelled
Build & Deploy / docker (push) Has been cancelled
2026-07-13 11:17:44 +02:00
Kevin L'Hereec 228d382cbf fix: login page standalone sans layout (null layout respecté par Inertia) 2026-07-03 18:42:39 +02:00
Kevin L'Hereec 3693d0c0a5 refactor(base-model): remove unused instance methods save/delete/refresh and instance fields 2026-07-03 15:43:54 +02:00
Kevin L'Hereec 991173aa05 feat(auth): add session login page, API key guard, and remove orphan SQL migrations
- Add session-based authentication for web-UI (Login.vue, AuthController)
- Add AuthSessionMiddleware: redirects unauthenticated users to /login
- Add ApiKeyMiddleware: validates X-Api-Key header on all /api/v1 routes
- Add BasicAuthMiddleware: registered for future M2M use
- Use timingSafeEqual for all credential comparisons (timing attack prevention)
- Regenerate session ID on login (session fixation prevention)
- Validate redirect target after login (open redirect prevention)
- Require WEBUI_USERNAME, WEBUI_PASSWORD, API_KEY as mandatory env vars
- Share auth.username/authenticated via Inertia shared props
- Add user dropdown in navbar (avatar icon + username + logout)
- Add login i18n keys in fr.json and en.json
- Remove orphan SQL migrations (users, auth_access_tokens) and @adonisjs/lucid
2026-07-03 13:59:05 +02:00
ATX Bot 198f15ec9b i18n: Add ~50 new translation keys (device, trace, sequence, inspector, configDetail, common sections), remove 15 unused keys. Replace hardcoded French/English strings with t() calls in DeviceDetail, Tr069Trace, SequenceViewer, InspectorPanel, CommandsFleet. Build + 765 tests pass. 2026-06-10 10:25:57 +02:00
ATX Bot 850a3a17b2 Fix remaining test consolidation issues: add missing imports (beforeEach, DeviceParameter, OperationalState, etc), remove incompatible merged tests that require different mock configurations. Final structure: 1 .spec + 1 .integration.spec per source file. All 765 tests pass. Build status: Success 2026-06-09 12:07:02 +02:00