Skip to main content

API

Appsettings

Replace {DatabasePassword} with your database password. The user needs read and write access to the database.
Replace {EncryptionKey} with a 32 char key. The same key is required for all projects.
Replace {SecurityKey} with a UUID.

Linux

appsettings.json
{
"Database": {
"ConnectionString": "Host=localhost;Database=broadcastsuite;Username=postgres;Password={DatabasePassword};"
},
"General": {
"EncryptionKey": "{EncryptionKey}",
"DefaultCulture": "de-CH"
},
"Settings": {
"LogPath": "/opt/slg/broadcastsuite/logs",
"UseColoredConsole": true
},
"Api": {
"BaseUrl": "http://127.0.0.1",
"Port": 8091,
"GrpcPort": 8092
},
"Jwt": {
"SecurityKey": "{SecurityKey}",
"Issuer": "http://localhost",
"Audience": "http://localhost",
"ExpiryInDays": 1
}
}

Windows

appsettings.json
{
"Database": {
"ConnectionString": "Host=localhost;Database=broadcastsuite;Username=postgres;Password={DatabasePassword};"
},
"General": {
"EncryptionKey": "{EncryptionKey}",
"DefaultCulture": "de-CH"
},
"Settings": {
"LogPath": "C:\\ProgramData\\SLG Broadcast Suite\\Logs\\",
"UseColoredConsole": true
},
"Api": {
"BaseUrl": "http://127.0.0.1",
"Port": 8091,
"GrpcPort": 8092
},
"Jwt": {
"SecurityKey": "{SecurityKey}",
"Issuer": "http://localhost",
"Audience": "http://localhost",
"ExpiryInDays": 1
}
}

Values

Database

NameTypeDescription
ConnectionStringStringThe database connection.
Contains Host, Database, Username and Password.

General

NameTypeDescription
DefaultCultureStringRepresents the used culture

Settings

NameTypeDescription
LogPathStringThe path in which folder the log files should be stored
UseColoredConsoleBooleanIndicates if a colored console should be used for logging

API

NameTypeDescription
BaseUrlStringThe URL (without port) with which you connect to the API
PortUInt16The port with which you connect to the API
GrpcPortUInt16The gRPC port with which you connect to the API

JWT

NameTypeDescription
AudienceStringThe audience of the JWT token
ExpiryInDaysInt32The amount of days how long the JWT token is valid
IssuerStringThe issuer of the JWT token
SecurityKeyStringThe security key for the JWT signing credentials

NLog

Linux

NLog.config
<?xml version="1.0" encoding="utf-8"?>

<!--suppress XmlUnusedNamespaceDeclaration || The "xmlns:xsi" line is important-->
<nlog xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://www.nlog-project.org/schemas/NLog.xsd"
autoReload="true"
internalLogLevel="Warn"
internalLogFile="/opt/slg/broadcastsuite/logs/NLog_API.txt">

<!-- <variable name="defaultLayout" -->
<!-- value="${date:format=yyyy-MM-dd HH\:mm\:ss} ${pad:padding=-5:fixedLength=True:inner=${uppercase:${level}}} ${pad:padding=-45:fixedLength=True:inner=${replace:searchFor=BroadcastSuite.:replaceWith=:inner=${logger}}:alignmentOnTruncation=right} ${message}" /> -->
<!-- <variable name="logPath" value="/opt/slg/broadcastsuite/logs/" /> -->
<!-- <variable name="fileDateSuffix" value="${date:format=yyyy-MM-dd}" /> -->
<!-- -->
<!-- <targets> -->
<!-- -->
<!-- <target name="DebugLog" xsi:type="File" fileName="${logPath}\DebugLogApi_${fileDateSuffix}.txt" layout="${defaultLayout}" /> -->
<!-- <target name="console" xsi:type="ColoredConsole" layout="${defaultLayout}" /> -->
<!-- -->
<!-- <target xsi:type="File" name="jsonFile" fileName="${logPath}\JsonLog_${fileDateSuffix}.json"> -->
<!-- -->
<!-- <layout>${defaultLayout}|${all-event-properties}</layout> -->
<!-- <layout xsi:type="JsonLayout" includeAllProperties="true"> -->
<!-- <attribute name="time" layout="${longdate}" /> -->
<!-- <attribute name="level" layout="${level:upperCase=true}" /> -->
<!-- <attribute name="message" layout="${message}" /> -->
<!-- </layout> -->
<!-- </target> -->
<!-- -->
<!-- </targets> -->
<!-- -->
<!-- <rules> -->
<!-- <logger name="*" minlevel="Trace" writeTo="DebugLog" /> -->
<!-- <logger name="*" minlevel="Trace" writeTo="console" /> -->
<!-- <logger name="*" minlevel="Trace" writeTo="jsonFile" /> -->
<!-- </rules> -->
</nlog>

Windows

NLog.config
<?xml version="1.0" encoding="utf-8"?>

<!--suppress XmlUnusedNamespaceDeclaration || The "xmlns:xsi" line is important-->
<nlog xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://www.nlog-project.org/schemas/NLog.xsd"
autoReload="true"
internalLogLevel="Warn"
internalLogFile="C:\ProgramData\SLG Broadcast Suite\Logs\NLog_API.txt">

<!-- <variable name="defaultLayout" -->
<!-- value="${date:format=yyyy-MM-dd HH\:mm\:ss} ${pad:padding=-5:fixedLength=True:inner=${uppercase:${level}}} ${pad:padding=-45:fixedLength=True:inner=${replace:searchFor=BroadcastSuite.:replaceWith=:inner=${logger}}:alignmentOnTruncation=right} ${message}" /> -->
<!-- <variable name="logPath" value="C:\ProgramData\SLG Broadcast Suite\Logs\" /> -->
<!-- <variable name="fileDateSuffix" value="${date:format=yyyy-MM-dd}" /> -->
<!-- -->
<!-- <targets> -->
<!-- -->
<!-- <target name="DebugLog" xsi:type="File" fileName="${logPath}\DebugLogApi_${fileDateSuffix}.txt" layout="${defaultLayout}" /> -->
<!-- <target name="console" xsi:type="ColoredConsole" layout="${defaultLayout}" /> -->
<!-- -->
<!-- <target xsi:type="File" name="jsonFile" fileName="${logPath}\JsonLog_${fileDateSuffix}.json"> -->
<!-- -->
<!-- <layout>${defaultLayout}|${all-event-properties}</layout> -->
<!-- <layout xsi:type="JsonLayout" includeAllProperties="true"> -->
<!-- <attribute name="time" layout="${longdate}" /> -->
<!-- <attribute name="level" layout="${level:upperCase=true}" /> -->
<!-- <attribute name="message" layout="${message}" /> -->
<!-- </layout> -->
<!-- </target> -->
<!-- -->
<!-- </targets> -->
<!-- -->
<!-- <rules> -->
<!-- <logger name="*" minlevel="Trace" writeTo="DebugLog" /> -->
<!-- <logger name="*" minlevel="Trace" writeTo="console" /> -->
<!-- <logger name="*" minlevel="Trace" writeTo="jsonFile" /> -->
<!-- </rules> -->
</nlog>