@@ -10,7 +10,7 @@ import generatePassword from 'password-generator'
1010import { getAppList , getAppSchema , getSpec } from 'src/app'
1111import Db from 'src/db'
1212import { DeployLockError , PublicUrlExists , ValidationError } from 'src/error'
13- import { cleanAllSessions , cleanSession , DbMessage , getIo , getSessionStack } from 'src/middleware'
13+ import { DbMessage , cleanAllSessions , cleanSession , getIo , getSessionStack } from 'src/middleware'
1414import {
1515 App ,
1616 Core ,
@@ -37,7 +37,6 @@ import {
3737 removeBlankAttributes ,
3838} from 'src/utils'
3939import {
40- cleanEnv ,
4140 CUSTOM_ROOT_CA ,
4241 EDITOR_INACTIVITY_TIMEOUT ,
4342 GIT_BRANCH ,
@@ -48,6 +47,7 @@ import {
4847 GIT_USER ,
4948 TOOLS_HOST ,
5049 VERSIONS ,
50+ cleanEnv ,
5151} from 'src/validators'
5252import { parse as parseYaml , stringify as stringifyYaml } from 'yaml'
5353
@@ -198,7 +198,11 @@ export default class OtomiStack {
198198 editSettings ( data : Settings , settingId : string ) {
199199 const settings = this . db . db . get ( 'settings' ) . value ( )
200200 // do not merge as oneOf properties cannot be merged
201- // settings[settingId] = merge(settings[settingId], data[settingId])
201+ // for the policies we do want to merge
202+ if ( data . policies ) {
203+ Object . assign ( settings . policies , data . policies )
204+ Object . assign ( data [ settingId ] , settings . policies )
205+ }
202206 settings [ settingId ] = removeBlankAttributes ( data [ settingId ] as Record < string , any > )
203207 this . db . db . set ( 'settings' , settings ) . write ( )
204208 return settings
0 commit comments