Skip to content

Commit c80d099

Browse files
authored
ACL changes should not blow away cert config
When editing an access list, all affected sites get their config updated without certificates, functionally breaking https on those sites until they get a manual config change that rewrites the config properly. Properly fetch the certificate from the DB before `bulkGenerateConfigs` so it gets updated right. I am not certain whether there are similar bugs in other places that use `bulkGenerateConfigs`. Should fix #2254
1 parent fd30cfe commit c80d099

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

backend/internal/access-list.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ const internalAccessList = {
218218
// re-fetch with expansions
219219
return internalAccessList.get(access, {
220220
id: data.id,
221-
expand: ['owner', 'items', 'clients', 'proxy_hosts.access_list.[clients,items]']
221+
expand: ['owner', 'items', 'clients', 'proxy_hosts.[certificate,access_list.[clients,items]]']
222222
}, true /* <- skip masking */);
223223
})
224224
.then((row) => {
@@ -256,7 +256,7 @@ const internalAccessList = {
256256
.joinRaw('LEFT JOIN `proxy_host` ON `proxy_host`.`access_list_id` = `access_list`.`id` AND `proxy_host`.`is_deleted` = 0')
257257
.where('access_list.is_deleted', 0)
258258
.andWhere('access_list.id', data.id)
259-
.allowEager('[owner,items,clients,proxy_hosts.[*, access_list.[clients,items]]]')
259+
.allowEager('[owner,items,clients,proxy_hosts.[certificate,access_list.[clients,items]]]')
260260
.omit(['access_list.is_deleted'])
261261
.first();
262262

0 commit comments

Comments
 (0)