This guide will help you get started effectively using runners. You can run everything on your own machine.
However, you should set up a VPS in order to have your runners available 24/7.
There are many platforms to choose from, such as:
Running runners on your host machine is the easiest way to get started.
PATHTo install the runner, run the following command in your terminal:
You can also use curl:
The script will install the runner on your machine on path: $HOME/.local/bin
You should probably have this path in your PATH environment variable.
To configure and register the runner, you should visit the New Runner page.
New one-time-token will be generated for you to register your runner.
You can simply copy the command shown on that page and run it on your terminal. The command looks like following:
You can also set the name and the workdir using flags. Important thing to
note is that --unattended flags use flag value and/or default values without
asking for confirmation.
By default, the runner is named as your hostname, and the workdir is set to
$HOME/.bountyhub/runner/<runner_name>.
If you are configuring the runner to run 24/7, you should run it as a service.
Few important things to note before running as a service:
root user, or have
sudo privileges.systemd based, so your system must be using systemd as
init system.sudo command to elevate privileges
so you can install the service, make sure you run sudo -E to preserve the
environment variables. That way, there are no surprises when the service is
started.The runner knows how to install itself as a service. To do so, you can run:
The --name flag is optional. If you used the default name, you don't need to
provide it.
Otherwise, the name is important since you can have multiple runners running as a service on your machine.
After installing the service, you can start it using:
You can also stop and uninstall the service using:
If you want to run the runner in the foreground (testing locally), you can simply run:
This will start the runner in the foreground, and you will see the logs in your terminal.
As part of the runner release, the docker image is also published to Docker Hub.
The image can be found on
Docker Hub,
and this
Dockerfile is
used to build the image.
As you can see, the runner image is only shipping the runner and bh CLI
binaries. It is designed this way so you can build your own custom image, while
using officially provided image as a base. That way, you can copy the binaries,
while being able to install tools you need.
Otherwise, all tools would have to be included inside the image, while still not solving the issue of you being able to run proprietary tools.
Here is an example Dockerfile that uses the official runner image as a base, and instal some tools.
To build the image, you can run the following command in the directory where your Dockerfile is located:
To run the container, you first need to generate the config file used to store credentials.
After generating the config file, you can run the container using the following command:
Currently Reading
Getting Started with Runners