NUWCDIVNPT / stigman-watcher

A utility that watches a path for test result files on behalf of a STIG Manager Collection
Other
6 stars 4 forks source link

Running STIGMan Watcher on Windows is not using Environment Variables #39

Closed livesayjesse closed 1 year ago

livesayjesse commented 1 year ago

Hello, I'm trying to deploy STIGMan watcher in our enviornment but it seems I am stuck with using only the command line options. When I try to run the stigman-watcher-win.exe I get the following: error: required option '--api ' not specified

 I have specified all of the required variables here:

image

 And also I edited the .env sample provided with the source code within the same directory. I had to name the file env.env since Windows does not allow me to rename a file with just an extension.
 I would personally love to just deploy this on Linux where the STIG Manager runs natively but we are not allowed SAMBA in our environment so the Linux servers cannot talk to the file share. 

 What I want to do is just setup the stigman-watcher-win.exe as a service to monitor the folders. I can run the command with all the cli options and get it to connect and successully pull in the .ckl. However, I have to use the --prompt command and provide the key each time since it is not actually looking for the variables. Im not sure if i am doing something wrong or if STIGMan Watcher just doesn't support environmental variables on Windows. Thanks!!
cd-rite commented 1 year ago

Hi @livesayjesse Well, the fact that you can run with the command line arguments is a good sign.... Did you close your existing command line terminals and restart after you added the environment variables? They are usually set when the window opens, and don't refresh when you add new ones....That's bitten me more than a few times. Do you see them when you echo/print them from the terminal?

I am also able to create a ".env" file on Windows without an issue... Maybe try that again? Maybe it won't create one if you have extensions hidden, or something?

livesayjesse commented 1 year ago

Yes... So the environmental variables had reset but I also figured out how to rename the .env file. At elast for us you have to rename the file ".env." Windows will then accept the name but drop the last . lol I've never had to do that in Windows so that was new. Now it seems to be reading the .env file just fine. I love easy fixes! Thanks again!

cd-rite commented 1 year ago

Great!!