I was really excited when I came across Caddy, everything seemed to be so easy and fast to set up! However, I’ve now reached a bit of a pickle.
I’m trying to create a quick CGI node.js script that can execute a shutdown on Windows, using shutdown.exe that is available in CMD and PS. When executing the script directly, it works without a problem. Executing through Caddy, however, will result in a:
The system could not find the environment option that was entered.(203)
I’ve tried passing as many ENV variables as I can to the CGI script… The only shell commands that work are extremely basic ones such as cd, dir, echo, … I can spawn a new instance of CMD, PS, however, they inherit the same problem. It’s impossible to execute any executable files by absolute path, the same error applies…
This is not a problem with node. Even a simple batch script:
shutdown -s -t 600 2>&1
yields the same error when viewed in the browser…
While this seems like a small thing, I understood that caddy was designed as a super-simple web server, giving you power at your fingertips with minimal configuration. Plain old CGI seems like an incredibly elegant solution to run scripts/node.js/php on demand without any additional configuration in a dirty development enviroment, but why is it so heavily sandboxed? Or am I missing something here?
A reply would be greatly appreciated! Thank you for your amazing software!