mirror of
https://github.com/immich-app/immich.git
synced 2026-05-18 03:10:24 +03:00
chore(server): use dev version check endpoint for non-production environments (#27508)
This commit is contained in:
@@ -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()}`);
|
||||
|
||||
Reference in New Issue
Block a user