diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 36a1197..05c298f 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -19,6 +19,9 @@ jobs: with: node-version: 20 cache: yarn + - uses: actions/setup-python@v5 + with: + python-version: "3.14" - name: Install dependencies run: yarn install diff --git a/.github/workflows/migration-status.yml b/.github/workflows/migration-status.yml deleted file mode 100644 index 6fd4cb1..0000000 --- a/.github/workflows/migration-status.yml +++ /dev/null @@ -1,47 +0,0 @@ -name: Update Migration Status Dashboard - -on: - schedule: - # Run daily at 00:00 UTC - - cron: "0 0 * * *" - workflow_dispatch: - # Allow nethcti-server and nethcti-middleware to trigger this workflow - repository_dispatch: - types: [migration-status-update] - -permissions: - contents: write - -jobs: - generate: - name: Generate migration data - runs-on: ubuntu-latest - steps: - - name: Checkout nethvoice-docs - uses: actions/checkout@v4 - with: - fetch-depth: 0 - # Use the workflow token for the authenticated push at the end - token: ${{ secrets.GITHUB_TOKEN }} - - - name: Set up Python - uses: actions/setup-python@v5 - with: - python-version: "3.12" - - - name: Generate migration-data.json - run: | - python3 scripts/extract-migration-status.py - - - name: Commit and push updated data - run: | - git config user.name "github-actions[bot]" - git config user.email "github-actions[bot]@users.noreply.github.com" - git add static/migration-data.json - # Only commit and push if the file changed - if git diff --staged --quiet; then - echo "No changes to migration data, skipping commit." - else - git commit -m "chore: update migration status data" - git push - fi diff --git a/README.md b/README.md index 20396f9..4052c58 100644 --- a/README.md +++ b/README.md @@ -113,8 +113,8 @@ This command starts a local development server and opens up a browser window. Mo yarn build ``` -This command generates static content into the `build` directory and can be served using any static contents hosting service. +This command generates static content into the `build` directory and can be served using any static contents hosting service. It also refreshes the migration-status data through the Docusaurus plugin before the site is built. ### Deployment -Deployment is automated via GitHub Actions: every time changes are merged into the `main` branch, the site is rebuilt and deployed to [https://docs.nethvoice.com/](https://docs.nethvoice.com/). \ No newline at end of file +Deployment is automated via GitHub Actions: every time changes are merged into the `main` branch, the site is rebuilt and deployed to [https://docs.nethvoice.com/](https://docs.nethvoice.com/). diff --git a/docs/administrator-manual/provisioning/supported_trunks.md b/docs/administrator-manual/provisioning/supported_trunks.md index 9126ca4..6f47ae9 100644 --- a/docs/administrator-manual/provisioning/supported_trunks.md +++ b/docs/administrator-manual/provisioning/supported_trunks.md @@ -7,6 +7,7 @@ sidebar_position: 5 - `Active Network` - `Cheapnet` - `Clouditalia` +- `Enegan` - `MessageNet` - `MyNet (cloud1b.voicer.it)` - `Neomedia` diff --git a/docs/tutorial/api/cti.md b/docs/tutorial/api/cti.md index c555c02..3f56d8f 100644 --- a/docs/tutorial/api/cti.md +++ b/docs/tutorial/api/cti.md @@ -9,7 +9,10 @@ The CTI API provides programmatic access to the NethVoice CTI (Computer Telephon Legacy methods are also documented for reference, but migrating to the new methods is strongly recommended. New features and improvements are only available in the new API. -Full API specification is available at: [NethCTI Server full reference](https://documenter.getpostman.com/view/15699632/TzRRC88p#41f9b8cc-bea8-4917-a293-84eaedcaed08) · [NethCTI Middleware reference](https://bump.sh/nethesis/doc/nethcti-middleware/) +Full API specification is available at: +- [NethCTI Server full reference](https://documenter.getpostman.com/view/15699632/TzRRC88p#41f9b8cc-bea8-4917-a293-84eaedcaed08) +- [NethCTI Middleware reference](https://bump.sh/nethesis/doc/nethcti-middleware/) +- see also [API Migration Status dashboard](/migration-status) for an overview of which endpoints have already been migrated and which are still proxied to the legacy server. --- diff --git a/docs/tutorial/api/index.md b/docs/tutorial/api/index.md index 82d6a78..ce30057 100644 --- a/docs/tutorial/api/index.md +++ b/docs/tutorial/api/index.md @@ -16,6 +16,8 @@ Tutorials and guides for using these APIs can be found in the following sections API references and documentation for NethVoice-related services: - [CTI APIs full reference](https://documenter.getpostman.com/view/15699632/TzRRC88p#41f9b8cc-bea8-4917-a293-84eaedcaed08) interaction with the NethCTI Server that manages web-based telephony features. +- [NethCTI Middleware reference](https://bump.sh/nethesis/doc/nethcti-middleware/) for the NethCTI Middleware, which provides a simplified interface to the CTI Server and additional features. +- [API Migration Status dashboard](/migration-status) for an overview of which endpoints have already been migrated and which are still proxied to the legacy server. - [Tancredi provisioning](https://nethesis.github.io/tancredi/API) - Tancredi server is available for all NethVoice installations, the URL is: - `https://netvoice.your-domain.tld/tancredi/api/v1` for the APIs diff --git a/docusaurus.config.ts b/docusaurus.config.ts index 27e42bc..004b43b 100644 --- a/docusaurus.config.ts +++ b/docusaurus.config.ts @@ -31,6 +31,7 @@ const config: Config = { plugins: [ './plugins/docusaurus-plugin-generate-trunks', + './plugins/docusaurus-plugin-generate-migration-status', ], scripts: [ diff --git a/i18n/it/docusaurus-plugin-content-docs/current/administrator-manual/provisioning/supported_trunks.md b/i18n/it/docusaurus-plugin-content-docs/current/administrator-manual/provisioning/supported_trunks.md index 6f4d5cc..787fa00 100644 --- a/i18n/it/docusaurus-plugin-content-docs/current/administrator-manual/provisioning/supported_trunks.md +++ b/i18n/it/docusaurus-plugin-content-docs/current/administrator-manual/provisioning/supported_trunks.md @@ -6,6 +6,7 @@ title: Trunk VoIP supportati - `Active Network` - `Cheapnet` - `Clouditalia` +- `Enegan` - `MessageNet` - `MyNet (cloud1b.voicer.it)` - `Neomedia` @@ -28,4 +29,4 @@ title: Trunk VoIP supportati - `Xera` - `XSTREAM` -Questo documento è stato generato automaticamente dal [codice sorgente](https://raw.githubusercontent.com/nethesis/ns8-nethvoice/main/mariadb/docker-entrypoint-initdb.d/50_asterisk.providers.sql). +Questo documento è stato generato automaticamente dal [codice sorgente](https://raw.githubusercontent.com/nethesis/ns8-nethvoice/main/mariadb/docker-entrypoint-initdb.d/50_asterisk.providers.sql). \ No newline at end of file diff --git a/i18n/it/docusaurus-plugin-content-docs/current/tutorial/api/cti.md b/i18n/it/docusaurus-plugin-content-docs/current/tutorial/api/cti.md index 5cce0c9..c9f6f9a 100644 --- a/i18n/it/docusaurus-plugin-content-docs/current/tutorial/api/cti.md +++ b/i18n/it/docusaurus-plugin-content-docs/current/tutorial/api/cti.md @@ -9,7 +9,10 @@ L'API CTI fornisce accesso programmatico alle funzionalità CTI (Computer Teleph I metodi legacy sono documentati per riferimento, ma è fortemente consigliato eseguire la migrazione ai nuovi metodi. Le nuove funzionalità e i miglioramenti sono disponibili solo nella nuova API. -Le specifiche complete sono disponibili qui: [NethCTI Server full reference](https://documenter.getpostman.com/view/15699632/TzRRC88p#41f9b8cc-bea8-4917-a293-84eaedcaed08) +La specifica completa dell'API è disponibile su: +- [NethCTI Server full reference](https://documenter.getpostman.com/view/15699632/TzRRC88p#41f9b8cc-bea8-4917-a293-84eaedcaed08) +- [NethCTI Middleware reference](https://bump.sh/nethesis/doc/nethcti-middleware/) +- consulta anche [API Migration Status dashboard](/migration-status) per una panoramica degli endpoint già migrati e di quelli ancora inoltrati al server legacy. --- @@ -297,5 +300,4 @@ Per eseguire la migrazione dall'autenticazione legacy al nuovo metodo basato su 2. **Aggiornare il formato del token**: Sostituire `username:token_hex` con `Bearer ` 3. **Aggiornare il percorso WebSocket**: Cambiare da `/socket.io/` a `/api/ws/` 4. **Adattare gli header**: Utilizzare `Authorization: Bearer ` invece di `Authorization: username:token` -5. **Gestire la scadenza JWT**: Monitorare il campo `expire` del token e aggiornare secondo necessità - +5. **Gestire la scadenza JWT**: Monitorare il campo `expire` del token e aggiornare secondo necessità \ No newline at end of file diff --git a/i18n/it/docusaurus-plugin-content-docs/current/tutorial/api/index.md b/i18n/it/docusaurus-plugin-content-docs/current/tutorial/api/index.md index 1430412..33219c1 100644 --- a/i18n/it/docusaurus-plugin-content-docs/current/tutorial/api/index.md +++ b/i18n/it/docusaurus-plugin-content-docs/current/tutorial/api/index.md @@ -15,9 +15,10 @@ I tutorial e le guide per l'utilizzo di queste API sono disponibili nelle seguen Riferimenti e documentazione delle API per i servizi correlati a NethVoice: - [Riferimento completo API CTI](https://documenter.getpostman.com/view/15699632/TzRRC88p#41f9b8cc-bea8-4917-a293-84eaedcaed08) interazione con il server NethCTI che gestisce le funzionalità di telefonia web. +- [Riferimento NethCTI Middleware](https://bump.sh/nethesis/doc/nethcti-middleware/) per il NethCTI Middleware, che fornisce un'interfaccia semplificata al server CTI e funzionalità aggiuntive. +- [Dashboard dello stato di migrazione delle API](/migration-status) per una panoramica degli endpoint già migrati e di quelli ancora reindirizzati al server legacy. - [Provisioning Tancredi](https://nethesis.github.io/tancredi/API) - Il server Tancredi è disponibile per tutte le installazioni NethVoice, l'URL è: - `https://netvoice.tuo-dominio.tld/tancredi/api/v1` per le API - `https://netvoice.tuo-dominio.tld/privisioning//` per i file di configurazione utilizzati dai dispositivi -- [Configurazione (wizard)](https://bump.sh/nethvoice/hub/nethvoice/doc/wizard/) - +- [Configurazione (wizard)](https://bump.sh/nethvoice/hub/nethvoice/doc/wizard/) \ No newline at end of file diff --git a/plugins/docusaurus-plugin-generate-migration-status/index.js b/plugins/docusaurus-plugin-generate-migration-status/index.js new file mode 100644 index 0000000..f961bd8 --- /dev/null +++ b/plugins/docusaurus-plugin-generate-migration-status/index.js @@ -0,0 +1,43 @@ +const fs = require('fs'); +const path = require('path'); +const { spawnSync } = require('child_process'); + +let migrationStatusGenerated = false; + +function runMigrationStatusExtractor(siteDir) { + const scriptPath = path.join(siteDir, 'scripts', 'extract-migration-status.py'); + + if (!fs.existsSync(scriptPath)) { + throw new Error(`Migration status extractor not found: ${scriptPath}`); + } + + console.log('[generate-migration-status] Running scripts/extract-migration-status.py'); + const result = spawnSync('python3', [scriptPath], { + cwd: siteDir, + stdio: 'inherit', + }); + + if (result.error) { + throw result.error; + } + + if (result.status !== 0) { + throw new Error( + `[generate-migration-status] scripts/extract-migration-status.py exited with code ${result.status ?? 'unknown'}` + ); + } +} + +module.exports = function generateMigrationStatusPlugin(context) { + return { + name: 'docusaurus-plugin-generate-migration-status', + async loadContent() { + if (migrationStatusGenerated) { + return null; + } + migrationStatusGenerated = true; + runMigrationStatusExtractor(context.siteDir); + return null; + }, + }; +}; diff --git a/scripts/README.md b/scripts/README.md index 0c9c60f..9d5d131 100644 --- a/scripts/README.md +++ b/scripts/README.md @@ -8,6 +8,8 @@ This directory contains utility scripts for managing the NethVoice documentation The script fetches `nethcti-server` and `nethcti-middleware` from GitHub (shallow clone) and produces `static/migration-data.json`, read by the migration status dashboard page. +The Docusaurus build runs this extractor automatically through a plugin, so manual +invocation is only needed when refreshing the file outside a site build. Default usage — always fetches the production reference branches (`ns8` for `nethcti-server`, `main` for `nethcti-middleware`):