Update documentation and build configuration

This commit is contained in:
2022-01-13 23:15:00 +01:00
parent 66e4b0391e
commit a97572effa
7 changed files with 37 additions and 14 deletions

BIN
.DS_Store vendored

Binary file not shown.

1
.gitignore vendored
View File

@@ -14,3 +14,4 @@ dist/
*.key *.key
*.csr *.csr
*.srl *.srl
.DS_Store

View File

@@ -1,17 +1,34 @@
builds: builds:
- goos: - id: speedrun
main: ./cmd/speedrun
binary: speedrun
goos:
- linux - linux
- windows
- darwin - darwin
goarch: goarch:
- amd64 - amd64
- arm64 - arm64
ldflags: ldflags:
- -s -w -X speedrun/cmd.version={{.Version}} -X speedrun/cmd.commit={{.ShortCommit}} -X speedrun/cmd.date={{.Date}} - -s -w -X github.com/speedrunsh/speedrun/cmd/speedrun/cli.version={{.Version}} -X github.com/speedrunsh/speedrun/cmd/speedrun/cli.commit={{.ShortCommit}} -X github.com/speedrunsh/speedrun/cmd/speedrun/cli.date={{.Date}}
- id: portal
main: ./cmd/portal
binary: portal
goos:
- linux
goarch:
- amd64
- arm64
archives: archives:
- replacements: - id: speedrun
amd64: x86_64
format: zip format: zip
name_template: "{{ .Binary }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}"
builds:
- speedrun
- id: portal
format: zip
name_template: "{{ .Binary }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}"
builds:
- portal
checksum: checksum:
name_template: "checksums.txt" name_template: "checksums.txt"
snapshot: snapshot:

View File

@@ -1,3 +1,8 @@
## 0.3.0-beta1 (2022-01-13)
### Breaking changes
Pretty much complete project pivot and no retro compatibility with previous versions. SSH support was dropped completely and an agent (Portal) was introduced.
You can refer to the README for updated installation and usage info.
## 0.2.2 (2021-08-01) ## 0.2.2 (2021-08-01)

View File

@@ -1,6 +1,6 @@
GITCOMMIT=$(shell git rev-parse --short HEAD 2>/dev/null) GITCOMMIT=$(shell git rev-parse --short HEAD 2>/dev/null)
DATE=$(shell date -u +"%Y-%m-%dT%H:%M:%SZ") DATE=$(shell date -u +"%Y-%m-%dT%H:%M:%SZ")
VERSION=$(shell git branch --show-current) VERSION=$(shell git describe --tags)
DIST=dist DIST=dist
LINUX_PATH=$(DIST)/linux LINUX_PATH=$(DIST)/linux
DARWIN_PATH=$(DIST)/darwin DARWIN_PATH=$(DIST)/darwin

View File

@@ -32,7 +32,7 @@ This project satisfies a simple need: to be able to perform certain type of oper
## Installation ## Installation
#### MacOS, Linux, Windows #### MacOS, Linux
Download the precompiled binaries from here: [Releases](https://github.com/dpogorzelski/speedrun/releases) Download the precompiled binaries from here: [Releases](https://github.com/dpogorzelski/speedrun/releases)
@@ -63,7 +63,7 @@ speedrun run whoami --insecure
</p> </p>
#### Speedrun #### Speedrun
Speedrun is the client. Speedrun is the CLI tool you run on your computer to send commands to your servers. Speedrun is the client. Speedrun is the CLI tool you run on your computer to send commands to your VMs.
#### Portal #### Portal
Portal is the agent running on each server you want to send commands to. It will receive commands sent from Speedrun and respond with the outcome details accordingly. Portal is the agent running on each server you want to send commands to. It will receive commands sent from Speedrun and respond with the outcome details accordingly.
@@ -80,20 +80,20 @@ Communication between Speedrun and Portals is performed via [dRPC](https://githu
Speedrun supports a flexible yet simple expression language to filter Service Discovery results (`--target`), it's based on [antonmedv/expr](https://github.com/antonmedv/expr). Full language definition can be found [here](https://github.com/antonmedv/expr/blob/master/docs/Language-Definition.md). Speedrun supports a flexible yet simple expression language to filter Service Discovery results (`--target`), it's based on [antonmedv/expr](https://github.com/antonmedv/expr). Full language definition can be found [here](https://github.com/antonmedv/expr/blob/master/docs/Language-Definition.md).
#### Plugins #### Plugins
TODO Plugins will allow you to add custom commands without altering the source code. This is not implemented yet.
## Examples ## Examples
Stop Nginx on VMs that have a label `role` with value `nginx` and a label named `project` with value `someproject` Stop Nginx on VMs that have a label `role` with value `nginx` and a label named `project` with value `someproject`
```bash ```bash
speedrun service stop nginx --target "labels.role == 'nginx' and labels.project == 'someproject'" speedrun service stop nginx --target "Labels.role == 'nginx' and Labels.project == 'someproject'"
``` ```
Run arbitrary shell command on the target machines. Ignore Portal's certificate and connect via private IP address. Run arbitrary shell command on the target machines. Ignore Portal's certificate and connect via private IP address.
```bash ```bash
speedrun run "ls -la" --target "labels.env != 'prod'" --insecure --use-private-ip speedrun run "ls -la" --target "Labels.env != 'prod'" --insecure --use-private-ip
``` ```
Use a different config file Use a different config file
@@ -106,8 +106,8 @@ speedrun run whoami -c /path/to/config.toml
Instead of supplying certain flags repeatedly you can persist their behavior in the config file. Default config file is located at `~/.speedrun/config.toml` and default settings can be fetched via `speedrun init --print`. Instead of supplying certain flags repeatedly you can persist their behavior in the config file. Default config file is located at `~/.speedrun/config.toml` and default settings can be fetched via `speedrun init --print`.
#### Run portal as a systemd unit #### Run Portal as a systemd service
TODO Find a sample unit [here](init/portal.service)
#### Use self signed certificates during testing #### Use self signed certificates during testing
In the [scripts](scripts/) folder you can find scripts that will help you generate: In the [scripts](scripts/) folder you can find scripts that will help you generate:

Binary file not shown.

Before

Width:  |  Height:  |  Size: 197 KiB

After

Width:  |  Height:  |  Size: 206 KiB