chore: more relaxed CSP

This commit is contained in:
Chubby Granny Chaser 2024-11-05 19:59:41 +00:00
parent 2840110a21
commit 0451bc55aa
No known key found for this signature in database
5 changed files with 71 additions and 66 deletions

View File

@ -48,7 +48,6 @@ jobs:
MAIN_VITE_ANALYTICS_API_URL: ${{ vars.MAIN_VITE_ANALYTICS_API_URL }} MAIN_VITE_ANALYTICS_API_URL: ${{ vars.MAIN_VITE_ANALYTICS_API_URL }}
RENDERER_VITE_INTERCOM_APP_ID: ${{ vars.RENDERER_VITE_INTERCOM_APP_ID }} RENDERER_VITE_INTERCOM_APP_ID: ${{ vars.RENDERER_VITE_INTERCOM_APP_ID }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Build Windows - name: Build Windows
if: matrix.os == 'windows-latest' if: matrix.os == 'windows-latest'
run: yarn build:win run: yarn build:win
@ -59,7 +58,6 @@ jobs:
MAIN_VITE_ANALYTICS_API_URL: ${{ vars.MAIN_VITE_ANALYTICS_API_URL }} MAIN_VITE_ANALYTICS_API_URL: ${{ vars.MAIN_VITE_ANALYTICS_API_URL }}
RENDERER_VITE_INTERCOM_APP_ID: ${{ vars.RENDERER_VITE_INTERCOM_APP_ID }} RENDERER_VITE_INTERCOM_APP_ID: ${{ vars.RENDERER_VITE_INTERCOM_APP_ID }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Create artifact - name: Create artifact
uses: actions/upload-artifact@v4 uses: actions/upload-artifact@v4
with: with:

View File

@ -6,7 +6,7 @@
<title>Hydra</title> <title>Hydra</title>
<meta <meta
http-equiv="Content-Security-Policy" http-equiv="Content-Security-Policy"
content="default-src 'self' *.intercom.io wss://nexus-websocket-a.intercom.io; script-src 'self' *.intercom.io *.intercomcdn.com; style-src 'self' 'unsafe-inline'; img-src 'self' data: *; media-src 'self' local: data: *; font-src 'self' https://fonts.intercomcdn.com" content="default-src 'self'; script-src *; style-src 'self' 'unsafe-inline'; img-src 'self' data: local: *; media-src 'self' local: data: *; connect-src *; font-src *;"
/> />
</head> </head>
<body> <body>

View File

@ -36,6 +36,8 @@ export interface AppProps {
children: React.ReactNode; children: React.ReactNode;
} }
console.log(import.meta.env);
Intercom({ Intercom({
app_id: import.meta.env.RENDERER_VITE_INTERCOM_APP_ID, app_id: import.meta.env.RENDERER_VITE_INTERCOM_APP_ID,
}); });

View File

@ -13,6 +13,7 @@ export const sidebar = recipe({
borderRight: `solid 1px ${vars.color.border}`, borderRight: `solid 1px ${vars.color.border}`,
position: "relative", position: "relative",
overflow: "hidden", overflow: "hidden",
justifyContent: "space-between",
}, },
variants: { variants: {
resizing: { resizing: {
@ -132,7 +133,6 @@ export const helpButton = style({
display: "flex", display: "flex",
alignItems: "center", alignItems: "center",
cursor: "pointer", cursor: "pointer",
boxShadow: "0px 0px 15px 0px rgba(0, 0, 0, 0.6)",
borderTop: `solid 1px ${vars.color.border}`, borderTop: `solid 1px ${vars.color.border}`,
transition: "background-color ease 0.1s", transition: "background-color ease 0.1s",
":hover": { ":hover": {

View File

@ -188,75 +188,80 @@ export function Sidebar() {
maxWidth: sidebarWidth, maxWidth: sidebarWidth,
}} }}
> >
<SidebarProfile /> <div
style={{ display: "flex", flexDirection: "column", overflow: "hidden" }}
>
<SidebarProfile />
<div className={styles.content}> <div className={styles.content}>
<section className={styles.section}> <section className={styles.section}>
<ul className={styles.menu}> <ul className={styles.menu}>
{routes.map(({ nameKey, path, render }) => ( {routes.map(({ nameKey, path, render }) => (
<li <li
key={nameKey} key={nameKey}
className={styles.menuItem({ className={styles.menuItem({
active: location.pathname === path, active: location.pathname === path,
})} })}
>
<button
type="button"
className={styles.menuItemButton}
onClick={() => handleSidebarItemClick(path)}
> >
{render()} <button
<span>{t(nameKey)}</span> type="button"
</button> className={styles.menuItemButton}
</li> onClick={() => handleSidebarItemClick(path)}
))} >
</ul> {render()}
</section> <span>{t(nameKey)}</span>
</button>
</li>
))}
</ul>
</section>
<section className={styles.section}> <section className={styles.section}>
<small className={styles.sectionTitle}>{t("my_library")}</small> <small className={styles.sectionTitle}>{t("my_library")}</small>
<TextField <TextField
ref={filterRef} ref={filterRef}
placeholder={t("filter")} placeholder={t("filter")}
onChange={handleFilter} onChange={handleFilter}
theme="dark" theme="dark"
/> />
<ul className={styles.menu}> <ul className={styles.menu}>
{filteredLibrary.map((game) => ( {filteredLibrary.map((game) => (
<li <li
key={game.id} key={game.id}
className={styles.menuItem({ className={styles.menuItem({
active: active:
location.pathname === `/game/${game.shop}/${game.objectID}`, location.pathname ===
muted: game.status === "removed", `/game/${game.shop}/${game.objectID}`,
})} muted: game.status === "removed",
> })}
<button
type="button"
className={styles.menuItemButton}
onClick={(event) => handleSidebarGameClick(event, game)}
> >
{game.iconUrl ? ( <button
<img type="button"
className={styles.gameIcon} className={styles.menuItemButton}
src={game.iconUrl} onClick={(event) => handleSidebarGameClick(event, game)}
alt={game.title} >
loading="lazy" {game.iconUrl ? (
/> <img
) : ( className={styles.gameIcon}
<SteamLogo className={styles.gameIcon} /> src={game.iconUrl}
)} alt={game.title}
loading="lazy"
/>
) : (
<SteamLogo className={styles.gameIcon} />
)}
<span className={styles.menuItemButtonLabel}> <span className={styles.menuItemButtonLabel}>
{getGameTitle(game)} {getGameTitle(game)}
</span> </span>
</button> </button>
</li> </li>
))} ))}
</ul> </ul>
</section> </section>
</div>
</div> </div>
{hasActiveSubscription && ( {hasActiveSubscription && (