-
-
Notifications
You must be signed in to change notification settings - Fork 46
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
Heroku environmental variables require extra quotes around values #19
Comments
Thanks for reporting @zacwest! If we can clarify this in the README so that others can have an easier time setting it up, then that would be great. It was a while since I added it myself, so I can't remember if I had any issue with it, but looking at the Heroku web interface for setting config variables it seems to enough to just paste the JSON in there. This is a screenshot from there of the setup I've been running: Were you using the CLI-tool for setting these env variables? Any suggestion on a README addition that would help in the setting of those values? Also – since you're here anyway – any feedback on how easy those JSON settings were to use otherwise? Applying JSON through env-variables is a bit weird and using the rule based fulfills expressions is even weirder, but the fact that one can customize ones setup a lot without having to modify the code one pushes to Heroku is pretty neat. I haven't gotten a lot of feedback from others though about whether it's more neat than weird or whether the weirdness is bigger than the neatness. |
I'm using the website to edit the environmental variables. I believe this is only required for values that are strings. If they are valid JSON, like that object in the screenshot, it's able to parse it. Here's an example of what I'm using that parses without issue: If I take out the wrapping I haven't tried using the more advanced JSON (like the dictionary matching) yet. From my perspective you've got a few options for configuration:
I think the last two, with some kind of dry-run-able transaction support, would be an easier way to get the configuration working. I ended up reverting a few commits to my repo while getting things set up. Now that I think about it, allowing me to specify which branch to commit to would also help. |
Trying to deploy this to Zeit, and am hitting a similar issue when trying to deploy with the environment vars as they are documented:
Removing these specific environment vars allows me to deploy successfully, but it isn't usable because i can't customize the filename path. |
FWIW, escaping these strings with |
Sorry for not being responsive here – life kind of got in the way. Are you @zacwest and @pmarsceill saying that even non-JSON configurations needs quotes and escaping? Plain strings should work with no extra effort at all – else it's a bug |
The environmental variables
MICROPUB_PERMALINK_STYLE
,MICROPUB_MEDIA_FILES_STYLE
,MICROPUB_FILENAME_STYLE
require quotes around the values in the Heroku configuration, though the rest don't. This manifests as "app crashed" in the Heroku logs if you do not include them.I'm guessing it's because the values are parsed as JSON as their first step. It may be worth documenting these keys as requiring the extra quotes because it took me a little while to figure it out. At the very least, hopefully this issue is discoverable.
The text was updated successfully, but these errors were encountered: