fix: public config properties (#32500)

fix: public config visibility
This commit is contained in:
Jason Rasmussen
2026-10-17 19:32:36 +03:00
committed by Codex
parent 49f65aa3b0
commit 36a6e033aa
5 changed files with 90 additions and 51 deletions
+8
View File
@@ -28,6 +28,14 @@ final Map<String, Map<String, Object?>> openApiPatches = {
'albums': {'defaultAssetOrder': 'desc'},
'recentlyAdded': RecentlyAddedResponse(sidebarWeb: false).toJson(),
},
'PublicConfigDto': {
'map': PublicConfigMapDto(
enabled: true,
lightStyle: 'https://tiles.immich.cloud/v1/style/light.json',
darkStyle: 'https://tiles.immich.cloud/v1/style/dark.json',
).toJson(),
'ffmpeg': PublicConfigFFmpegDto(realtime: PublicConfigFFmpegRealtimeDto(enabled: false)).toJson(),
},
'ServerConfigDto': {
'mapLightStyleUrl': 'https://tiles.immich.cloud/v1/style/light.json',
'mapDarkStyleUrl': 'https://tiles.immich.cloud/v1/style/dark.json',
+56 -33
View File
@@ -25954,6 +25954,12 @@
"PublicConfigDto": {
"description": "Configuration properties that are visible to everyone",
"properties": {
"ffmpeg": {
"$ref": "#/components/schemas/PublicConfigFFmpegDto"
},
"map": {
"$ref": "#/components/schemas/PublicConfigMapDto"
},
"oauth": {
"$ref": "#/components/schemas/PublicConfigOAuthDto"
},
@@ -25962,16 +25968,61 @@
},
"server": {
"$ref": "#/components/schemas/PublicConfigServerDto"
},
"theme": {
"$ref": "#/components/schemas/PublicConfigThemeDto"
}
},
"required": [
"ffmpeg",
"map",
"oauth",
"passwordLogin",
"server",
"theme"
"server"
],
"type": "object"
},
"PublicConfigFFmpegDto": {
"properties": {
"realtime": {
"$ref": "#/components/schemas/PublicConfigFFmpegRealtimeDto"
}
},
"required": [
"realtime"
],
"type": "object"
},
"PublicConfigFFmpegRealtimeDto": {
"properties": {
"enabled": {
"description": "Enable real-time HLS transcoding (alpha)",
"type": "boolean"
}
},
"required": [
"enabled"
],
"type": "object"
},
"PublicConfigMapDto": {
"properties": {
"darkStyle": {
"description": "Dark map style URL",
"format": "uri",
"type": "string"
},
"enabled": {
"description": "Enabled",
"type": "boolean"
},
"lightStyle": {
"description": "Light map style URL",
"format": "uri",
"type": "string"
}
},
"required": [
"darkStyle",
"enabled",
"lightStyle"
],
"type": "object"
},
@@ -26021,18 +26072,6 @@
],
"type": "object"
},
"PublicConfigThemeDto": {
"properties": {
"customCss": {
"description": "Custom CSS for theming",
"type": "string"
}
},
"required": [
"customCss"
],
"type": "object"
},
"PurchaseResponse": {
"properties": {
"hideBuyButtonUntil": {
@@ -33128,9 +33167,6 @@
"server": {
"$ref": "#/components/schemas/UserConfigServerDto"
},
"theme": {
"$ref": "#/components/schemas/UserConfigThemeDto"
},
"trash": {
"$ref": "#/components/schemas/UserConfigTrashDto"
},
@@ -33148,7 +33184,6 @@
"passwordLogin",
"reverseGeocoding",
"server",
"theme",
"trash",
"user"
],
@@ -33424,18 +33459,6 @@
],
"type": "object"
},
"UserConfigThemeDto": {
"properties": {
"customCss": {
"description": "Custom CSS for theming",
"type": "string"
}
},
"required": [
"customCss"
],
"type": "object"
},
"UserConfigTrashDto": {
"properties": {
"days": {
+17 -10
View File
@@ -1630,10 +1630,6 @@ export type UserConfigServerDto = {
/** Public users */
publicUsers: boolean;
};
export type UserConfigThemeDto = {
/** Custom CSS for theming */
customCss: string;
};
export type UserConfigTrashDto = {
/** Days */
days: number;
@@ -1654,7 +1650,6 @@ export type UserConfigDto = {
passwordLogin: UserConfigPasswordLoginDto;
reverseGeocoding: UserConfigReverseGeocodingDto;
server: UserConfigServerDto;
theme: UserConfigThemeDto;
trash: UserConfigTrashDto;
user: UserConfigUserDto;
};
@@ -2180,6 +2175,21 @@ export type PluginTemplateResponseDto = {
/** Ui hints, for example "smart-album" */
uiHints: string[];
};
export type PublicConfigFFmpegRealtimeDto = {
/** Enable real-time HLS transcoding (alpha) */
enabled: boolean;
};
export type PublicConfigFFmpegDto = {
realtime: PublicConfigFFmpegRealtimeDto;
};
export type PublicConfigMapDto = {
/** Dark map style URL */
darkStyle: string;
/** Enabled */
enabled: boolean;
/** Light map style URL */
lightStyle: string;
};
export type PublicConfigOAuthDto = {
/** Auto launch */
autoLaunch: boolean;
@@ -2196,15 +2206,12 @@ export type PublicConfigServerDto = {
/** Login page message */
loginPageMessage: string;
};
export type PublicConfigThemeDto = {
/** Custom CSS for theming */
customCss: string;
};
export type PublicConfigDto = {
ffmpeg: PublicConfigFFmpegDto;
map: PublicConfigMapDto;
oauth: PublicConfigOAuthDto;
passwordLogin: PublicConfigPasswordLoginDto;
server: PublicConfigServerDto;
theme: PublicConfigThemeDto;
};
export type QueueResponseDto = {
/** Whether the queue is paused */
+4 -1
View File
@@ -10,12 +10,15 @@ import {
import { getKeysDeep } from 'src/utils/misc.js';
const PUBLIC_PROPERTIES = [
'ffmpeg.realtime.enabled',
'map.darkStyle',
'map.enabled',
'map.lightStyle',
'oauth.autoLaunch',
'oauth.buttonText',
'oauth.enabled',
'passwordLogin.enabled',
'server.loginPageMessage',
'theme.customCss',
];
describe('config visibility', () => {
+5 -7
View File
@@ -115,7 +115,7 @@ const AdminConfigFFmpegSchema = z
tonemap: ToneMappingSchema,
realtime: z
.object({
enabled: configBool.describe('Enable real-time HLS transcoding (alpha)').meta({ visibility: User }),
enabled: configBool.describe('Enable real-time HLS transcoding (alpha)').meta({ visibility: Public }),
videoCodecs: z
.array(VideoCodecSchema)
.describe('Video codecs to use for real-time HLS transcoding')
@@ -262,9 +262,9 @@ const AdminConfigSchemaWithVisibility = z
.meta({ id: 'AdminConfigMachineLearningDto' }),
map: z
.object({
enabled: configBool.describe('Enabled').meta({ visibility: User }),
lightStyle: z.url().describe('Light map style URL').meta({ visibility: User }),
darkStyle: z.url().describe('Dark map style URL').meta({ visibility: User }),
enabled: configBool.describe('Enabled').meta({ visibility: Public }),
lightStyle: z.url().describe('Light map style URL').meta({ visibility: Public }),
darkStyle: z.url().describe('Dark map style URL').meta({ visibility: Public }),
})
.meta({ id: 'AdminConfigMapDto' }),
reverseGeocoding: z
@@ -372,9 +372,7 @@ const AdminConfigSchemaWithVisibility = z
days: z.int().min(0).describe('Days').meta({ visibility: User }),
})
.meta({ id: 'AdminConfigTrashDto' }),
theme: z
.object({ customCss: z.string().describe('Custom CSS for theming').meta({ visibility: Public }) })
.meta({ id: 'AdminConfigThemeDto' }),
theme: z.object({ customCss: z.string().describe('Custom CSS for theming') }).meta({ id: 'AdminConfigThemeDto' }),
library: z
.object({
scan: z