Remote URL hardcoding compatibility (#1810)

* Remote URL compatibility
---------

Co-authored-by: jeffvli <jeffvictorli@gmail.com>
This commit is contained in:
ashe
2026-03-09 22:08:28 -04:00
committed by GitHub
parent 3873218e94
commit e46c61e026
8 changed files with 19 additions and 3 deletions
+1
View File
@@ -8,6 +8,7 @@ declare global {
electron: ElectronAPI;
LEGACY_AUTHENTICATION?: boolean;
queryLocalFonts?: () => Promise<Font[]>;
REMOTE_URL?: string;
SERVER_LOCK?: boolean;
SERVER_NAME?: string;
SERVER_TYPE?: ServerType;
+1
View File
@@ -74,6 +74,7 @@ const env = {
SERVER_TYPE !== null
? process.env.LEGACY_AUTHENTICATION?.toLocaleLowerCase() === 'true'
: false,
REMOTE_URL: process.env.REMOTE_URL ?? '',
SERVER_LOCK:
SERVER_TYPE !== null ? process.env.SERVER_LOCK?.toLocaleLowerCase() === 'true' : false,
SERVER_NAME: process.env.SERVER_NAME ?? '',
@@ -65,6 +65,7 @@ const LoginRoute = () => {
const serverType = window.SERVER_TYPE ? toServerType(window.SERVER_TYPE) : null;
const serverName = window.SERVER_NAME || '';
const serverUrl = window.SERVER_URL || '';
const remoteUrl = window.REMOTE_URL || '';
const legacyAuth = serverLock && isLegacyAuth();
const config = [
@@ -88,6 +89,11 @@ const LoginRoute = () => {
key: 'SERVER_URL',
value: serverUrl,
},
{
isValid: remoteUrl !== '',
key: 'REMOTE_URL',
value: remoteUrl,
},
];
const form = useForm({
@@ -150,6 +156,7 @@ const LoginRoute = () => {
}
const normalizedUrl = normalizeUrl(serverUrl);
const normalizedRemoteURL = normalizeUrl(remoteUrl);
const existingServer =
serverLock &&
Object.values(serverList).find((s) => normalizeUrl(s.url) === normalizedUrl);
@@ -159,6 +166,7 @@ const LoginRoute = () => {
id: nanoid(),
isAdmin: data.isAdmin,
name: serverName,
remoteUrl: normalizedRemoteURL,
type: serverType as ServerType,
url: normalizedUrl,
userId: data.userId,
+1
View File
@@ -74,6 +74,7 @@ declare global {
FS_PLAYBACK_TRANSCODE_ENABLED?: string;
FS_PLAYBACK_WEB_AUDIO?: string;
LEGACY_AUTHENTICATION?: boolean | string;
REMOTE_URL?: string;
SERVER_LOCK?: boolean | string;
SERVER_NAME?: string;
SERVER_TYPE?: string;