Skip to content

Commit 5bbf9d9

Browse files
committed
fix: notification config paths
1 parent eebd2e2 commit 5bbf9d9

File tree

1 file changed

+13
-11
lines changed

1 file changed

+13
-11
lines changed

src/common/config/app-config/notifications.config.ts

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import * as yaml from 'js-yaml';
55

66
import { registerAs } from '@nestjs/config';
77

8+
import { isProduction } from '@common/utils/startup-app';
89
import { EVENTS } from '@libs/contracts/constants';
910

1011
const ALL_EVENTS = [
@@ -56,19 +57,20 @@ Please fix the notifications config file and restart the application.`);
5657
}
5758
}
5859

59-
const CONFIG_FILENAME = 'notifications-config.yml';
60+
const PRODUCTION_CONFIG_PATH = '/var/lib/remnawave/configs/notifications/notifications-config.yml';
61+
62+
const LOCAL_CONFIG_FILENAME = join(
63+
__dirname,
64+
'..',
65+
'..',
66+
'..',
67+
'..',
68+
'..',
69+
'configs/notifications/notifications-config.yml',
70+
);
6071

6172
export default registerAs('notifications', (): NotificationsConfig => {
62-
const configPath = join(
63-
__dirname,
64-
'..',
65-
'..',
66-
'..',
67-
'..',
68-
'..',
69-
'configs/notifications/',
70-
CONFIG_FILENAME,
71-
);
73+
const configPath = isProduction() ? PRODUCTION_CONFIG_PATH : LOCAL_CONFIG_FILENAME;
7274

7375
if (!existsSync(configPath)) {
7476
return { events: {} };

0 commit comments

Comments
 (0)