mirror of
https://github.com/owncast/owncast.git
synced 2024-10-10 19:16:02 +00:00
Do not allow enabling federation features on if not port 443. Closes #2008
This commit is contained in:
parent
cb65dde46a
commit
215a3096db
@ -244,6 +244,18 @@ const ConfigFederation = () => {
|
|||||||
/>
|
/>
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
|
|
||||||
|
const invalidPortWarning = (
|
||||||
|
<Alert
|
||||||
|
message="Only Owncast instances available on the default SSL port 443 support this feature."
|
||||||
|
type="warning"
|
||||||
|
showIcon
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
|
||||||
|
const hasInvalidPort =
|
||||||
|
instanceUrl && new URL(instanceUrl).port !== '' && new URL(instanceUrl).port !== '443';
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
<Title>Configure Social Features</Title>
|
<Title>Configure Social Features</Title>
|
||||||
@ -263,12 +275,13 @@ const ConfigFederation = () => {
|
|||||||
<Row>
|
<Row>
|
||||||
<Col span={15} className="form-module" style={{ marginRight: '15px' }}>
|
<Col span={15} className="form-module" style={{ marginRight: '15px' }}>
|
||||||
{configurationWarning}
|
{configurationWarning}
|
||||||
|
{hasInvalidPort && invalidPortWarning}
|
||||||
<ToggleSwitch
|
<ToggleSwitch
|
||||||
fieldName="enabled"
|
fieldName="enabled"
|
||||||
onChange={handleEnabledSwitchChange}
|
onChange={handleEnabledSwitchChange}
|
||||||
{...FIELD_PROPS_ENABLE_FEDERATION}
|
{...FIELD_PROPS_ENABLE_FEDERATION}
|
||||||
checked={formDataValues.enabled}
|
checked={formDataValues.enabled}
|
||||||
disabled={!hasInstanceUrl || !isInstanceUrlSecure}
|
disabled={hasInvalidPort || !hasInstanceUrl || !isInstanceUrlSecure}
|
||||||
/>
|
/>
|
||||||
<ToggleSwitch
|
<ToggleSwitch
|
||||||
fieldName="isPrivate"
|
fieldName="isPrivate"
|
||||||
@ -281,7 +294,7 @@ const ConfigFederation = () => {
|
|||||||
useSubmit
|
useSubmit
|
||||||
{...FIELD_PROPS_FEDERATION_NSFW}
|
{...FIELD_PROPS_FEDERATION_NSFW}
|
||||||
checked={formDataValues.nsfw}
|
checked={formDataValues.nsfw}
|
||||||
disabled={!hasInstanceUrl}
|
disabled={hasInvalidPort || !hasInstanceUrl}
|
||||||
/>
|
/>
|
||||||
<TextFieldWithSubmit
|
<TextFieldWithSubmit
|
||||||
required
|
required
|
||||||
|
Loading…
x
Reference in New Issue
Block a user