GitbookIO / nuts

:chestnut: Releases/downloads server with auto-updater and GitHub as a backend
http://nuts.gitbook.com
Apache License 2.0
1.25k stars 300 forks source link

Fix dynamic secret not being used #154

Closed hubdotcom closed 7 years ago

AaronO commented 7 years ago

@hubdotcom I think you may have misread the code, it uses _.defaults so that 'secret' is just a value and will be replaced with opts.refreshSecret.

You can see that we pass the env in bin/web.js: https://github.com/GitbookIO/nuts/blob/0c2c21a250f803931b3a124efec1cbc35b439be1/bin/web.js#L28

AaronO commented 7 years ago

That code you tried to patch gets all its inputs from the opts argument, ENVs should be mapped into an opts object by the caller, in the cli code rather than randomly accessing ENVs everywhere in the code.