question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Heroku environmental variables require extra quotes around values

See original GitHub issue

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.

Issue Analytics

  • State:open
  • Created 6 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
zacwestcommented, Jul 5, 2017

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:

screen shot 2017-07-05 at 10 33 28 am

If I take out the wrapping " around the value, it blows up at b trying to turn that into JSON (since literals aren’t supported in JSON like that).


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:

  • Use the environmental variables to examine the JSON.
  • Require users to fork the repository to configure the values in a file.
  • Run the service yourself and store people’s deploy keys (rather than access tokens) with some kind of admin interface. This option would probably allow a lot more people to use it, but also adds a lot more burden to you.
  • Read a configuration file from the destination site’s .well-known each time a micropub comes in.
  • Allow the service to have an admin interface to configure the rules and store them somewhere.

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.

0reactions
voxpellicommented, Nov 9, 2018

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

Read more comments on GitHub >

github_iconTop Results From Across the Web

environment variables in heroku - Stack Overflow
i have this firebase config file. in my procfile i have: web: NODE_ENV=production node ./src/server/index.js. in my webpack i have:
Read more >
Configuration and Config Vars - Heroku Dev Center
Accessing config var values from code ... Config vars are exposed to your app's code as environment variables. For example, in Node.js you...
Read more >
Configure the Heroku Environment Variables
If you're working from a Windows computer, you may need to replace the single quotes with double quotes ("). Enter this command: heroku...
Read more >
How to set Heroku environmental variables from dotenv (.env ...
Heroku allows you to set and unset environmental variables using their CLI, but manually writing the values is tedious, and sometimes you ...
Read more >
Environment Variables - Travis CI Docs
Define environment variables in your .travis.yml in the env key, ... In particular, if a value contains spaces, you need to put quotes...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found