# Forgejo Runner The entrypoint script sets up and runs the `forgejo-runner`, including configuring the runner file and managing the registration process. The script supports custom configurations for Forgejo, Docker, and environment variables. It is important to note that using the `command` docker flag will override the entrypoint *by design*, this is to make it compatible with older manual configurations ## Environment Variables ### Required Variables > Only needed during registration of the runner. > After initial registration the runner operates off of the runner. - **`FORGEJO_URL`**: The URL of the Forgejo instance. Default: `http://forgejo:3000` Only needed during registration of the runner. - **`FORGEJO_SECRET`**: Secret used for Forgejo runner creation. Only needed during registration of the runner. - **`RUNNER_TOKEN`**: Token used for runner registration. Only needed during registration of the runner. - **`RUNNER_NAME`** (Optional): Name for the runner. Default: The hostname of the container. ### Optional Configuration Variables - **`DEBUG`**: Enables debug logging. Default: `false` - **`RUNNER_FILE`**: Path to the runner file. Default: `runner.json` - **`CONFIG_FILE`**: Path to the configuration file. Default: `/data/config.yml` - **`ENV_FILE`**: Path to the environment file. Default: `/data/.env` - **`RUNNER_LABELS`**: Labels to attach to the runner. Default: - `docker:docker://code.forgejo.org/oci/node:20-bookworm` - `ubuntu-22.04:docker://catthehacker/ubuntu:act-22.04` - **`DOCKER_HOST`**: Docker host URL. Default: `tcp://docker:2367` - **`DOCKER_CERT_PATH`**: Path to Docker certificates. Default: `/certs/client` - **`DOCKER_TLS_VERIFY`**: Whether Docker TLS verification is enabled. Default: `1` - **`DOCKER_PRIVILEGED`**: Whether to run the container in privileged mode. Default: `false` - **`MAX_REG_ATTEMPTS`**: Maximum number of registration attempts. Default: `10` - **`SKIP_WAIT`**: Whether to skip the wait before starting the runner. Default: `false` ## Notes - The entrypoint will automatically create and configure a `config.yml` file if it does not already exist. - The runner will attempt to connect to the Forgejo instance and register the runner automatically. - If `FORGEJO_SECRET` is not provided, the runner will use the `RUNNER_TOKEN` for registration. - If the registration fails, the script will retry according to the `MAX_REG_ATTEMPTS` value. ## Troubleshooting - **Invalid Configuration**: If the runner does not start, ensure that all required environment variables are set and that the configuration file is valid. - **Network Issues**: Check your `DOCKER_HOST` and `DOCKER_CERT_PATH` to ensure that Docker is properly configured for secure communication. ## License This image is distributed under the MIT license. See the LICENSE file for more details.