Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

wildduck config has breaking changes on non-breaking versioning #14

Open
networkException opened this issue Apr 5, 2021 · 7 comments
Open

Comments

@networkException
Copy link

/wildduck/api.js:147

origins: [].concat(config.api.cors.origins || ['*']),
                                   ^

TypeError: Cannot read property 'origins' of undefined
@louis-lau
Copy link
Member

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.

@louis-lau louis-lau transferred this issue from nodemailer/wildduck-dockerized Apr 5, 2021
@networkException
Copy link
Author

networkException commented Apr 5, 2021

I looked into it a little. You could say that its an issue in the default configuration of the docker container (see

) 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 ?? ['*']),

@louis-lau
Copy link
Member

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 😁

networkException referenced this issue in networkException/wildduck Apr 5, 2021
This makes the cors config table entirely optional, instead
of previously just the origins key inside the cors table

Resolves #331
@networkException
Copy link
Author

alright

networkException referenced this issue in networkException/wildduck Apr 5, 2021
This makes the cors config table entirely optional, instead
of previously just the origins key inside the cors table

Resolves #331
@andris9
Copy link
Member

andris9 commented Apr 20, 2021

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.

@louis-lau
Copy link
Member

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.

@louis-lau louis-lau transferred this issue from nodemailer/wildduck Sep 15, 2021
@louis-lau louis-lau changed the title wildduck container goes into restart loop directly after setup wildduck config has breaking changes on non-breaking versioning Sep 15, 2021
@louis-lau
Copy link
Member

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants