mirror of
https://github.com/shuaiplus/nodewarden.git
synced 2026-08-05 14:50:11 +00:00
Remove WEBSITE_ICONS_ENABLED and always enable website icons
This commit is contained in:
@@ -39,9 +39,6 @@
|
||||
},
|
||||
"ATTACHMENTS_KV": {
|
||||
"description": "Optional KV namespace fallback for attachment/send-file storage"
|
||||
},
|
||||
"WEBSITE_ICONS_ENABLED": {
|
||||
"description": "Optional: set to true to proxy website icons via third-party icon services. Defaults to disabled for vault-domain privacy."
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
@@ -50,7 +50,7 @@ export interface WebBootstrapResponse {
|
||||
}
|
||||
|
||||
function isWebsiteIconProxyEnabled(env: Env): boolean {
|
||||
return ['1', 'true', 'yes', 'on'].includes(String(env.WEBSITE_ICONS_ENABLED || '').trim().toLowerCase());
|
||||
return true;
|
||||
}
|
||||
|
||||
function isSameOriginWriteRequest(request: Request): boolean {
|
||||
|
||||
@@ -20,7 +20,6 @@ export interface Env {
|
||||
'globalSettings__yubico__clientId'?: string;
|
||||
'globalSettings__yubico__key'?: string;
|
||||
'globalSettings__yubico__validationUrls'?: string;
|
||||
WEBSITE_ICONS_ENABLED?: string;
|
||||
}
|
||||
|
||||
export type UserRole = 'admin' | 'user';
|
||||
|
||||
@@ -236,7 +236,7 @@ function normalizeBootstrapResponse(boot: WebBootstrapResponse): Pick<InitialApp
|
||||
const defaultKdfIterations = Number(boot.defaultKdfIterations || 600000);
|
||||
const registrationInviteRequired =
|
||||
typeof boot.registrationInviteRequired === 'boolean' ? boot.registrationInviteRequired : undefined;
|
||||
const websiteIconsEnabled = boot.websiteIconsEnabled === true;
|
||||
const websiteIconsEnabled = boot.websiteIconsEnabled !== false;
|
||||
const jwtUnsafeReason = boot.jwtUnsafeReason || null;
|
||||
const jwtWarning = jwtUnsafeReason
|
||||
? {
|
||||
@@ -330,7 +330,7 @@ export async function bootstrapAppSession(initial: InitialAppBootstrapState = re
|
||||
const normalizedBoot = normalizeBootstrapResponse(remoteBoot);
|
||||
const defaultKdfIterations = normalizedBoot.defaultKdfIterations || initial.defaultKdfIterations;
|
||||
const registrationInviteRequired = normalizedBoot.registrationInviteRequired ?? initial.registrationInviteRequired;
|
||||
const websiteIconsEnabled = normalizedBoot.websiteIconsEnabled;
|
||||
const websiteIconsEnabled = normalizedBoot.websiteIconsEnabled !== false;
|
||||
setWebsiteIconsEnabled(websiteIconsEnabled);
|
||||
const jwtWarning = normalizedBoot.jwtWarning ?? initial.jwtWarning;
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@ export function createDemoInitialBootstrapState(): InitialAppBootstrapState {
|
||||
return {
|
||||
defaultKdfIterations: 600000,
|
||||
registrationInviteRequired: true,
|
||||
websiteIconsEnabled: false,
|
||||
websiteIconsEnabled: true,
|
||||
jwtWarning: null,
|
||||
session: null,
|
||||
phase: 'login',
|
||||
|
||||
@@ -790,7 +790,7 @@ export function createDemoInitialBootstrapState(): InitialAppBootstrapState {
|
||||
return {
|
||||
defaultKdfIterations: 600000,
|
||||
registrationInviteRequired: true,
|
||||
websiteIconsEnabled: false,
|
||||
websiteIconsEnabled: true,
|
||||
jwtWarning: null,
|
||||
session: null,
|
||||
phase: 'login',
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
let websiteIconsEnabled = false;
|
||||
let websiteIconsEnabled = true;
|
||||
|
||||
export function setWebsiteIconsEnabled(enabled: boolean): void {
|
||||
websiteIconsEnabled = enabled;
|
||||
|
||||
Reference in New Issue
Block a user