wildduck-dockerized
wildduck-dockerized copied to clipboard
wildduck config has breaking changes on non-breaking versioning
/wildduck/api.js:147
origins: [].concat(config.api.cors.origins || ['*']),
^
TypeError: Cannot read property 'origins' of undefined
This looks to be an issue with wildduck itself, moving the issue.
In the meantime you can add the new cors configuration, or use an older version.
I looked into it a little. You could say that its an issue in the default configuration of the docker container (see https://github.com/nodemailer/wildduck-dockerized/blob/9f85a9cdb8740588851c187dc3a6218475cf6b28/default-config/wildduck/api.toml#L56) or an issue of wildduck itself as its not expecting cors not be undefined. Eiter could get fixed quite easily
by appending
[cors]
origins = ["*"]
or by adding a nullish check
origins: [].concat(config.api.cors?.origins ?? ['*']),
Anyone upgrading wildduck with their old config would get the error as well, so definitely a wildduck issue heheh.
I don't have much time right now, but feel free to send in a pr with a fix if you can fix it 😁
alright
WildDuck is meant to be managed in a way where production config is merged (not replaced) with the default config. So the cors (or any other) key should be available if it is listed in the default config. wildduck-dockerized uses a fixed config which is a problem in this case as there are going to be new keys added to the config in the future as well. It should probably be kept up to date to reflect the new keys or it should merge config files.
Hmm, I wasn't aware of this. That sounds like a bit of a nightmare to me. IMO a new required config option is a breaking change. I'll have to redo the way wildduck-dockerized manages the configs if that's the case.
I've merged the latest wildduck config with the config in this repo. But I'll still have to find another way to do this in the future, so I'm keeping this issue open with another title.