diff --git a/.env.sample b/.env.sample index 8f85e45f..8c3990fc 100644 --- a/.env.sample +++ b/.env.sample @@ -1,10 +1,10 @@ # MongoDB -MONGODB_URI=${MONGODB_URI:-mongodb://api:password@localhost:27017/agile-live-gui} +MONGODB_URI=${MONGODB_URI:-mongodb://api:password@localhost:27017/live-gui} -# AgileLive System Controlleer -AGILE_URL=${AGILE_URL:-https://localhost:8080} -AGILE_CREDENTIALS=${AGILE_CREDENTIALS:-admin:admin} -# This ENV variable disables SSL Verification, the above AGILE_URL doesn't have a proper certificate +# Ateliere Live System Controlleer +LIVE_URL=${LIVE_URL:-https://localhost:8080} +LIVE_CREDENTIALS=${LIVE_CREDENTIALS:-admin:admin} +# This ENV variable disables SSL Verification, use if the above LIVE_URL doesn't have a proper certificate NODE_TLS_REJECT_UNAUTHORIZED=${NODE_TLS_REJECT_UNAUTHORIZED:-1} # NextAuth diff --git a/README.md b/README.md index 335c3e3a..ee23668d 100644 --- a/README.md +++ b/README.md @@ -15,12 +15,12 @@ Start mongodb docker container using `docker-compose up`. It will initialize the If you want to run the GUI and mongodb docker containers add this to the `docker-compose.yml` file: ``` - agileui: + liveui: build: . environment: - MONGODB_URI: mongodb://api:@host.docker.internal:27017/agile-live-gui - AGILE_URL: https://:8080 - AGILE_CREDENTIALS: : + MONGODB_URI: mongodb://api:@host.docker.internal:27017/live-gui + LIVE_URL: https://:8080 + LIVE_CREDENTIALS: : NODE_TLS_REJECT_UNAUTHORIZED: 0 NEXTAUTH_SECRET: NEXTAUTH_URL: http://localhost:3000 @@ -34,10 +34,10 @@ If you want to run the GUI and mongodb docker containers add this to the `docker Then copy the `.env.sample` file and name it `.env`, it will contain env variables: -- `MONGODB_URI` - The mongodb connection string including credentials eg. `mongodb://user123:pass123@127.0.0.1:27017/agile-live-gui` +- `MONGODB_URI` - The mongodb connection string including credentials eg. `mongodb://user123:pass123@127.0.0.1:27017/live-gui` -- `AGILE_URL` - The URL to the Agile-live system controller REST API -- `AGILE_CREDENTIALS` - Credentials for the Agile-live system controller REST API +- `LIVE_URL` - The URL to the Ateliere Live system controller REST API +- `LIVE_CREDENTIALS` - Credentials for the Ateliere Live system controller REST API - `NEXTAUTH_SECRET` - The secret used to encrypt the JWT Token - `NEXTAUTH_URL` - The base url for the service, eg. `http://localhost:3000`, used internally by NextAuth. @@ -64,7 +64,7 @@ Run following to run application in development environment: ### External Documentation -https://docs.agilecontent.com/docs/acl/reference/3-0-0/rest_api/ +https://help.ateliere.com/live/docs/reference/7-0-0/rest_api/ ### Contributing diff --git a/docs/production_workflow.md b/docs/production_workflow.md index 4bddda45..f69793ea 100644 --- a/docs/production_workflow.md +++ b/docs/production_workflow.md @@ -2,7 +2,7 @@ ## Terminology -- System referes to the agile live backend +- System refers to the ateliere live backend - Manager refers to this application. ## Assumptions diff --git a/package-lock.json b/package-lock.json index 7078d75e..73c7afff 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,11 +1,11 @@ { - "name": "agile-live-gui", + "name": "ateliere-live-gui", "version": "1.0.0", "lockfileVersion": 3, "requires": true, "packages": { "": { - "name": "agile-live-gui", + "name": "ateliere-live-gui", "version": "1.0.0", "license": "UNLICENSED", "dependencies": { @@ -851,13 +851,13 @@ } }, "node_modules/@commitlint/is-ignored": { - "version": "17.6.3", - "resolved": "https://registry.npmjs.org/@commitlint/is-ignored/-/is-ignored-17.6.3.tgz", - "integrity": "sha512-LQbNdnPbxrpbcrVKR5yf51SvquqktpyZJwqXx3lUMF6+nT9PHB8xn3wLy8pi2EQv5Zwba484JnUwDE1ygVYNQA==", + "version": "17.8.1", + "resolved": "https://registry.npmjs.org/@commitlint/is-ignored/-/is-ignored-17.8.1.tgz", + "integrity": "sha512-UshMi4Ltb4ZlNn4F7WtSEugFDZmctzFpmbqvpyxD3la510J+PLcnyhf9chs7EryaRFJMdAKwsEKfNK0jL/QM4g==", "dev": true, "dependencies": { - "@commitlint/types": "^17.4.4", - "semver": "7.5.0" + "@commitlint/types": "^17.8.1", + "semver": "7.5.4" }, "engines": { "node": ">=v14" @@ -997,9 +997,9 @@ } }, "node_modules/@commitlint/types": { - "version": "17.4.4", - "resolved": "https://registry.npmjs.org/@commitlint/types/-/types-17.4.4.tgz", - "integrity": "sha512-amRN8tRLYOsxRr6mTnGGGvB5EmW/4DDjLMgiwK3CCVEmN6Sr/6xePGEpWaspKkckILuUORCwe6VfDBw6uj4axQ==", + "version": "17.8.1", + "resolved": "https://registry.npmjs.org/@commitlint/types/-/types-17.8.1.tgz", + "integrity": "sha512-PXDQXkAmiMEG162Bqdh9ChML/GJZo6vU+7F03ALKDK8zYc6SuAr47LjG7hGYRqUOz+WK0dU7bQ0xzuqFMdxzeQ==", "dev": true, "dependencies": { "chalk": "^4.1.0" @@ -6043,10 +6043,22 @@ "node": ">= 0.4" } }, - "node_modules/ip": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/ip/-/ip-2.0.1.tgz", - "integrity": "sha512-lJUL9imLTNi1ZfXT+DU6rBBdbiKGBuay9B6xGSPVjUeQwaH1RIGqef8RZkUtHioLmSNpPR5M4HVKJGm1j8FWVQ==" + "node_modules/ip-address": { + "version": "9.0.5", + "resolved": "https://registry.npmjs.org/ip-address/-/ip-address-9.0.5.tgz", + "integrity": "sha512-zHtQzGojZXTwZTHQqra+ETKd4Sn3vgi7uBmlPoXVWZqYvuKmtI0l/VZTjqGmJY9x88GGOaZ9+G9ES8hC4T4X8g==", + "dependencies": { + "jsbn": "1.1.0", + "sprintf-js": "^1.1.3" + }, + "engines": { + "node": ">= 12" + } + }, + "node_modules/ip-address/node_modules/sprintf-js": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.1.3.tgz", + "integrity": "sha512-Oo+0REFV59/rz3gfJNKQiBlwfHaSESl1pcGyABQsnnIfWOFt6JNj5gCog2U6MLZ//IGYD+nA8nI+mTShREReaA==" }, "node_modules/ipaddr.js": { "version": "1.9.1", @@ -7210,6 +7222,11 @@ "js-yaml": "bin/js-yaml.js" } }, + "node_modules/jsbn": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/jsbn/-/jsbn-1.1.0.tgz", + "integrity": "sha512-4bYVV3aAMtDTTu4+xsDYa6sy9GyJ69/amsu9sYF2zqjiEoZA5xJi3BrfX3uY+/IekIu7MwdObdbDWpoZdBv3/A==" + }, "node_modules/jsesc": { "version": "2.5.2", "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-2.5.2.tgz", @@ -7625,12 +7642,12 @@ } }, "node_modules/micromatch": { - "version": "4.0.5", - "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.5.tgz", - "integrity": "sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==", + "version": "4.0.8", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.8.tgz", + "integrity": "sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==", "dev": true, "dependencies": { - "braces": "^3.0.2", + "braces": "^3.0.3", "picomatch": "^2.3.1" }, "engines": { @@ -9645,9 +9662,9 @@ "integrity": "sha512-6aU+Rwsezw7VR8/nyvKTx8QpWH9FrcYiXXlqC4z5d5XQBDRqtbfsRjnwGyqbi3gddNtWHuEk9OANUotL26qKUw==" }, "node_modules/semver": { - "version": "7.5.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.0.tgz", - "integrity": "sha512-+XC0AD/R7Q2mPSRuy2Id0+CGTZ98+8f+KvwirxOKIEyid+XSx6HbC63p+O4IndTHuX5Z+JxQ0TghCkO5Cg/2HA==", + "version": "7.5.4", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", + "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", "dependencies": { "lru-cache": "^6.0.0" }, @@ -9827,15 +9844,15 @@ } }, "node_modules/socks": { - "version": "2.7.1", - "resolved": "https://registry.npmjs.org/socks/-/socks-2.7.1.tgz", - "integrity": "sha512-7maUZy1N7uo6+WVEX6psASxtNlKaNVMlGQKkG/63nEDdLOWNbiUMoLK7X4uYoLhQstau72mLgfEWcXcwsaHbYQ==", + "version": "2.8.3", + "resolved": "https://registry.npmjs.org/socks/-/socks-2.8.3.tgz", + "integrity": "sha512-l5x7VUUWbjVFbafGLxPWkYsHIhEvmF85tbIeFZWc8ZPtoMyybuEhL7Jye/ooC4/d48FgOjSJXgsF/AJPYCW8Zw==", "dependencies": { - "ip": "^2.0.0", + "ip-address": "^9.0.5", "smart-buffer": "^4.2.0" }, "engines": { - "node": ">= 10.13.0", + "node": ">= 10.0.0", "npm": ">= 3.0.0" } }, diff --git a/package.json b/package.json index f3a8e128..3d341165 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "private": true, - "name": "agile-live-gui", + "name": "ateliere-live-gui", "version": "1.0.0", "description": "", "scripts": { @@ -15,7 +15,7 @@ "start": "next start", "version:rc": "npm version prerelease --preid=rc", "postversion": "git push && git push --tags", - "generate-types:agile-live": "bash -c 'source .env && curl -O -u $AGILE_CREDENTIALS -k \"$AGILE_URL/static/swagger_docs/swagger.json\"' && swagger-typescript-api -p swagger.json -o ./types -n agile-live.d.ts --no-client" + "generate-types:ateliere-live": "bash -c 'source .env && curl -O -u $LIVE_CREDENTIALS -k \"$LIVE_URL/static/swagger_docs/swagger.json\"' && swagger-typescript-api -p swagger.json -o ./types -n ateliere-live.d.ts --no-client" }, "license": "UNLICENSED", "engines": { diff --git a/scripts/mongo-init.js b/scripts/mongo-init.js index d3f64b1c..7e38304b 100644 --- a/scripts/mongo-init.js +++ b/scripts/mongo-init.js @@ -1,8 +1,8 @@ /* eslint-disable no-undef */ -productionsDb = db.getSiblingDB('agile-live-gui'); +productionsDb = db.getSiblingDB('live-gui'); productionsDb.createUser({ user: 'api', pwd: 'password', - roles: [{ role: 'readWrite', db: 'agile-live-gui' }] + roles: [{ role: 'readWrite', db: 'live-gui' }] }); diff --git a/scripts/mongo-mock.js b/scripts/mongo-mock.js index c34611d7..8ae37996 100644 --- a/scripts/mongo-mock.js +++ b/scripts/mongo-mock.js @@ -1,5 +1,5 @@ /* eslint-disable no-undef */ -const agileDb = db.getSiblingDB('agile-live-gui'); +const liveDb = db.getSiblingDB('live-gui'); function createSource( name, @@ -116,31 +116,31 @@ const sources = [ ) ]; -agileDb.inventory.insertMany(sources); +liveDb.inventory.insertMany(sources); -agileDb.users.insertOne({ +liveDb.users.insertOne({ username: 'admin' }); -agileDb.productions.insertOne({ +liveDb.productions.insertOne({ name: 'stockholm_podcast', sources, selectedPresetRef: undefined }); -agileDb.productions.insertOne({ +liveDb.productions.insertOne({ name: 'umeƄ_podcast', sources: [sources[6], sources[7]], selectedPresetRef: undefined }); -agileDb.productions.insertOne({ +liveDb.productions.insertOne({ name: 'Svenska Nyheter', sources: [sources[0], sources[1], sources[2], sources[3]], selectedPresetRef: undefined }); -agileDb.productions.insertOne({ +liveDb.productions.insertOne({ name: 'Morgon Studion', sources: [sources[0], sources[3]], selectedPresetRef: undefined diff --git a/src/api/agileLive/utils/authheader.ts b/src/api/agileLive/utils/authheader.ts deleted file mode 100644 index 51607d58..00000000 --- a/src/api/agileLive/utils/authheader.ts +++ /dev/null @@ -1,8 +0,0 @@ -export function getAuthorizationHeader() { - if (process.env.AGILE_CREDENTIALS) { - return `Basic ${Buffer.from(process.env.AGILE_CREDENTIALS).toString( - 'base64' - )}`; - } - return ''; -} diff --git a/src/api/agileLive/controlconnections.ts b/src/api/ateliereLive/controlconnections.ts similarity index 82% rename from src/api/agileLive/controlconnections.ts rename to src/api/ateliereLive/controlconnections.ts index cf217f6a..34e6d2b6 100644 --- a/src/api/agileLive/controlconnections.ts +++ b/src/api/ateliereLive/controlconnections.ts @@ -1,5 +1,5 @@ -import { ResourcesCreateControlConnectionResponse } from '../../../types/agile-live'; -import { AGILE_BASE_API_PATH } from '../../constants'; +import { ResourcesCreateControlConnectionResponse } from '../../../types/ateliere-live'; +import { LIVE_BASE_API_PATH } from '../../constants'; import { getAuthorizationHeader } from './utils/authheader'; export async function connectSenderAndReceiver( @@ -9,7 +9,7 @@ export async function connectSenderAndReceiver( port: number ): Promise { const response = await fetch( - new URL(AGILE_BASE_API_PATH + `/controlconnections`, process.env.AGILE_URL), + new URL(LIVE_BASE_API_PATH + `/controlconnections`, process.env.LIVE_URL), { method: 'POST', headers: { @@ -35,8 +35,8 @@ export async function connectSenderAndReceiver( export async function disconnectReceiver(receiverId: string): Promise { const response = await fetch( new URL( - AGILE_BASE_API_PATH + `/controlconnections/${receiverId}`, - process.env.AGILE_URL + LIVE_BASE_API_PATH + `/controlconnections/${receiverId}`, + process.env.LIVE_URL ), { method: 'DELETE', diff --git a/src/api/agileLive/controlpanels.ts b/src/api/ateliereLive/controlpanels.ts similarity index 71% rename from src/api/agileLive/controlpanels.ts rename to src/api/ateliereLive/controlpanels.ts index 50dfbfdc..4a0b6832 100644 --- a/src/api/agileLive/controlpanels.ts +++ b/src/api/ateliereLive/controlpanels.ts @@ -1,5 +1,5 @@ -import { ResourcesControlPanelResponse } from '../../../types/agile-live'; -import { AGILE_BASE_API_PATH } from '../../constants'; +import { ResourcesControlPanelResponse } from '../../../types/ateliere-live'; +import { LIVE_BASE_API_PATH } from '../../constants'; import { getAuthorizationHeader } from './utils/authheader'; export async function getControlPanels(): Promise< @@ -7,8 +7,8 @@ export async function getControlPanels(): Promise< > { const response = await fetch( new URL( - AGILE_BASE_API_PATH + `/controlpanels?expand=true`, - process.env.AGILE_URL + LIVE_BASE_API_PATH + `/controlpanels?expand=true`, + process.env.LIVE_URL ), { method: 'GET', diff --git a/src/api/agileLive/ingest.ts b/src/api/ateliereLive/ingest.ts similarity index 89% rename from src/api/agileLive/ingest.ts rename to src/api/ateliereLive/ingest.ts index 3ff9d207..e3a017d1 100644 --- a/src/api/agileLive/ingest.ts +++ b/src/api/ateliereLive/ingest.ts @@ -2,8 +2,8 @@ import { ResourcesCompactIngestResponse, ResourcesIngestResponse, ResourcesThumbnailResponse -} from '../../../types/agile-live'; -import { AGILE_BASE_API_PATH } from '../../constants'; +} from '../../../types/ateliere-live'; +import { LIVE_BASE_API_PATH } from '../../constants'; import { getAuthorizationHeader } from './utils/authheader'; // TODO: create proper cache... @@ -58,10 +58,7 @@ export async function getSourceIdFromSourceName( export async function getIngests(): Promise { const response = await fetch( - new URL( - AGILE_BASE_API_PATH + `/ingests?expand=true`, - process.env.AGILE_URL - ), + new URL(LIVE_BASE_API_PATH + `/ingests?expand=true`, process.env.LIVE_URL), { headers: { authorization: getAuthorizationHeader() @@ -82,8 +79,8 @@ export async function getIngest( ): Promise { const response = await fetch( new URL( - AGILE_BASE_API_PATH + `/ingests/${uuid}?expand=true`, - process.env.AGILE_URL + LIVE_BASE_API_PATH + `/ingests/${uuid}?expand=true`, + process.env.LIVE_URL ), { headers: { @@ -104,9 +101,9 @@ export async function getSourceThumbnail( ) { const response = await fetch( new URL( - AGILE_BASE_API_PATH + + LIVE_BASE_API_PATH + `/ingests/${ingestUuid}/sources/${sourceId}/thumbnail`, - process.env.AGILE_URL + process.env.LIVE_URL ), { method: 'POST', diff --git a/src/api/agileLive/pipelines/multiviews/multiviews.ts b/src/api/ateliereLive/pipelines/multiviews/multiviews.ts similarity index 93% rename from src/api/agileLive/pipelines/multiviews/multiviews.ts rename to src/api/ateliereLive/pipelines/multiviews/multiviews.ts index 8f8d1ecb..3434f710 100644 --- a/src/api/agileLive/pipelines/multiviews/multiviews.ts +++ b/src/api/ateliereLive/pipelines/multiviews/multiviews.ts @@ -1,23 +1,23 @@ import { ResourcesPipelineMultiviewResponse, ResourcesView -} from '../../../../../types/agile-live'; +} from '../../../../../types/ateliere-live'; import { SourceReference } from '../../../../interfaces/Source'; import { getAuthorizationHeader } from '../../utils/authheader'; import { createMultiview } from '../../utils/multiview'; import { getSourcesByIds } from '../../../manager/sources'; import { Log } from '../../../logger'; import { ProductionSettings } from '../../../../interfaces/production'; -import { AGILE_BASE_API_PATH } from '../../../../constants'; import { MultiviewSettings } from '../../../../interfaces/multiview'; +import { LIVE_BASE_API_PATH } from '../../../../constants'; export async function getMultiviewsForPipeline( pipelineUUID: string ): Promise { const response = await fetch( new URL( - AGILE_BASE_API_PATH + `/pipelines/${pipelineUUID}/multiviews?expand=true`, - process.env.AGILE_URL + LIVE_BASE_API_PATH + `/pipelines/${pipelineUUID}/multiviews?expand=true`, + process.env.LIVE_URL ), { headers: { @@ -130,8 +130,8 @@ export async function createMultiviewForPipeline( } const response = await fetch( new URL( - AGILE_BASE_API_PATH + `/pipelines/${pipelineUUID}/multiviews`, - process.env.AGILE_URL + BASE_API_PATH + `/pipelines/${pipelineUUID}/multiviews`, + process.env.LIVE_URL ), { method: 'POST', @@ -161,9 +161,9 @@ export async function deleteMultiviewFromPipeline( ): Promise { const response = await fetch( new URL( - AGILE_BASE_API_PATH + + LIVE_BASE_API_PATH + `/pipelines/${pipelineUUID}/multiviews/${multiviewId}`, - process.env.AGILE_URL + process.env.LIVE_URL ), { method: 'DELETE', @@ -204,9 +204,9 @@ export async function updateMultiviewForPipeline( ); const response = await fetch( new URL( - AGILE_BASE_API_PATH + + LIVE_BASE_API_PATH + `/pipelines/${pipelineUUID}/multiviews/${multiviewId}`, - process.env.AGILE_URL + process.env.LIVE_URL ), { method: 'PUT', diff --git a/src/api/agileLive/pipelines/outputs/outputs.ts b/src/api/ateliereLive/pipelines/outputs/outputs.ts similarity index 84% rename from src/api/agileLive/pipelines/outputs/outputs.ts rename to src/api/ateliereLive/pipelines/outputs/outputs.ts index 3387bcc7..2a2fca75 100644 --- a/src/api/agileLive/pipelines/outputs/outputs.ts +++ b/src/api/ateliereLive/pipelines/outputs/outputs.ts @@ -1,5 +1,5 @@ -import { ResourcesOutputStatusResponse } from '../../../../../types/agile-live'; -import { AGILE_BASE_API_PATH } from '../../../../constants'; +import { ResourcesOutputStatusResponse } from '../../../../../types/ateliere-live'; +import { LIVE_BASE_API_PATH } from '../../../../constants'; import { PipelineOutputSettings } from '../../../../interfaces/pipeline'; import { getAuthorizationHeader } from '../../utils/authheader'; @@ -8,8 +8,8 @@ export async function getPipelineOutputs( ): Promise { const response = await fetch( new URL( - AGILE_BASE_API_PATH + `/pipelines/${pipelineId}/outputs?expand=true`, - process.env.AGILE_URL + LIVE_BASE_API_PATH + `/pipelines/${pipelineId}/outputs?expand=true`, + process.env.LIVE_URL ), { method: 'GET', @@ -33,8 +33,8 @@ export async function stopAllOutputStreamsByUuid( ) { const response = await fetch( new URL( - AGILE_BASE_API_PATH + `/pipelines/${pipeId}/outputs/${outputId}/streams`, - process.env.AGILE_URL + LIVE_BASE_API_PATH + `/pipelines/${pipeId}/outputs/${outputId}/streams`, + process.env.LIVE_URL ), { method: 'DELETE', @@ -59,9 +59,9 @@ export async function stopSingleOutputStream( ) { const response = await fetch( new URL( - AGILE_BASE_API_PATH + + LIVE_BASE_API_PATH + `/pipelines/${pipeId}/outputs/${outputId}/streams/${outputStreamId}`, - process.env.AGILE_URL + process.env.LIVE_URL ), { method: 'DELETE', @@ -87,9 +87,9 @@ export async function startPipelineStream( const requests = streamSettings.map((streamSetting) => { return fetch( new URL( - AGILE_BASE_API_PATH + + LIVE_BASE_API_PATH + `/pipelines/${pipelineId}/outputs/${outputId}/streams`, - process.env.AGILE_URL + process.env.LIVE_URL ), { method: 'POST', diff --git a/src/api/agileLive/pipelines/pipelines.ts b/src/api/ateliereLive/pipelines/pipelines.ts similarity index 95% rename from src/api/agileLive/pipelines/pipelines.ts rename to src/api/ateliereLive/pipelines/pipelines.ts index a2c43c55..32fc3090 100644 --- a/src/api/agileLive/pipelines/pipelines.ts +++ b/src/api/ateliereLive/pipelines/pipelines.ts @@ -1,7 +1,7 @@ import { ResourcesCompactPipelineResponse, ResourcesPipelineResponse -} from '../../../../types/agile-live'; +} from '../../../../types/ateliere-live'; import { PipelineOutputSettings, PipelineSettings @@ -18,15 +18,15 @@ import { import { getPipelineStreams } from './streams/streams'; import { ControlConnection } from '../../../interfaces/controlConnections'; import { Log } from '../../logger'; -import { AGILE_BASE_API_PATH } from '../../../constants'; +import { LIVE_BASE_API_PATH } from '../../../constants'; export async function getPipeline( uuid: string ): Promise { const response = await fetch( new URL( - AGILE_BASE_API_PATH + `/pipelines/${uuid}?expand=true`, - process.env.AGILE_URL + LIVE_BASE_API_PATH + `/pipelines/${uuid}?expand=true`, + process.env.LIVE_URL ), { method: 'GET', @@ -49,8 +49,8 @@ export async function getPipelineCompact( ): Promise { const response = await fetch( new URL( - AGILE_BASE_API_PATH + `/pipelines/${uuid}?expand=false`, - process.env.AGILE_URL + LIVE_BASE_API_PATH + `/pipelines/${uuid}?expand=false`, + process.env.LIVE_URL ), { method: 'GET', @@ -73,8 +73,8 @@ export async function getPipelines(): Promise< > { const response = await fetch( new URL( - AGILE_BASE_API_PATH + `/pipelines?expand=true`, - process.env.AGILE_URL + LIVE_BASE_API_PATH + `/pipelines?expand=true`, + process.env.LIVE_URL ), { method: 'GET', @@ -102,8 +102,8 @@ export async function getPipelines(): Promise< export async function resetPipeline(pipelineUuid: string): Promise { const response = await fetch( new URL( - AGILE_BASE_API_PATH + `/pipelines/${pipelineUuid}/reset`, - process.env.AGILE_URL + LIVE_BASE_API_PATH + `/pipelines/${pipelineUuid}/reset`, + process.env.LIVE_URL ), { method: 'PUT', diff --git a/src/api/agileLive/pipelines/streams/streams.ts b/src/api/ateliereLive/pipelines/streams/streams.ts similarity index 97% rename from src/api/agileLive/pipelines/streams/streams.ts rename to src/api/ateliereLive/pipelines/streams/streams.ts index 22602f4d..7cbd58e8 100644 --- a/src/api/agileLive/pipelines/streams/streams.ts +++ b/src/api/ateliereLive/pipelines/streams/streams.ts @@ -1,5 +1,5 @@ -import { ResourcesUUIDResponse } from '../../../../../types/agile-live'; -import { AGILE_BASE_API_PATH } from '../../../../constants'; +import { ResourcesUUIDResponse } from '../../../../../types/ateliere-live'; +import { LIVE_BASE_API_PATH } from '../../../../constants'; import { AddSourceResult, SourceToPipelineStream, @@ -29,8 +29,8 @@ export async function getPipelineStreams( ): Promise { const response = await fetch( new URL( - AGILE_BASE_API_PATH + `/pipelines/${pipelineUuid}/streams`, - process.env.AGILE_URL + LIVE_BASE_API_PATH + `/pipelines/${pipelineUuid}/streams`, + process.env.LIVE_URL ), { method: 'GET', @@ -333,8 +333,8 @@ export async function createStream( export async function deleteStream(streamUuid: string) { const response = await fetch( new URL( - AGILE_BASE_API_PATH + `/streams/${streamUuid}`, - process.env.AGILE_URL + LIVE_BASE_API_PATH + `/streams/${streamUuid}`, + process.env.LIVE_URL ), { method: 'DELETE', diff --git a/src/api/agileLive/streams.ts b/src/api/ateliereLive/streams.ts similarity index 82% rename from src/api/agileLive/streams.ts rename to src/api/ateliereLive/streams.ts index 1a5ec5f4..ef97cdee 100644 --- a/src/api/agileLive/streams.ts +++ b/src/api/ateliereLive/streams.ts @@ -1,4 +1,4 @@ -import { AGILE_BASE_API_PATH } from '../../constants'; +import { LIVE_BASE_API_PATH } from '../../constants'; import { PipelineStreamSettings } from '../../interfaces/pipeline'; import { getAuthorizationHeader } from './utils/authheader'; @@ -9,7 +9,7 @@ export async function connectIngestToPipeline( throw new Error('Error: No pipeline_id!'); } const response = await fetch( - new URL(AGILE_BASE_API_PATH + `/streams`, process.env.AGILE_URL), + new URL(LIVE_BASE_API_PATH + `/streams`, process.env.LIVE_URL), { method: 'POST', headers: { @@ -30,8 +30,8 @@ export async function connectIngestToPipeline( export async function deleteStreamByUuid(streamUuId: string) { const response = await fetch( new URL( - AGILE_BASE_API_PATH + `/streams/${streamUuId}`, - process.env.AGILE_URL + LIVE_BASE_API_PATH + `/streams/${streamUuId}`, + process.env.LIVE_URL ), { method: 'DELETE', diff --git a/src/api/ateliereLive/utils/authheader.ts b/src/api/ateliereLive/utils/authheader.ts new file mode 100644 index 00000000..0f4dc4ea --- /dev/null +++ b/src/api/ateliereLive/utils/authheader.ts @@ -0,0 +1,8 @@ +export function getAuthorizationHeader() { + if (process.env.LIVE_CREDENTIALS) { + return `Basic ${Buffer.from(process.env.LIVE_CREDENTIALS).toString( + 'base64' + )}`; + } + return ''; +} diff --git a/src/api/agileLive/utils/fwConfigPorts.test.data.ts b/src/api/ateliereLive/utils/fwConfigPorts.test.data.ts similarity index 100% rename from src/api/agileLive/utils/fwConfigPorts.test.data.ts rename to src/api/ateliereLive/utils/fwConfigPorts.test.data.ts diff --git a/src/api/agileLive/utils/fwConfigPorts.test.ts b/src/api/ateliereLive/utils/fwConfigPorts.test.ts similarity index 100% rename from src/api/agileLive/utils/fwConfigPorts.test.ts rename to src/api/ateliereLive/utils/fwConfigPorts.test.ts diff --git a/src/api/agileLive/utils/fwConfigPorts.ts b/src/api/ateliereLive/utils/fwConfigPorts.ts similarity index 100% rename from src/api/agileLive/utils/fwConfigPorts.ts rename to src/api/ateliereLive/utils/fwConfigPorts.ts diff --git a/src/api/agileLive/utils/multiview.ts b/src/api/ateliereLive/utils/multiview.ts similarity index 100% rename from src/api/agileLive/utils/multiview.ts rename to src/api/ateliereLive/utils/multiview.ts diff --git a/src/api/agileLive/utils/pipeline.ts b/src/api/ateliereLive/utils/pipeline.ts similarity index 57% rename from src/api/agileLive/utils/pipeline.ts rename to src/api/ateliereLive/utils/pipeline.ts index 3d141029..5083ebf8 100644 --- a/src/api/agileLive/utils/pipeline.ts +++ b/src/api/ateliereLive/utils/pipeline.ts @@ -1,4 +1,4 @@ -import { ResourcesPipelineResponse } from '../../../../types/agile-live'; +import { ResourcesPipelineResponse } from '../../../../types/ateliere-live'; export function isActive(pipeline: ResourcesPipelineResponse) { return !!pipeline.streams?.length; diff --git a/src/api/manager/job/syncInventory.ts b/src/api/manager/job/syncInventory.ts index 8f63785b..877b7ab7 100644 --- a/src/api/manager/job/syncInventory.ts +++ b/src/api/manager/job/syncInventory.ts @@ -1,6 +1,6 @@ -import { ResourcesIngestResponse } from '../../../../types/agile-live'; +import { ResourcesIngestResponse } from '../../../../types/ateliere-live'; import { Source } from '../../../interfaces/Source'; -import { getIngests, getIngest } from '../../agileLive/ingest'; +import { getIngests, getIngest } from '../../ateliereLive/ingest'; import { upsertSource } from '../sources'; import { getDatabase } from '../../mongoClient/dbClient'; import { WithId } from 'mongodb'; @@ -51,7 +51,7 @@ async function getSourcesFromAPI() { } /** - * Syncs the inventory with the ingests in Agile Live. + * Syncs the inventory with the ingests in Ateliere Live. * - Adds new sources to the inventory with the status 'new' * - Updates the status of sources depending on wheter or not they are still present in the ingests */ diff --git a/src/api/manager/job/syncMonitoring.ts b/src/api/manager/job/syncMonitoring.ts index e2064596..7619bfdb 100644 --- a/src/api/manager/job/syncMonitoring.ts +++ b/src/api/manager/job/syncMonitoring.ts @@ -1,6 +1,9 @@ import { Production } from '../../../interfaces/production'; import { getDatabase } from '../../mongoClient/dbClient'; -import { getPipeline, getPipelines } from '../../agileLive/pipelines/pipelines'; +import { + getPipeline, + getPipelines +} from '../../ateliereLive/pipelines/pipelines'; import { ResourcesControlPanelResponse, ResourcesControlRequestCounter, @@ -10,9 +13,9 @@ import { ResourcesPipelineResponse, ResourcesReceiverNetworkEndpoint, ResourcesSenderNetworkEndpoint -} from '../../../../types/agile-live'; -import { getControlPanels } from '../../agileLive/controlpanels'; -import { getIngest, getIngests } from '../../agileLive/ingest'; +} from '../../../../types/ateliere-live'; +import { getControlPanels } from '../../ateliereLive/controlpanels'; +import { getIngest, getIngests } from '../../ateliereLive/ingest'; import { MonitoringControlPanelStatusResponse, MonitoringOutputStatusResponse, @@ -350,7 +353,7 @@ export async function updatedMonitoringForProduction( } /** - * Syncs the Monitoring DB with all the active productions and compares with data in Agile Live. + * Syncs the Monitoring DB with all the active productions and compares with data in Ateliere Live. */ export async function runSyncMonitoring() { const db = await getDatabase(); diff --git a/src/api/manager/workflow.ts b/src/api/manager/workflow.ts index e311c710..7538be78 100644 --- a/src/api/manager/workflow.ts +++ b/src/api/manager/workflow.ts @@ -12,39 +12,39 @@ import { getPipelines, removePipelineStreams, resetPipeline -} from '../agileLive/pipelines/pipelines'; +} from '../ateliereLive/pipelines/pipelines'; import { createMultiviewForPipeline, deleteAllMultiviewsFromPipeline -} from '../agileLive/pipelines/multiviews/multiviews'; +} from '../ateliereLive/pipelines/multiviews/multiviews'; import { getSourceIdFromSourceName, getUuidFromIngestName -} from '../agileLive/ingest'; +} from '../ateliereLive/ingest'; import { PipelineStreamSettings } from '../../interfaces/pipeline'; import { connectIngestToPipeline, deleteStreamByUuid -} from '../agileLive/streams'; -import { disconnectReceiver } from '../agileLive/controlconnections'; +} from '../ateliereLive/streams'; +import { disconnectReceiver } from '../ateliereLive/controlconnections'; import { ResourcesCompactPipelineResponse, ResourcesConnectionUUIDResponse, ResourcesPipelineResponse, ResourcesReceiverNetworkEndpoint, ResourcesSenderNetworkEndpoint -} from '../../../types/agile-live'; +} from '../../../types/ateliere-live'; import { getSourcesByIds } from './sources'; import { SourceWithId, SourceToPipelineStream } from '../../interfaces/Source'; import { getAvailablePortsForIngest, getCurrentlyUsedPorts, initDedicatedPorts -} from '../agileLive/utils/fwConfigPorts'; +} from '../ateliereLive/utils/fwConfigPorts'; import { getAudioMapping } from './inventory'; import { Log } from '../logger'; import { putProduction } from './productions'; -import { getControlPanels } from '../agileLive/controlpanels'; +import { getControlPanels } from '../ateliereLive/controlpanels'; import { Result } from '../../interfaces/result'; import { Monitoring } from '../../interfaces/monitoring'; import { getDatabase } from '../mongoClient/dbClient'; @@ -466,7 +466,7 @@ export async function startProduction( throw error; }); - // Fetch expanded pipeline objects from Agile Live + // Fetch expanded pipeline objects from Ateliere Live const pipelinesToUsePromises = production_settings.pipelines.map( (pipeline) => { return getPipeline(pipeline.pipeline_id!); @@ -499,7 +499,7 @@ export async function startProduction( throw `Failed to reset pipelines: ${error}`; }); - // Fetch all control panels from Agile Live + // Fetch all control panels from Ateliere Live const allControlPanels = await getControlPanels(); // Check which control panels that should be used by this production const controlPanelsToUse = allControlPanels.filter((controlPanel) => @@ -531,7 +531,7 @@ export async function startProduction( throw `Failed to stop pipelines during startup: ${error}`; }); - // TODO: This will fetch the pipelines once again from Agile Live, but we already have them in pipelinesToUse + // TODO: This will fetch the pipelines once again from Ateliere Live, but we already have them in pipelinesToUse const usedPorts = await getCurrentlyUsedPorts( pipelinesToUse.map((pipeline) => { return pipeline.uuid; @@ -573,7 +573,7 @@ export async function startProduction( // Try to connect control panels and pipeline-to-pipeline connections start try { - // TODO: This will re-fetch pipelines from the Agile Live API, but we fetched them above into pipelinesToUse + // TODO: This will re-fetch pipelines from the Ateliere Live API, but we fetched them above into pipelinesToUse await connectControlPanelToPipeline( production_settings.control_connection, production_settings.pipelines diff --git a/src/app/api/manager/controlpanels/route.ts b/src/app/api/manager/controlpanels/route.ts index c91e6073..360779fc 100644 --- a/src/app/api/manager/controlpanels/route.ts +++ b/src/app/api/manager/controlpanels/route.ts @@ -1,6 +1,6 @@ import { NextRequest, NextResponse } from 'next/server'; import { isAuthenticated } from '../../../../api/manager/auth'; -import { getControlPanels } from '../../../../api/agileLive/controlpanels'; +import { getControlPanels } from '../../../../api/ateliereLive/controlpanels'; export async function GET(request: NextRequest): Promise { if (!(await isAuthenticated())) { diff --git a/src/app/api/manager/multiviews/[id]/route.ts b/src/app/api/manager/multiviews/[id]/route.ts index ff1193d7..4390f374 100644 --- a/src/app/api/manager/multiviews/[id]/route.ts +++ b/src/app/api/manager/multiviews/[id]/route.ts @@ -2,7 +2,7 @@ import { NextRequest, NextResponse } from 'next/server'; import { isAuthenticated } from '../../../../../api/manager/auth'; import { getMultiviewPreset } from '../../../../../api/manager/presets'; import { Params } from 'next/dist/shared/lib/router/utils/route-matcher'; -import { updateMultiviewForPipeline } from '../../../../../api/agileLive/pipelines/multiviews/multiviews'; +import { updateMultiviewForPipeline } from '../../../../../api/ateliereLive/pipelines/multiviews/multiviews'; import { MultiviewViews } from '../../../../../interfaces/multiview'; export async function GET( diff --git a/src/app/api/manager/pipelines/[id]/route.ts b/src/app/api/manager/pipelines/[id]/route.ts index 54055a6e..9f8a6a48 100644 --- a/src/app/api/manager/pipelines/[id]/route.ts +++ b/src/app/api/manager/pipelines/[id]/route.ts @@ -1,6 +1,6 @@ import { NextRequest, NextResponse } from 'next/server'; -import { getPipeline } from '../../../../../api/agileLive/pipelines/pipelines'; -import { isActive } from '../../../../../api/agileLive/utils/pipeline'; +import { getPipeline } from '../../../../../api/ateliereLive/pipelines/pipelines'; +import { isActive } from '../../../../../api/ateliereLive/utils/pipeline'; import { getSRTMultiviews, getSRTOutputs, diff --git a/src/app/api/manager/pipelines/route.ts b/src/app/api/manager/pipelines/route.ts index 498faabc..1b73e084 100644 --- a/src/app/api/manager/pipelines/route.ts +++ b/src/app/api/manager/pipelines/route.ts @@ -1,5 +1,5 @@ import { NextRequest, NextResponse } from 'next/server'; -import { getPipelines } from '../../../../api/agileLive/pipelines/pipelines'; +import { getPipelines } from '../../../../api/ateliereLive/pipelines/pipelines'; import { isAuthenticated } from '../../../../api/manager/auth'; export async function GET(request: NextRequest): Promise { diff --git a/src/app/api/manager/sources/[ingest_name]/[source_name]/thumbnail/route.ts b/src/app/api/manager/sources/[ingest_name]/[source_name]/thumbnail/route.ts index d9efdd96..926d3e33 100644 --- a/src/app/api/manager/sources/[ingest_name]/[source_name]/thumbnail/route.ts +++ b/src/app/api/manager/sources/[ingest_name]/[source_name]/thumbnail/route.ts @@ -3,7 +3,7 @@ import { getSourceIdFromSourceName, getSourceThumbnail, getUuidFromIngestName -} from '../../../../../../../api/agileLive/ingest'; +} from '../../../../../../../api/ateliereLive/ingest'; import { isAuthenticated } from '../../../../../../../api/manager/auth'; type Params = { diff --git a/src/app/api/manager/streams/[id]/route.ts b/src/app/api/manager/streams/[id]/route.ts index 3865e444..00d44df3 100644 --- a/src/app/api/manager/streams/[id]/route.ts +++ b/src/app/api/manager/streams/[id]/route.ts @@ -1,9 +1,9 @@ import { Params } from 'next/dist/shared/lib/router/utils/route-matcher'; import { NextRequest, NextResponse } from 'next/server'; import { isAuthenticated } from '../../../../../api/manager/auth'; -import { deleteStream } from '../../../../../api/agileLive/pipelines/streams/streams'; +import { deleteStream } from '../../../../../api/ateliereLive/pipelines/streams/streams'; import { MultiviewSettings } from '../../../../../interfaces/multiview'; -import { updateMultiviewForPipeline } from '../../../../../api/agileLive/pipelines/multiviews/multiviews'; +import { updateMultiviewForPipeline } from '../../../../../api/ateliereLive/pipelines/multiviews/multiviews'; import { DeleteSourceStep } from '../../../../../interfaces/Source'; import { Result } from '../../../../../interfaces/result'; import { Log } from '../../../../../api/logger'; diff --git a/src/app/api/manager/streams/route.ts b/src/app/api/manager/streams/route.ts index 160c7363..44635884 100644 --- a/src/app/api/manager/streams/route.ts +++ b/src/app/api/manager/streams/route.ts @@ -2,7 +2,7 @@ import { NextRequest, NextResponse } from 'next/server'; import { isAuthenticated } from '../../../../api/manager/auth'; import { SourceWithId } from '../../../../interfaces/Source'; import { Production } from '../../../../interfaces/production'; -import { createStream } from '../../../../api/agileLive/pipelines/streams/streams'; +import { createStream } from '../../../../api/ateliereLive/pipelines/streams/streams'; import { Log } from '../../../../api/logger'; export type CreateStreamRequestBody = { source: SourceWithId; diff --git a/src/app/api/syshealth/route.ts b/src/app/api/syshealth/route.ts index 0f58ed99..868a2f10 100644 --- a/src/app/api/syshealth/route.ts +++ b/src/app/api/syshealth/route.ts @@ -1,8 +1,8 @@ import { NextResponse } from 'next/server'; -import { getIngests } from '../../../api/agileLive/ingest'; +import { getIngests } from '../../../api/ateliereLive/ingest'; import { connected } from '../../../api/mongoClient/dbClient'; import { isAuthenticated } from '../../../api/manager/auth'; -import { AGILE_BASE_API_PATH } from '../../../constants'; +import { LIVE_BASE_API_PATH } from '../../../constants'; export async function GET(): Promise { if (!(await isAuthenticated())) { @@ -10,20 +10,20 @@ export async function GET(): Promise { status: 403 }); } - const isConnectedToAgile = await getIngests() + const isConnectedToLive = await getIngests() .then(() => true) .catch(() => false); const isConnectedToDatabase = await connected().catch(() => false); - if (isConnectedToAgile && isConnectedToDatabase) { + if (isConnectedToLive && isConnectedToDatabase) { return new NextResponse( JSON.stringify({ message: 'Connected!', database: { connected: isConnectedToDatabase }, - agileApi: { connected: isConnectedToAgile } + liveApi: { connected: isConnectedToLive } }), { status: 200 @@ -36,9 +36,9 @@ export async function GET(): Promise { return new NextResponse( JSON.stringify({ message: 'Something went wrong with the connection!', - agileApi: { - connected: isConnectedToAgile, - url: new URL(AGILE_BASE_API_PATH, process.env.AGILE_URL) + liveApi: { + connected: isConnectedToLive, + url: new URL(LIVE_BASE_API_PATH, process.env.LIVE_URL) }, database: { connected: isConnectedToDatabase, diff --git a/src/app/production/[id]/page.tsx b/src/app/production/[id]/page.tsx index b7bd5b17..f59eb20f 100644 --- a/src/app/production/[id]/page.tsx +++ b/src/app/production/[id]/page.tsx @@ -77,7 +77,7 @@ export default function ProductionConfiguration({ params }: PageProps) { const getMultiviewPreset = useGetMultiviewPreset(); const [updateMultiviewViews] = useMultiviews(); - //FROM AGILE API + //FROM LIVE API const [pipelines, loadingPipelines, , refreshPipelines] = usePipelines(); const [controlPanels, loadingControlPanels, , refreshControlPanels] = useControlPanels(); diff --git a/src/components/footer/Footer.tsx b/src/components/footer/Footer.tsx index 1b060011..60b628e0 100644 --- a/src/components/footer/Footer.tsx +++ b/src/components/footer/Footer.tsx @@ -13,7 +13,7 @@ interface IObject { interface IConnection { database?: IObject; - agileApi?: IObject; + liveApi?: IObject; message?: string; } @@ -63,7 +63,7 @@ export default function Footer() { }, []); const settingsDb = connection?.database; - const settingsAgile = connection?.agileApi; + const settingsLive = connection?.liveApi; return (
@@ -77,8 +77,8 @@ export default function Footer() { /> , diff --git a/src/hooks/pipelines.ts b/src/hooks/pipelines.ts index 34084d23..f9ef473a 100644 --- a/src/hooks/pipelines.ts +++ b/src/hooks/pipelines.ts @@ -1,6 +1,6 @@ import { useCallback, useEffect, useState } from 'react'; import { DataHook } from './types'; -import { ResourcesCompactPipelineResponse } from '../../types/agile-live'; +import { ResourcesCompactPipelineResponse } from '../../types/ateliere-live'; import { ManagerPipelineResponse } from '../interfaces/pipeline'; const ONE_MINUTE = 1000 * 60; diff --git a/src/interfaces/pipeline.ts b/src/interfaces/pipeline.ts index 5f1d6cc5..b97f48f5 100644 --- a/src/interfaces/pipeline.ts +++ b/src/interfaces/pipeline.ts @@ -1,4 +1,4 @@ -import { ResourcesPipelineResponse } from '../../types/agile-live'; +import { ResourcesPipelineResponse } from '../../types/ateliere-live'; import { MultiviewSettings } from './multiview'; import { WhepMultiview } from './whep'; diff --git a/src/utils/checkApiConnections.ts b/src/utils/checkApiConnections.ts index d22076c4..e62af199 100644 --- a/src/utils/checkApiConnections.ts +++ b/src/utils/checkApiConnections.ts @@ -5,7 +5,7 @@ interface IObject { interface Response { database?: IObject; - agileApi?: IObject; + liveApi?: IObject; message?: string; } diff --git a/src/utils/pipeline.ts b/src/utils/pipeline.ts index acbbef7d..49ad88c5 100644 --- a/src/utils/pipeline.ts +++ b/src/utils/pipeline.ts @@ -3,7 +3,7 @@ import { ResourcesPipelineResponse, ResourcesOutputActiveStreamMpegTsSrt -} from '../../types/agile-live'; +} from '../../types/ateliere-live'; import { SrtOutput } from '../interfaces/pipeline'; import { WhepMultiview } from '../interfaces/whep'; import { getWhepUrlForSRT } from './whep'; diff --git a/types/agile-live.d.ts b/types/ateliere-live.d.ts similarity index 100% rename from types/agile-live.d.ts rename to types/ateliere-live.d.ts diff --git a/update_gui_version.sh b/update_gui_version.sh index c4e49c63..9c8a9176 100755 --- a/update_gui_version.sh +++ b/update_gui_version.sh @@ -1,2 +1,2 @@ #!/bin/bash -git describe --tags --dirty --match v* > gui-version.txt +git describe --always --tags --dirty --match v* > gui-version.txt