mirror of
https://github.com/xuthus83/pigallery2.git
synced 2025-01-14 14:43:17 +08:00
Log Log Log...
This commit is contained in:
parent
15c79ad68d
commit
f007037bc5
@ -27,8 +27,9 @@ export class SettingsMWs {
|
|||||||
try {
|
try {
|
||||||
let settings = req.body.settings; // Top level settings JSON
|
let settings = req.body.settings; // Top level settings JSON
|
||||||
const settingsPath: string = req.body.settingsPath; // Name of the top level settings
|
const settingsPath: string = req.body.settingsPath; // Name of the top level settings
|
||||||
|
|
||||||
const transformer = await Config.original();
|
const transformer = await Config.original();
|
||||||
|
console.log('pre settings');
|
||||||
|
console.log(settings);
|
||||||
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
transformer[settingsPath] = settings;
|
transformer[settingsPath] = settings;
|
||||||
@ -37,6 +38,8 @@ export class SettingsMWs {
|
|||||||
settings = ConfigClassBuilder.attachPrivateInterface(transformer[settingsPath]).toJSON({
|
settings = ConfigClassBuilder.attachPrivateInterface(transformer[settingsPath]).toJSON({
|
||||||
skipTags: {secret: true} as TAGS
|
skipTags: {secret: true} as TAGS
|
||||||
});
|
});
|
||||||
|
console.log('post settings');
|
||||||
|
console.log(settings);
|
||||||
const original = await Config.original();
|
const original = await Config.original();
|
||||||
// only updating explicitly set config (not saving config set by the diagnostics)
|
// only updating explicitly set config (not saving config set by the diagnostics)
|
||||||
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
||||||
|
@ -81,12 +81,15 @@ export class PrivateConfigClass extends ServerConfig {
|
|||||||
require('../../../../package.json').buildCommitHash;
|
require('../../../../package.json').buildCommitHash;
|
||||||
this.Environment.upTime = upTime;
|
this.Environment.upTime = upTime;
|
||||||
this.Environment.isDocker = !!process.env.PI_DOCKER;
|
this.Environment.isDocker = !!process.env.PI_DOCKER;
|
||||||
|
console.log('CONFIG', ServerEnvironment);
|
||||||
if (typeof ServerEnvironment.sendMailAvailable !== 'undefined') {
|
if (typeof ServerEnvironment.sendMailAvailable !== 'undefined') {
|
||||||
this.Environment.sendMailAvailable = ServerEnvironment.sendMailAvailable;
|
this.Environment.sendMailAvailable = ServerEnvironment.sendMailAvailable;
|
||||||
if(!this.Environment.sendMailAvailable){ //onNewValue is not yet available as a callback
|
if(!this.Environment.sendMailAvailable){ //onNewValue is not yet available as a callback
|
||||||
this.Messaging.Email.type = EmailMessagingType.SMTP;
|
this.Messaging.Email.type = EmailMessagingType.SMTP;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
console.log('CONFIG', this.Environment.sendMailAvailable);
|
||||||
|
console.log('CONFIG', this.Messaging.Email.type);
|
||||||
}
|
}
|
||||||
|
|
||||||
async original(): Promise<PrivateConfigClass & IConfigClass> {
|
async original(): Promise<PrivateConfigClass & IConfigClass> {
|
||||||
|
@ -1054,9 +1054,11 @@ export class ServerEnvironmentConfig {
|
|||||||
@ConfigProperty<boolean, ServerConfig, TAGS>({
|
@ConfigProperty<boolean, ServerConfig, TAGS>({
|
||||||
volatile: true,
|
volatile: true,
|
||||||
onNewValue: (value, config) => {
|
onNewValue: (value, config) => {
|
||||||
|
console.log('onNewValue', value, config.Messaging.Email.type);
|
||||||
if (value === false) {
|
if (value === false) {
|
||||||
config.Messaging.Email.type = EmailMessagingType.SMTP;
|
config.Messaging.Email.type = EmailMessagingType.SMTP;
|
||||||
}
|
}
|
||||||
|
console.log('onNewValue after', value, config.Messaging.Email.type);
|
||||||
},
|
},
|
||||||
description: 'App updates on start-up if sendmail binary is available'
|
description: 'App updates on start-up if sendmail binary is available'
|
||||||
})
|
})
|
||||||
|
@ -36,6 +36,7 @@ describe('Settings middleware', () => {
|
|||||||
settings: ConfigClassBuilder.attachPrivateInterface(new ServerUserConfig()).toJSON()
|
settings: ConfigClassBuilder.attachPrivateInterface(new ServerUserConfig()).toJSON()
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
console.log('Settings', req);
|
||||||
req.body.settings.enforcedUsers = [];
|
req.body.settings.enforcedUsers = [];
|
||||||
const next: any = (err: ErrorDTO) => {
|
const next: any = (err: ErrorDTO) => {
|
||||||
try {
|
try {
|
||||||
@ -55,7 +56,7 @@ describe('Settings middleware', () => {
|
|||||||
|
|
||||||
ServerEnvironment.sendMailAvailable = false;
|
ServerEnvironment.sendMailAvailable = false;
|
||||||
Config.Environment.sendMailAvailable = false
|
Config.Environment.sendMailAvailable = false
|
||||||
Config.Messaging.Email.type = EmailMessagingType.sendmail;;
|
Config.Messaging.Email.type = EmailMessagingType.sendmail;
|
||||||
const req: any = {
|
const req: any = {
|
||||||
session: {},
|
session: {},
|
||||||
sessionOptions: {},
|
sessionOptions: {},
|
||||||
|
Loading…
x
Reference in New Issue
Block a user