zapty / forever-service

Provision node script as a service via forever, allowing it to automatically start on boot, working across various Linux distros and OS
https://github.com/zapty/forever-service
MIT License
594 stars 65 forks source link

"Invalid env variable" error when environment variable contains "=" #78

Closed nemecec closed 7 years ago

nemecec commented 7 years ago

I have an environment variable: MONGO_URI="mongodb://user:password@host1:15145,host2:15145/db-name?ssl=true"

This should be perfectly legal environment variable. However, forever service script assumes that there are no "=" characters in the environment variable value and reports an error.

Fix: When splitting the environment variable definition to get variable name, just use the first "=" character.

paivaric commented 7 years ago

same issue

mfa777 commented 7 years ago

not yet solved.

arvind-agarwal commented 7 years ago

can someone send me a pull request for this fix?

jdamon96 commented 7 years ago

Also having this issue. @nemecec can you rephrase your fix in other words? I don't quite understand it

zedar187 commented 7 years ago

@arvind-agarwal: I've made a pull request (my first one on github \o/) with a quick fix. The code searches for the first apearrance of an = symbol and uses the rest as a whole env variable value.

arvind-agarwal commented 7 years ago

Fixed in 0.5.10