mdklatt / httpexec

Execute CLI commands over HTTP via a REST API.
MIT License
0 stars 0 forks source link

Need a way to customize the command environment #5

Closed mdklatt closed 1 year ago

mdklatt commented 1 year ago

The expectation is that the target command is executed as if it was called via the command line. In the current implementation, the target command inherits the environment of the calling process, which is httpexec. However, the environment of httpexec is determined by the ASGI server it is being executed by, e.g. Hyperorn. This may vary significantly from the interactive login environment.

There needs to be a way to modify the target application's environment, i.e. an environment parameter that takes a mapping. Should this replace the default execution environment entirely or just modify it?

mdklatt commented 1 year ago

The target command should inherit the parent process environment, and use the environment parameter to specify overrides. The default empty environment leaves the process environment as-is.

mdklatt commented 1 year ago

Issue resolved by commit 286dba57ed26a836d44a5e3bce5c505ae0877ce6.