diff --git a/mobile/lib/utils/openapi_patching.dart b/mobile/lib/utils/openapi_patching.dart index ad073e937..c8f96fefb 100644 --- a/mobile/lib/utils/openapi_patching.dart +++ b/mobile/lib/utils/openapi_patching.dart @@ -28,6 +28,14 @@ final Map> 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', diff --git a/open-api/immich-openapi-specs.json b/open-api/immich-openapi-specs.json index 8a7fb56c5..2294c6a8e 100644 --- a/open-api/immich-openapi-specs.json +++ b/open-api/immich-openapi-specs.json @@ -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": { diff --git a/packages/sdk/src/fetch-client.ts b/packages/sdk/src/fetch-client.ts index 623963433..5dea6b83e 100644 --- a/packages/sdk/src/fetch-client.ts +++ b/packages/sdk/src/fetch-client.ts @@ -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 */ diff --git a/server/src/dtos/config.dto.spec.ts b/server/src/dtos/config.dto.spec.ts index de5355c5d..1b5c4ccfe 100644 --- a/server/src/dtos/config.dto.spec.ts +++ b/server/src/dtos/config.dto.spec.ts @@ -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', () => { diff --git a/server/src/dtos/config.dto.ts b/server/src/dtos/config.dto.ts index 2fa34bca6..ae060cfda 100644 --- a/server/src/dtos/config.dto.ts +++ b/server/src/dtos/config.dto.ts @@ -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