Skip to main content

Configuration

The proxy reads its settings from two files in the proxy directory:

  • Windows service settings (service_config.json): the service name, the port, and the SSL certificate.
  • Proxy settings (conf.json): global limits and the execution profiles.

Annotated examples ship with the proxy as service_config.json.sample and conf.json.sample. The examples below show the recommended setup with the pull transport mode, where the proxy opens all connections itself.

Windows service settings

service_config.json configures the Windows service and the HTTP server:

KeyDefaultDescription
nametechwork-automator-proxy-serviceWindows service name
descriptiontechwork automator proxy service sslWindows service description
port8043 (HTTPS) / 8040 (HTTP)Port the server listens on
route_prefixexecuteURL prefix for the API routes
ssl_key_pathPath to SSL private key file (enables HTTPS)
ssl_cert_pathPath to SSL certificate file (enables HTTPS)

With the pull transport mode, the automator never connects to the proxy, so the endpoint and SSL certificate are not used and a minimal configuration suffices:

{
"name": "techwork-automator-proxy-service",
"description": "techwork automator proxy service",
"port": "8040"
}

Profiles using the push transport mode do accept incoming requests; for those, set both ssl_key_path and ssl_cert_path so the endpoint is served over HTTPS.

When the proxy is started directly instead of as a service, the environment variables PORT and ROUTE_PREFIX override the port and the URL prefix.

Proxy settings

conf.json holds the global settings and the execution profiles.

Global settings

KeyDefaultDescription
max_call_stack_count10000Maximum number of queued requests before the throttle rejects with overflow
throttle_calls_per_sec100Number of requests executed per second
logfilelog/execproxy.logPath to the log file

Profiles

The profiles array defines the execution targets. Each profile matches one Proxy account on the automator platform:

KeyRequiredDefaultDescription
nameYesUnique profile identifier
activeYesWhether the profile is enabled
modeYesExecution mode: exec or script
tokenYesAuthentication token (must match the Proxy account's token)
keyYesEncryption key (must match the Proxy account's key). Script mode requires exactly 64 hexadecimal characters (256 bits); generate one with node bin/secret
commandsScript mode onlyThe scripts a package may run. Maps each command name to its definition: script (path to the script file; relative paths resolve against working_dir) and params (array of allowed parameter names, including their - or -- prefix)
automator_urlNoThe Automator URL shown on the Proxy account form. When set, the profile uses the pull transport mode; when omitted, it listens for pushes at /execute/<name>.
shellNoShell type: powershell (runs powershell.exe), unix (/bin/bash), or cmd (cmd.exe)
shell_pathNobased on shellCustom shell executable path (overrides the default for shell)
working_dirNoWorking directory for the child process. Relative paths resolve against the proxy directory, so scripts means the scripts folder inside the proxy installation
init_cmdNoCommand prefix prepended to the actual command (e.g. powershell.exe -c)
env_varsNo["PATH"]List of environment variable names to pass to the executed command

Example profile

A script-mode profile using the pull transport mode, allowing packages to run a single PowerShell script (createUser.ps1) with two parameters:

{
"name": "execute_ps_script",
"active": true,
"mode": "script",
"token": "<your-token>",
"key": "<your-secret-key>",
"automator_url": "<the Automator URL copied from the account>",
"working_dir": "scripts",
"shell": "powershell",
"commands": {
"createUser": {
"script": "createUser.ps1",
"params": ["-Name", "-Department"]
}
}
}