refactor(server): version logic (#9615)

* refactor(server): version

* test: better version and log checks
This commit is contained in:
Jason Rasmussen 2024-05-20 20:31:36 -04:00 committed by GitHub
parent 5f25f28c42
commit 1df7be8436
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
19 changed files with 404 additions and 509 deletions

View file

@ -1,7 +1,11 @@
import { Duration } from 'luxon';
import { readFileSync } from 'node:fs';
import { join } from 'node:path';
import { Version } from 'src/utils/version';
import { SemVer } from 'semver';
export const POSTGRES_VERSION_RANGE = '>=14.0.0';
export const VECTORS_VERSION_RANGE = '0.2.x';
export const VECTOR_VERSION_RANGE = '>=0.5 <1';
export const NEXT_RELEASE = 'NEXT_RELEASE';
export const LIFECYCLE_EXTENSION = 'x-immich-lifecycle';
@ -11,7 +15,7 @@ export const ADDED_IN_PREFIX = 'This property was added in ';
export const SALT_ROUNDS = 10;
const { version } = JSON.parse(readFileSync('./package.json', 'utf8'));
export const serverVersion = Version.fromString(version);
export const serverVersion = new SemVer(version);
export const AUDIT_LOG_MAX_DURATION = Duration.fromObject({ days: 100 });
export const ONE_HOUR = Duration.fromObject({ hours: 1 });