Get started
In this guide you run your first script through the proxy: a PowerShell script on a Windows server inside your network, triggered from a package. The proxy runs on Windows and Linux; this guide uses a Windows server as the example. It uses the recommended defaults: the Script execution mode and the pull transport mode, so no inbound firewall openings are needed.
1. Install the proxy
Follow Install the proxy to install the proxy on the server and register it as a service. While you are there, generate the encryption key you will need in the next steps:
node bin/secret
2. Create the Proxy account
In the automator, add an account of type Proxy to your environment:
- Transport: Pull (the default).
- Execution mode: Script.
- Token: choose a token; you will configure the same value on the proxy.
- Key: the encryption key generated in step 1.
Save the account and copy the Automator URL shown on the form; the proxy polls this URL for work.
3. Configure a profile on the proxy
On the Windows server, create the script the package will run, for example scripts/hello.ps1:
param([string]$Name)
Write-Output "Hello, $Name"
Then add a profile to the proxy's conf.json that matches the account, with the script on its allowlist:
{
"profiles": [
{
"name": "getting-started",
"active": true,
"mode": "script",
"token": "<the token from the account>",
"key": "<the key generated in step 1>",
"automator_url": "<the Automator URL copied from the account>",
"shell": "powershell",
"commands": {
"hello": {
"script": "scripts/hello.ps1",
"params": ["-Name"]
}
}
}
]
}
Restart the proxy service so it picks up the new profile.
4. Verify the connection
Back on the Proxy account form, use Verify to check that the automator and the proxy can reach each other and that the token and key match.
5. Run the script from a package
Create a package and call executeOnProxy with the name of your
Proxy account:
const result = executeOnProxy("getting-started", {
script: "hello",
parameters: { "-Name": "automator" },
});
log(result.data.stdout); // Hello, automator
Run the package: the automator encrypts the request, the proxy picks it up, runs hello.ps1 on the Windows server,
and the script's output comes back as the result.
Next steps
- Run scripts: configure more scripts with validated parameters.
- Run shell commands: let packages send arbitrary shell commands.
- Configuration: all configuration options of the proxy.
- Security and privacy: how the proxy protects your network and data.