Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: immich port with external domain #9856

Merged
merged 2 commits into from
May 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions server/src/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ export const envName = (process.env.IMMICH_ENV || 'production').toUpperCase();
export const isDev = () => process.env.IMMICH_ENV === 'development';
export const APP_MEDIA_LOCATION = process.env.IMMICH_MEDIA_LOCATION || './upload';
export const WEB_ROOT = process.env.IMMICH_WEB_ROOT || '/usr/src/app/www';
const HOST_SERVER_PORT = process.env.IMMICH_PORT || '2283';
export const DEFAULT_EXTERNAL_DOMAIN = 'http://localhost:' + HOST_SERVER_PORT;

const GEODATA_ROOT_PATH = process.env.IMMICH_REVERSE_GEOCODING_ROOT || '/usr/src/resources';

Expand Down
7 changes: 4 additions & 3 deletions server/src/services/notification.service.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { Inject, Injectable } from '@nestjs/common';
import { DEFAULT_EXTERNAL_DOMAIN } from 'src/constants';
import { SystemConfigCore } from 'src/cores/system-config.core';
import { OnServerEvent } from 'src/decorators';
import { AlbumEntity } from 'src/entities/album.entity';
Expand Down Expand Up @@ -63,7 +64,7 @@ export class NotificationService {
const { html, text } = this.notificationRepository.renderEmail({
template: EmailTemplate.WELCOME,
data: {
baseUrl: server.externalDomain || 'http://localhost:2283',
baseUrl: server.externalDomain || DEFAULT_EXTERNAL_DOMAIN,
displayName: user.name,
username: user.email,
password: tempPassword,
Expand Down Expand Up @@ -100,7 +101,7 @@ export class NotificationService {
const { html, text } = this.notificationRepository.renderEmail({
template: EmailTemplate.ALBUM_INVITE,
data: {
baseUrl: server.externalDomain || 'http://localhost:2283',
baseUrl: server.externalDomain || DEFAULT_EXTERNAL_DOMAIN,
albumId: album.id,
albumName: album.albumName,
senderName: album.owner.name,
Expand Down Expand Up @@ -144,7 +145,7 @@ export class NotificationService {
const { html, text } = this.notificationRepository.renderEmail({
template: EmailTemplate.ALBUM_UPDATE,
data: {
baseUrl: server.externalDomain || 'http://localhost:2283',
baseUrl: server.externalDomain || DEFAULT_EXTERNAL_DOMAIN,
albumId: album.id,
albumName: album.albumName,
recipientName: recipient.name,
Expand Down
Loading