File tree Expand file tree Collapse file tree 1 file changed +13
-11
lines changed
src/common/config/app-config Expand file tree Collapse file tree 1 file changed +13
-11
lines changed Original file line number Diff line number Diff line change @@ -5,6 +5,7 @@ import * as yaml from 'js-yaml';
55
66import { registerAs } from '@nestjs/config' ;
77
8+ import { isProduction } from '@common/utils/startup-app' ;
89import { EVENTS } from '@libs/contracts/constants' ;
910
1011const 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
6172export 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 : { } } ;
You can’t perform that action at this time.
0 commit comments