mirror of
https://github.com/sct/overseerr.git
synced 2025-09-17 17:24:35 +02:00
feat(server): add CONFIG_DIRECTORY env var to control config directory location
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
const devConfig = {
|
const devConfig = {
|
||||||
type: 'sqlite',
|
type: 'sqlite',
|
||||||
database: 'config/db/db.sqlite3',
|
database: `${process.env.CONFIG_DIRECTORY || 'config'}/db/db.sqlite3`,
|
||||||
synchronize: true,
|
synchronize: true,
|
||||||
migrationsRun: false,
|
migrationsRun: false,
|
||||||
logging: false,
|
logging: false,
|
||||||
@@ -15,7 +15,7 @@ const devConfig = {
|
|||||||
|
|
||||||
const prodConfig = {
|
const prodConfig = {
|
||||||
type: 'sqlite',
|
type: 'sqlite',
|
||||||
database: 'config/db/db.sqlite3',
|
database: `${process.env.CONFIG_DIRECTORY || 'config'}/db/db.sqlite3`,
|
||||||
synchronize: false,
|
synchronize: false,
|
||||||
logging: false,
|
logging: false,
|
||||||
entities: ['dist/entity/**/*.js'],
|
entities: ['dist/entity/**/*.js'],
|
||||||
|
@@ -137,7 +137,11 @@ interface AllSettings {
|
|||||||
notifications: NotificationSettings;
|
notifications: NotificationSettings;
|
||||||
}
|
}
|
||||||
|
|
||||||
const SETTINGS_PATH = path.join(__dirname, '../../config/settings.json');
|
const SETTINGS_PATH = path.join(
|
||||||
|
__dirname,
|
||||||
|
'../../',
|
||||||
|
`${process.env.CONFIG_DIRECTORY || '/config'}/settings.json`
|
||||||
|
);
|
||||||
|
|
||||||
class Settings {
|
class Settings {
|
||||||
private data: AllSettings;
|
private data: AllSettings;
|
||||||
|
@@ -42,7 +42,11 @@ const logger = winston.createLogger({
|
|||||||
),
|
),
|
||||||
}),
|
}),
|
||||||
new winston.transports.DailyRotateFile({
|
new winston.transports.DailyRotateFile({
|
||||||
filename: path.join(__dirname, '../config/logs/overseerr-%DATE%.log'),
|
filename: path.join(
|
||||||
|
__dirname,
|
||||||
|
'../',
|
||||||
|
`${process.env.CONFIG_DIRECTORY || '/config'}/logs/overseerr-%DATE%.log`
|
||||||
|
),
|
||||||
datePattern: 'YYYY-MM-DD',
|
datePattern: 'YYYY-MM-DD',
|
||||||
zippedArchive: true,
|
zippedArchive: true,
|
||||||
maxSize: '20m',
|
maxSize: '20m',
|
||||||
|
Reference in New Issue
Block a user