Crates.io | phantom_ci |
lib.rs | phantom_ci |
version | 0.1.163 |
source | src |
created_at | 2024-11-29 01:33:31.595778 |
updated_at | 2024-12-12 23:50:37.824063 |
description | Secure Headless Self-Hosted Runner |
homepage | |
repository | |
max_upload_size | |
id | 1465125 |
size | 91,666 |
Phantom CI is a self-hosted runner in that it will detect changes on a repository and process the repository's workflow.toml file. All pipeline commands are run locally, as the user from which phantom_ci was installed and ran. The workflow file exists at the root of the repo and would contain your pipeline shell commands.
This was written with the intention of isolating deployment pipelines from allowing un-owned servers unnecessary access.
Typically, a developer has a few options;
phantom_ci also moves the declaration of the target branch off of the workflow files to its configuration, preventing the branch from which the workflow will run from being tampered with. In combination with a restricted target branch we can achieve the most secure posture possible for a self-hosted runner.
When configuring, if not included target_branch
defaults to "master".
Please use branch restrictions on the target_branch to prevent unauthorized commands from being run (should be best practice).
To solve the obvious issue of receiving notifications when a job fails or to receive job output for debugging, all output of running commands is sent to stdout. (please do not output passwords to stdout). A webhook option with varying levels of verbosity is also up for consideration.
[0] ## name must be integer and correspond to the order in which commands are run
run = "pwd" ## command string
[1]
run = "make build"
[2]
run = "make deploy"
[sys-compare]
path = "https://github.com/helloimalemur/sys-compare"
target_branch = "master"
[elktool]
path = "https://github.com/helloimalemur/ELKTool"
target_branch = "master"
[elktool2] ## section header cannot be the same as another entry
path = "git@github.com:helloimalemur/ELKTool" ## ssh is the recommended protocol to use
target_branch = "test-branch" ## ensure branch exists [issue #3]
DISCORD_WEBHOOK_URL="https://discord.com/api/webhooks/...."
cargo install phantom_ci
Create a file named workflow.toml
at the root of the repo you wish to poll for changes.
## run normally
phantom_ci
## add repo to config file
## https
phantom_ci add https://github.com/your/repo
## ssh (recommended)
phantom_ci add git@github.com:your/repo
## install systemd service file
phantom_ci configure service
cargo clippy -- -D clippy::all
cargo fmt -- --check