Skip to content

Commit 1fad9d9

Browse files
committed
Ensure that root .acl file is generated in pre-5.0.0 servers
Closes #977
1 parent ed00615 commit 1fad9d9

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

lib/server-config.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,13 @@ async function ensureWelcomePage (argv) {
5555
serverVersion: packageData.version
5656
})
5757
}
58+
59+
// Ensure that the root .acl file exists,
60+
// because this was not mandatory in before 5.0.0
61+
const existingRootAcl = path.join(serverRootDir, '.acl')
62+
if (!fs.existsSync(existingRootAcl)) {
63+
await fsUtils.copyTemplateDir(path.join(templates.server, '.acl'), existingRootAcl)
64+
}
5865
}
5966

6067
/**
@@ -118,6 +125,13 @@ function initTemplateDirs (configPath) {
118125
path.join(configPath, 'templates', 'server')
119126
)
120127

128+
// Ensure that the root .acl file exists,
129+
// because this was not mandatory in before 5.0.0
130+
ensureDirCopyExists(
131+
path.join(__dirname, '../default-templates/server/.acl'),
132+
path.join(configPath, 'templates', 'server', '.acl')
133+
)
134+
121135
return {
122136
account: accountTemplatePath,
123137
email: emailTemplatesPath,

0 commit comments

Comments
 (0)