Skip to content

Commit

Permalink
fix(web): use env for web folder path (#5753)
Browse files Browse the repository at this point in the history
* fix: use env for web folder path

* feat: use constant

* fix: use join

* update docs

* fix: icon
  • Loading branch information
martabal authored Dec 16, 2023
1 parent cb1201e commit 2f95cb8
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 12 deletions.
17 changes: 9 additions & 8 deletions docs/docs/install/environment-variables.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,15 @@ These environment variables are used by the `docker-compose.yml` file and do **N

## General

| Variable | Description | Default | Services |
| :-------------------------- | :------------------------------------------- | :----------: | :------------------------------------------- |
| `TZ` | Timezone | | microservices |
| `NODE_ENV` | Environment (production, development) | `production` | server, microservices, machine learning, web |
| `LOG_LEVEL` | Log Level (verbose, debug, log, warn, error) | `log` | server, microservices |
| `IMMICH_MEDIA_LOCATION` | Media Location | `./upload` | server, microservices |
| `PUBLIC_LOGIN_PAGE_MESSAGE` | Public Login Page Message | | web |
| `IMMICH_CONFIG_FILE` | Path to config file | | server |
| Variable | Description | Default | Services |
| :-------------------------- | :------------------------------------------- | :-----------------: | :------------------------------------------- |
| `TZ` | Timezone | | microservices |
| `NODE_ENV` | Environment (production, development) | `production` | server, microservices, machine learning, web |
| `LOG_LEVEL` | Log Level (verbose, debug, log, warn, error) | `log` | server, microservices |
| `IMMICH_MEDIA_LOCATION` | Media Location | `./upload` | server, microservices |
| `PUBLIC_LOGIN_PAGE_MESSAGE` | Public Login Page Message | | web |
| `IMMICH_CONFIG_FILE` | Path to config file | | server |
| `IMMICH_WEB_ROOT` | Path of root index.html | `/usr/src/app/www'` | server |

:::tip

Expand Down
2 changes: 1 addition & 1 deletion docs/src/pages/milestones.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ const items: Item[] = [
title: 'Search improvement with pgvecto.rs',
release: 'v1.91.0',
tag: 'v1.91.0',
date: new Date(2023, 11, 7),
date: new Date(2023, 11, 15),
dateType: DateType.RELEASE,
},
{
Expand Down
4 changes: 3 additions & 1 deletion server/src/domain/domain.constant.ts
Original file line number Diff line number Diff line change
@@ -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 });
Expand Down Expand Up @@ -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'],
Expand Down
3 changes: 2 additions & 1 deletion server/src/immich/app.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -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.');
}
Expand Down
2 changes: 1 addition & 1 deletion web/src/app.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link rel="icon" type="image/x-icon" href="/favicon.ico" />
<link rel="shortcut icon" type="image/x-icon" href="/favicon.ico" />
<link rel="icon" type="image/png" sizes="16x16" href="/favicon-16.png" />
<link rel="icon" type="image/png" sizes="32x32" href="/favicon-32.png" />
<link rel="icon" type="image/png" sizes="48x48" href="/favicon-48.png" />
Expand Down
Binary file modified web/static/favicon.ico
Binary file not shown.

0 comments on commit 2f95cb8

Please sign in to comment.