chore(server): use dev version check endpoint for non-production environments (#27508)

This commit is contained in:
Zack Pollard
2026-04-05 10:52:59 +01:00
committed by GitHub
parent 776b9cbad5
commit 196307bca5
5 changed files with 16 additions and 18 deletions
@@ -75,6 +75,10 @@ export interface EnvData {
server: string;
};
versionCheck: {
url: string;
};
network: {
trustedProxies: string[];
};
@@ -320,6 +324,10 @@ const getEnv = (): EnvData => {
licensePublicKey: isProd ? productionKeys : stagingKeys,
versionCheck: {
url: isProd ? 'https://version.immich.cloud/version' : 'https://version.dev.immich.cloud/version',
},
network: {
trustedProxies: dto.IMMICH_TRUSTED_PROXIES ?? ['linklocal', 'uniquelocal'],
},
@@ -66,7 +66,8 @@ export class ServerInfoRepository {
async getLatestRelease(): Promise<VersionResponse> {
try {
const response = await fetch('https://version.immich.cloud/version');
const { versionCheck } = this.configRepository.getEnv();
const response = await fetch(versionCheck.url);
if (!response.ok) {
throw new Error(`Version check request failed with status ${response.status}: ${await response.text()}`);