Skip to main content
BeRadB
Inspiring
January 8, 2020
Question

docker cold fusion 2018 cgi scope

  • January 8, 2020
  • 1 reply
  • 1221 views

I just stood up my first docker image on my local computer, and have the app working next to the CGI variables I need. How do I get those when I hit the web page of the user hitting the web page. CGI.Auth_user in particular?

 

This topic has been closed for replies.

1 reply

Charlie Arehart
Community Expert
Community Expert
January 8, 2020

You'll need to provide us more info. Many of the CGI vars (like that one) are actually controlled by the web server that fronts CF. What are you using?

 

By default, the CF Docker images run your traffic through the built-in web server within CF (port 8500). You may be using that (you'd know, based on whethr you exposed that port in your docker run or compose file, or other orchestration config).

 

Or you could well have implemented some web server like nginx or apache, or even IIS, whether within a container also or on your host (talking to the container).

 

Whichever web server you are using, you would then have to have enabled security for the web site in question, since you're expecting to see cgi.auth_user variable to be populated . What form of security did you enable in teh web server you're using? 

 

Or might it be that you did not enable any other web server, and are just using "the one in the CF docker image". In that case, it has no such web site security enabled, by default. So you should not expect to see that variable populated. If it's simply that it's blank, it should be, so you should change your code to work accordingly.

 

Or enable security within whichever web server you are using to talk to the CF container.

 

Let us know what you think.

/Charlie (troubleshooter, carehart. org)
BeRadB
BeRadBAuthor
Inspiring
January 8, 2020

Thanks Charlie ,

I'm using what comes default in docker, no iis or apache. currently, I'm only using docker on my local desktop to test and dev with. I have a way to fudge the nt username for now. I didn't know I had another step to take to get the cgi vars, in ye olden days I just turned in iis I just turned on the windows authentication method. Moving forward I believe that the prod environment won't be windows and i don't know what I would need to do to get that going.  do you know of a resource i can look at that might help to get started with that?

 

by the way, caught a few of your sessions at the 2019 CF summit, good stuff, learned a lot!

 

Iambradb.com Adobe ColdFusion Specialist.
Community Expert
January 8, 2020

The Docker image uses the built-in CF web server, which is basically just Tomcat. So I'd look at enabling basic authentication in Tomcat. I haven't actually done this with Tomcat - it's easier to do with regular "production" web servers like IIS and Apache HTTPD - but it's definitely doable. Here's the first resource I found when searching for "basic authentication tomcat":

 

http://sureshatt.blogspot.com/2016/05/enable-basic-authentication-for-webapps.html

 

Dave Watts, Eidolon LLC

Dave Watts, Eidolon LLC