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,
|
||||
AdminPassword: data.GetAdminPassword(),
|
||||
StreamKeys: data.GetStreamKeys(),
|
||||
StreamKeyOverridden: config.TemporaryStreamKey != "",
|
||||
WebServerPort: config.WebServerPort,
|
||||
WebServerIP: config.WebServerIP,
|
||||
RTMPServerPort: data.GetRTMPPortNumber(),
|
||||
@ -101,6 +102,7 @@ type serverConfigAdminResponse struct {
|
||||
FFmpegPath string `json:"ffmpegPath"`
|
||||
AdminPassword string `json:"adminPassword"`
|
||||
StreamKeys []models.StreamKey `json:"streamKeys"`
|
||||
StreamKeyOverridden bool `json:"streamKeyOverridden"`
|
||||
WebServerPort int `json:"webServerPort"`
|
||||
WebServerIP string `json:"webServerIP"`
|
||||
RTMPServerPort int `json:"rtmpServerPort"`
|
||||
|
@ -81,6 +81,11 @@ func HandleConn(c *rtmp.Conn, nc net.Conn) {
|
||||
accessGranted := false
|
||||
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 {
|
||||
if secretMatch(key.Key, c.URL.Path) {
|
||||
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 {
|
||||
log.Errorln("invalid streaming key; rejecting incoming stream")
|
||||
_ = nc.Close()
|
||||
|
@ -44,7 +44,7 @@ export const Offline: FC<OfflineProps> = ({ logs = [], config }) => {
|
||||
const serverStatusData = useContext(ServerStatusContext);
|
||||
|
||||
const { serverConfig } = serverStatusData || {};
|
||||
const { rtmpServerPort } = serverConfig;
|
||||
const { rtmpServerPort, streamKeyOverridden } = serverConfig;
|
||||
const instanceUrl = global.window?.location.hostname || '';
|
||||
|
||||
let rtmpURL;
|
||||
@ -79,7 +79,13 @@ export const Offline: FC<OfflineProps> = ({ logs = [], config }) => {
|
||||
Streaming Keys:
|
||||
</Text>
|
||||
<Text strong className="stream-info-box">
|
||||
{!streamKeyOverridden ? (
|
||||
<Link href="/admin/config/server"> View </Link>
|
||||
) : (
|
||||
<span style={{ paddingLeft: '10px', fontWeight: 'normal' }}>
|
||||
Overridden via command line.
|
||||
</span>
|
||||
)}
|
||||
</Text>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -1,13 +1,19 @@
|
||||
import React, { ReactElement } from 'react';
|
||||
import React, { ReactElement, useContext } from 'react';
|
||||
import { Tabs } from 'antd';
|
||||
|
||||
import StreamKeys from '../../../../components/admin/config/server/StreamKeys';
|
||||
import ServerConfig from '../../../../components/admin/config/server/ServerConfig';
|
||||
import StorageConfig from '../../../../components/admin/config/server/StorageConfig';
|
||||
import { ServerStatusContext } from '../../../../utils/server-status-context';
|
||||
|
||||
import { AdminLayout } from '../../../../components/layouts/AdminLayout';
|
||||
|
||||
export default function PublicFacingDetails() {
|
||||
const serverStatusData = useContext(ServerStatusContext);
|
||||
|
||||
const { serverConfig } = serverStatusData || {};
|
||||
const { streamKeyOverridden } = serverConfig;
|
||||
|
||||
return (
|
||||
<div className="config-public-details-page">
|
||||
<Tabs
|
||||
@ -19,7 +25,7 @@ export default function PublicFacingDetails() {
|
||||
key: '1',
|
||||
children: <ServerConfig />,
|
||||
},
|
||||
{
|
||||
!streamKeyOverridden && {
|
||||
label: `Stream Keys`,
|
||||
key: '2',
|
||||
children: <StreamKeys />,
|
||||
|
@ -140,6 +140,7 @@ export interface ConfigDetails {
|
||||
rtmpServerPort: string;
|
||||
s3: S3Field;
|
||||
streamKeys: StreamKey[];
|
||||
streamKeyOverridden: boolean;
|
||||
adminPassword: string;
|
||||
videoSettings: VideoSettingsFields;
|
||||
webServerPort: string;
|
||||
|
@ -8,6 +8,7 @@ import { DEFAULT_VARIANT_STATE } from './config-constants';
|
||||
|
||||
export const initialServerConfigState: ConfigDetails = {
|
||||
streamKeys: [],
|
||||
streamKeyOverridden: false,
|
||||
adminPassword: '',
|
||||
instanceDetails: {
|
||||
customStyles: '',
|
||||
|
Loading…
x
Reference in New Issue
Block a user