Do not support stream key UI or any persisted stream keys when overridden via cli flag. Closes #2749
This commit is contained in:
parent
48dd490a50
commit
23a721857f
@ -52,6 +52,7 @@ func GetServerConfig(w http.ResponseWriter, r *http.Request) {
|
|||||||
FFmpegPath: ffmpeg,
|
FFmpegPath: ffmpeg,
|
||||||
AdminPassword: data.GetAdminPassword(),
|
AdminPassword: data.GetAdminPassword(),
|
||||||
StreamKeys: data.GetStreamKeys(),
|
StreamKeys: data.GetStreamKeys(),
|
||||||
|
StreamKeyOverridden: config.TemporaryStreamKey != "",
|
||||||
WebServerPort: config.WebServerPort,
|
WebServerPort: config.WebServerPort,
|
||||||
WebServerIP: config.WebServerIP,
|
WebServerIP: config.WebServerIP,
|
||||||
RTMPServerPort: data.GetRTMPPortNumber(),
|
RTMPServerPort: data.GetRTMPPortNumber(),
|
||||||
@ -101,6 +102,7 @@ type serverConfigAdminResponse struct {
|
|||||||
FFmpegPath string `json:"ffmpegPath"`
|
FFmpegPath string `json:"ffmpegPath"`
|
||||||
AdminPassword string `json:"adminPassword"`
|
AdminPassword string `json:"adminPassword"`
|
||||||
StreamKeys []models.StreamKey `json:"streamKeys"`
|
StreamKeys []models.StreamKey `json:"streamKeys"`
|
||||||
|
StreamKeyOverridden bool `json:"streamKeyOverridden"`
|
||||||
WebServerPort int `json:"webServerPort"`
|
WebServerPort int `json:"webServerPort"`
|
||||||
WebServerIP string `json:"webServerIP"`
|
WebServerIP string `json:"webServerIP"`
|
||||||
RTMPServerPort int `json:"rtmpServerPort"`
|
RTMPServerPort int `json:"rtmpServerPort"`
|
||||||
|
@ -81,6 +81,11 @@ func HandleConn(c *rtmp.Conn, nc net.Conn) {
|
|||||||
accessGranted := false
|
accessGranted := false
|
||||||
validStreamingKeys := data.GetStreamKeys()
|
validStreamingKeys := data.GetStreamKeys()
|
||||||
|
|
||||||
|
// If a stream key override was specified then use that instead.
|
||||||
|
if config.TemporaryStreamKey != "" {
|
||||||
|
validStreamingKeys = []models.StreamKey{{Key: config.TemporaryStreamKey}}
|
||||||
|
}
|
||||||
|
|
||||||
for _, key := range validStreamingKeys {
|
for _, key := range validStreamingKeys {
|
||||||
if secretMatch(key.Key, c.URL.Path) {
|
if secretMatch(key.Key, c.URL.Path) {
|
||||||
accessGranted = true
|
accessGranted = true
|
||||||
@ -88,11 +93,6 @@ func HandleConn(c *rtmp.Conn, nc net.Conn) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Test against the temporary key if it was set at runtime.
|
|
||||||
if config.TemporaryStreamKey != "" && secretMatch(config.TemporaryStreamKey, c.URL.Path) {
|
|
||||||
accessGranted = true
|
|
||||||
}
|
|
||||||
|
|
||||||
if !accessGranted {
|
if !accessGranted {
|
||||||
log.Errorln("invalid streaming key; rejecting incoming stream")
|
log.Errorln("invalid streaming key; rejecting incoming stream")
|
||||||
_ = nc.Close()
|
_ = nc.Close()
|
||||||
|
@ -44,7 +44,7 @@ export const Offline: FC<OfflineProps> = ({ logs = [], config }) => {
|
|||||||
const serverStatusData = useContext(ServerStatusContext);
|
const serverStatusData = useContext(ServerStatusContext);
|
||||||
|
|
||||||
const { serverConfig } = serverStatusData || {};
|
const { serverConfig } = serverStatusData || {};
|
||||||
const { rtmpServerPort } = serverConfig;
|
const { rtmpServerPort, streamKeyOverridden } = serverConfig;
|
||||||
const instanceUrl = global.window?.location.hostname || '';
|
const instanceUrl = global.window?.location.hostname || '';
|
||||||
|
|
||||||
let rtmpURL;
|
let rtmpURL;
|
||||||
@ -79,7 +79,13 @@ export const Offline: FC<OfflineProps> = ({ logs = [], config }) => {
|
|||||||
Streaming Keys:
|
Streaming Keys:
|
||||||
</Text>
|
</Text>
|
||||||
<Text strong className="stream-info-box">
|
<Text strong className="stream-info-box">
|
||||||
<Link href="/admin/config/server"> View </Link>
|
{!streamKeyOverridden ? (
|
||||||
|
<Link href="/admin/config/server"> View </Link>
|
||||||
|
) : (
|
||||||
|
<span style={{ paddingLeft: '10px', fontWeight: 'normal' }}>
|
||||||
|
Overridden via command line.
|
||||||
|
</span>
|
||||||
|
)}
|
||||||
</Text>
|
</Text>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -1,13 +1,19 @@
|
|||||||
import React, { ReactElement } from 'react';
|
import React, { ReactElement, useContext } from 'react';
|
||||||
import { Tabs } from 'antd';
|
import { Tabs } from 'antd';
|
||||||
|
|
||||||
import StreamKeys from '../../../../components/admin/config/server/StreamKeys';
|
import StreamKeys from '../../../../components/admin/config/server/StreamKeys';
|
||||||
import ServerConfig from '../../../../components/admin/config/server/ServerConfig';
|
import ServerConfig from '../../../../components/admin/config/server/ServerConfig';
|
||||||
import StorageConfig from '../../../../components/admin/config/server/StorageConfig';
|
import StorageConfig from '../../../../components/admin/config/server/StorageConfig';
|
||||||
|
import { ServerStatusContext } from '../../../../utils/server-status-context';
|
||||||
|
|
||||||
import { AdminLayout } from '../../../../components/layouts/AdminLayout';
|
import { AdminLayout } from '../../../../components/layouts/AdminLayout';
|
||||||
|
|
||||||
export default function PublicFacingDetails() {
|
export default function PublicFacingDetails() {
|
||||||
|
const serverStatusData = useContext(ServerStatusContext);
|
||||||
|
|
||||||
|
const { serverConfig } = serverStatusData || {};
|
||||||
|
const { streamKeyOverridden } = serverConfig;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="config-public-details-page">
|
<div className="config-public-details-page">
|
||||||
<Tabs
|
<Tabs
|
||||||
@ -19,7 +25,7 @@ export default function PublicFacingDetails() {
|
|||||||
key: '1',
|
key: '1',
|
||||||
children: <ServerConfig />,
|
children: <ServerConfig />,
|
||||||
},
|
},
|
||||||
{
|
!streamKeyOverridden && {
|
||||||
label: `Stream Keys`,
|
label: `Stream Keys`,
|
||||||
key: '2',
|
key: '2',
|
||||||
children: <StreamKeys />,
|
children: <StreamKeys />,
|
||||||
|
@ -140,6 +140,7 @@ export interface ConfigDetails {
|
|||||||
rtmpServerPort: string;
|
rtmpServerPort: string;
|
||||||
s3: S3Field;
|
s3: S3Field;
|
||||||
streamKeys: StreamKey[];
|
streamKeys: StreamKey[];
|
||||||
|
streamKeyOverridden: boolean;
|
||||||
adminPassword: string;
|
adminPassword: string;
|
||||||
videoSettings: VideoSettingsFields;
|
videoSettings: VideoSettingsFields;
|
||||||
webServerPort: string;
|
webServerPort: string;
|
||||||
|
@ -8,6 +8,7 @@ import { DEFAULT_VARIANT_STATE } from './config-constants';
|
|||||||
|
|
||||||
export const initialServerConfigState: ConfigDetails = {
|
export const initialServerConfigState: ConfigDetails = {
|
||||||
streamKeys: [],
|
streamKeys: [],
|
||||||
|
streamKeyOverridden: false,
|
||||||
adminPassword: '',
|
adminPassword: '',
|
||||||
instanceDetails: {
|
instanceDetails: {
|
||||||
customStyles: '',
|
customStyles: '',
|
||||||
|
Loading…
x
Reference in New Issue
Block a user