microsoft / IIS.ServiceMonitor

An entrypoint process for running IIS in Windows containers
MIT License
126 stars 42 forks source link

Handle environment variables with single or double quotes #42

Closed jdebbink closed 4 years ago

jdebbink commented 5 years ago

Fixes https://github.com/Microsoft/IIS.ServiceMonitor/issues/40

Entity Framework connection strings use single quotes so this was how the issue was discovered.

shirhatti commented 5 years ago

Based on offline conversation with @mcy94w, this fix didn't work. @mcy94w will add repro steps in here

jdebbink commented 5 years ago

@shirhatti @mcy94w can you elaborate on what didn't work? We have been running this for over a month now and haven't had any issue.

shirhatti commented 5 years ago

@mcy94w Can you comment?

jdebbink commented 5 years ago

@mcy94w anything you can share? We have a fork of this and are in production with these changes. We'd rather not continue to maintain a fork.

When I have the following environment variables:

SINGLE 'quote'
DOUBLE "quote"

And then start service monitor I see the following entries in applicationHost.config's environment variables section:

<add name="SINGLE" value="'quote'" />
<add name="DOUBLE" value="&quot;quote&quot;" />
jdebbink commented 5 years ago

@shirhatti @mcy94w

shirhatti commented 5 years ago

ping @mcy94w

mcy94w commented 5 years ago

If would be helpful if you could extend this PR to handle quotation mark in env name.

wealthify-dev commented 4 years ago

@mcy94w it'd be great to push this forward or understand what's holding it back. Are you able to help?

bariscaglar commented 4 years ago

@jhkimnew to comment

jhkimnew commented 4 years ago

@mcy94w left the team long time ago and I don't have any context on this issue. I will investigate this instead of @mcy94w .
@shirhatti Would you let me know why this PR was not approved?

shirhatti commented 4 years ago

Sorry @jhkimnew! It's been long enough that I don't remember what the issue was

jhkimnew commented 4 years ago

Oh, I just realize what @mcy94w wanted to say. He suggested to update to handle the environment name as well as the environment value.

For example, the below two environment variabes should be handled.

set Env'SINGLE'='quote' set Env"DOUBLE"="quote"

jhkimnew commented 4 years ago

I have created a new PR to fix the issue. https://github.com/microsoft/IIS.ServiceMonitor/pull/64

So, I am closing this PR, which is not maintained anymore.