mirror of
https://github.com/BrenBroZAYT/gameyfin.git
synced 2026-06-16 08:15:48 +00:00
@@ -1,25 +1,12 @@
|
|||||||
import React, {useEffect} from "react";
|
import React from "react";
|
||||||
import {SystemEndpoint} from "Frontend/generated/endpoints";
|
import {SystemEndpoint} from "Frontend/generated/endpoints";
|
||||||
import withConfigPage from "Frontend/components/administration/withConfigPage";
|
import withConfigPage from "Frontend/components/administration/withConfigPage";
|
||||||
import {Button} from "@heroui/react";
|
import {Button} from "@heroui/react";
|
||||||
import ConfigFormField from "Frontend/components/administration/ConfigFormField";
|
|
||||||
import Section from "Frontend/components/general/Section";
|
import Section from "Frontend/components/general/Section";
|
||||||
|
|
||||||
function SystemManagementLayout({getConfig, formik, setSaveMessage}: any) {
|
function SystemManagementLayout() {
|
||||||
|
|
||||||
useEffect(() => {
|
|
||||||
if (formik.dirty && (formik.initialValues.system.cors["allowed-origins"] !== formik.values.system.cors["allowed-origins"])) {
|
|
||||||
setSaveMessage("Gameyfin must be restarted for the changes to take effect");
|
|
||||||
} else {
|
|
||||||
setSaveMessage(null);
|
|
||||||
}
|
|
||||||
}, [formik.dirty]);
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="flex flex-col mt-4">
|
<div className="flex flex-col mt-4">
|
||||||
<Section title="Security configuration"/>
|
|
||||||
<ConfigFormField configElement={getConfig("system.cors.allowed-origins")}/>
|
|
||||||
|
|
||||||
<Section title="Restart Gameyfin"/>
|
<Section title="Restart Gameyfin"/>
|
||||||
<Button onPress={() => SystemEndpoint.restart()}>Restart</Button>
|
<Button onPress={() => SystemEndpoint.restart()}>Restart</Button>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -256,18 +256,6 @@ sealed class ConfigProperties<T : Serializable>(
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/** System */
|
|
||||||
sealed class System {
|
|
||||||
sealed class Cors {
|
|
||||||
data object AllowedOrigins : ConfigProperties<Array<String>>(
|
|
||||||
Array<String>::class,
|
|
||||||
"system.cors.allowed-origins",
|
|
||||||
"List of allowed CORS origins (currently unused)",
|
|
||||||
emptyArray()
|
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
enum class MatchUsersBy {
|
enum class MatchUsersBy {
|
||||||
|
|||||||
@@ -31,7 +31,6 @@ class SecurityConfig(
|
|||||||
) : VaadinWebSecurity() {
|
) : VaadinWebSecurity() {
|
||||||
|
|
||||||
private val ssoProviderKey: String = "oidc"
|
private val ssoProviderKey: String = "oidc"
|
||||||
private val allowedOrigins: List<String>? = config.get(ConfigProperties.System.Cors.AllowedOrigins)?.toList()
|
|
||||||
|
|
||||||
@Throws(Exception::class)
|
@Throws(Exception::class)
|
||||||
override fun configure(http: HttpSecurity) {
|
override fun configure(http: HttpSecurity) {
|
||||||
|
|||||||
Reference in New Issue
Block a user