Skip to content

Commit

Permalink
chore: sync with upstream repo (#9)
Browse files Browse the repository at this point in the history
* fix: add --always to update_gui_version.sh

To get results even if there are no tags yet in the repository.

* fix: update code to rename from agile to ateliere or simply live

* fixup! Merge remote-tracking branch 'upstream/main' into chore-sync-with-upstream

* chore: fix variable name

---------

Co-authored-by: Per Moberg <[email protected]>
  • Loading branch information
birme and Per Moberg committed Sep 6, 2024
1 parent 57b37e1 commit 15296a2
Show file tree
Hide file tree
Showing 44 changed files with 191 additions and 174 deletions.
10 changes: 5 additions & 5 deletions .env.sample
Original file line number Diff line number Diff line change
@@ -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
Expand Down
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:<API_PASSWORD>@host.docker.internal:27017/agile-live-gui
AGILE_URL: https://<SYSTEM_CONTROLLER_IP>:8080
AGILE_CREDENTIALS: <USERNAME>:<PASSWORD>
MONGODB_URI: mongodb://api:<API_PASSWORD>@host.docker.internal:27017/live-gui
LIVE_URL: https://<SYSTEM_CONTROLLER_IP>:8080
LIVE_CREDENTIALS: <USERNAME>:<PASSWORD>
NODE_TLS_REJECT_UNAUTHORIZED: 0
NEXTAUTH_SECRET: <NEXT_AUTH_SECRET>
NEXTAUTH_URL: http://localhost:3000
Expand All @@ -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:[email protected]:27017/agile-live-gui`
- `MONGODB_URI` - The mongodb connection string including credentials eg. `mongodb://user123:[email protected]: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.
Expand All @@ -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

Expand Down
2 changes: 1 addition & 1 deletion docs/production_workflow.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
69 changes: 43 additions & 26 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"private": true,
"name": "agile-live-gui",
"name": "ateliere-live-gui",
"version": "1.0.0",
"description": "",
"scripts": {
Expand All @@ -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": {
Expand Down
4 changes: 2 additions & 2 deletions scripts/mongo-init.js
Original file line number Diff line number Diff line change
@@ -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' }]
});
14 changes: 7 additions & 7 deletions scripts/mongo-mock.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* eslint-disable no-undef */
const agileDb = db.getSiblingDB('agile-live-gui');
const liveDb = db.getSiblingDB('live-gui');

function createSource(
name,
Expand Down Expand Up @@ -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
Expand Down
8 changes: 0 additions & 8 deletions src/api/agileLive/utils/authheader.ts

This file was deleted.

Original file line number Diff line number Diff line change
@@ -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(
Expand All @@ -9,7 +9,7 @@ export async function connectSenderAndReceiver(
port: number
): Promise<ResourcesCreateControlConnectionResponse> {
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: {
Expand All @@ -35,8 +35,8 @@ export async function connectSenderAndReceiver(
export async function disconnectReceiver(receiverId: string): Promise<void> {
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',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
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<
ResourcesControlPanelResponse[]
> {
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',
Expand Down
21 changes: 9 additions & 12 deletions src/api/agileLive/ingest.ts → src/api/ateliereLive/ingest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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...
Expand Down Expand Up @@ -58,10 +58,7 @@ export async function getSourceIdFromSourceName(

export async function getIngests(): Promise<ResourcesCompactIngestResponse[]> {
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()
Expand All @@ -82,8 +79,8 @@ export async function getIngest(
): Promise<ResourcesIngestResponse> {
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: {
Expand All @@ -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',
Expand All @@ -131,8 +128,8 @@ export async function getSourceThumbnail(
export async function deleteSrtSource(ingestUuid: string, sourceId: number) {
const response = await fetch(
new URL(
AGILE_BASE_API_PATH + `/ingests/${ingestUuid}/sources/${sourceId}`,
process.env.AGILE_URL
LIVE_BASE_API_PATH + `/ingests/${ingestUuid}/sources/${sourceId}`,
process.env.LIVE_URL
),
{
method: 'DELETE',
Expand Down
Loading

0 comments on commit 15296a2

Please sign in to comment.