Skip to content

Commit

Permalink
add disclaimer for https server url
Browse files Browse the repository at this point in the history
  • Loading branch information
John Corser committed Jan 2, 2025
1 parent 9c25e8c commit 3700854
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 14 deletions.
52 changes: 39 additions & 13 deletions src/components/pages/ServerConfigurationPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,11 @@ const ServerConfigurationPage = () => {
},
},
};
const protocol = window.location.protocol;
const hostname = window.location.hostname;
const port = window.location.port;
const currentUrl = `${protocol}//${hostname}${port ? ":" + port : ""}`;

return (
<Container>
<StyledCard asChild>
Expand All @@ -133,31 +138,52 @@ const ServerConfigurationPage = () => {
</Box>

<Flex direction="column" gap="4">
{serverUrlOverride ? null : (
<>
<Textarea
placeholder="Server URL (e.g., http://localhost:8096)"
value={serverUrl}
onChange={handleServerUrlChange}
required
/>
{protocol !== "https" ? null : (
<Disclaimer as={motion.div} variants={itemVariants}>
You are accessing Jellyfin Wrapped via https. You must
either use an https server url or follow these steps:
<ol>
<li>
Click the lock icon next to the URL in the address
bar
</li>
<li>Click "Site Settings"</li>
<li>
Find "Insecure content" and change it to "Allow" for{" "}
{currentUrl}
</li>
</ol>
</Disclaimer>
)}
</>
)}

{serverUrlOverride ? null : (
<Textarea
placeholder="Server URL (e.g., http://localhost:8096)"
value={serverUrl}
onChange={handleServerUrlChange}
required
placeholder="Auth Token - Optional. If supplied, username/password fields are ignored"
value={authToken}
onChange={handleAuthTokenChange}
required={!username && !password}
/>
)}

{serverUrlOverride ? null : <Textarea
placeholder="Auth Token - Optional. If supplied, username/password fields are ignored"
value={authToken}
onChange={handleAuthTokenChange}
required={!username && !password}
/>}

<Textarea
placeholder={`Username${serverUrlOverride ? '' : ' - not required if Auth Token is specified'}`}
placeholder={`Username${serverUrlOverride ? "" : " - not required if Auth Token is specified"}`}
value={username}
onChange={handleUsernameChange}
required={!authToken}
/>

<Textarea
placeholder={`Password${serverUrlOverride ? '' : ' - not required if Auth Token is specified'}`}
placeholder={`Password${serverUrlOverride ? "" : " - not required if Auth Token is specified"}`}
value={password}
onChange={handlePasswordChange}
required={!authToken}
Expand Down
1 change: 0 additions & 1 deletion src/lib/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,3 @@ export const generateGuid = () => {
return v.toString(16);
});
};

0 comments on commit 3700854

Please sign in to comment.