mirror of
https://github.com/immich-app/immich.git
synced 2025-12-20 01:11:46 +03:00
fix(web): use env for web folder path (#5753)
* fix: use env for web folder path * feat: use constant * fix: use join * update docs * fix: icon
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import { AssetType } from '@app/infra/entities';
|
||||
import { Duration } from 'luxon';
|
||||
import { extname } from 'node:path';
|
||||
import { extname, join } from 'node:path';
|
||||
import pkg from 'src/../../package.json';
|
||||
|
||||
export const AUDIT_LOG_MAX_DURATION = Duration.fromObject({ days: 100 });
|
||||
@@ -58,6 +58,8 @@ export const serverVersion = ServerVersion.fromString(pkg.version);
|
||||
|
||||
export const APP_MEDIA_LOCATION = process.env.IMMICH_MEDIA_LOCATION || './upload';
|
||||
|
||||
export const WEB_ROOT_PATH = join(process.env.IMMICH_WEB_ROOT || '/usr/src/app/www', 'index.html');
|
||||
|
||||
const image: Record<string, string[]> = {
|
||||
'.3fr': ['image/3fr', 'image/x-hasselblad-3fr'],
|
||||
'.ari': ['image/ari', 'image/x-arriflex-ari'],
|
||||
|
||||
@@ -7,6 +7,7 @@ import {
|
||||
SharedLinkService,
|
||||
StorageService,
|
||||
SystemConfigService,
|
||||
WEB_ROOT_PATH,
|
||||
} from '@app/domain';
|
||||
import { ImmichLogger } from '@app/infra/logger';
|
||||
import { Injectable } from '@nestjs/common';
|
||||
@@ -67,7 +68,7 @@ export class AppService {
|
||||
ssr(excludePaths: string[]) {
|
||||
let index = '';
|
||||
try {
|
||||
index = readFileSync('/usr/src/app/www/index.html').toString();
|
||||
index = readFileSync(WEB_ROOT_PATH).toString();
|
||||
} catch (error: Error | any) {
|
||||
this.logger.warn('Unable to open `www/index.html, skipping SSR.');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user