diff --git a/.DS_Store b/.DS_Store index 21dc07c..c328838 100644 Binary files a/.DS_Store and b/.DS_Store differ diff --git a/.gitignore b/.gitignore index 75f5286..7cd4f74 100644 --- a/.gitignore +++ b/.gitignore @@ -14,3 +14,4 @@ dist/ *.key *.csr *.srl +.DS_Store diff --git a/.goreleaser.yml b/.goreleaser.yml index cddacc9..a5394a3 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -1,17 +1,34 @@ builds: - - goos: + - id: speedrun + main: ./cmd/speedrun + binary: speedrun + goos: - linux - - windows - darwin goarch: - amd64 - arm64 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: - - replacements: - amd64: x86_64 + - id: speedrun format: zip + name_template: "{{ .Binary }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}" + builds: + - speedrun + - id: portal + format: zip + name_template: "{{ .Binary }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}" + builds: + - portal checksum: name_template: "checksums.txt" snapshot: diff --git a/CHANGELOG.md b/CHANGELOG.md index d47d0f7..1059f14 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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) diff --git a/Makefile b/Makefile index f974bcd..7fb42b5 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,6 @@ GITCOMMIT=$(shell git rev-parse --short HEAD 2>/dev/null) DATE=$(shell date -u +"%Y-%m-%dT%H:%M:%SZ") -VERSION=$(shell git branch --show-current) +VERSION=$(shell git describe --tags) DIST=dist LINUX_PATH=$(DIST)/linux DARWIN_PATH=$(DIST)/darwin diff --git a/README.md b/README.md index 3541ca7..1ec63b9 100644 --- a/README.md +++ b/README.md @@ -32,7 +32,7 @@ This project satisfies a simple need: to be able to perform certain type of oper ## Installation -#### MacOS, Linux, Windows +#### MacOS, Linux Download the precompiled binaries from here: [Releases](https://github.com/dpogorzelski/speedrun/releases) @@ -63,12 +63,12 @@ speedrun run whoami --insecure

#### 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 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. #### Service Discovery -There is no server component in Speedrun's architecture. Service discovery is performed against native facilities of each supported provider such as GCP,AWS or Consul. +There is no server component in Speedrun's architecture. Service discovery is performed against native facilities of each supported provider such as GCP, AWS or Consul. This eliminates the need to deploy,maintain and operate a server and all problems that would come with it as a consequence, such as: scalability, failure tolerance, redundancy, agent lifecycle management etc. ![Service Discovery](assets/service-discovery-sequence.png) @@ -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). #### Plugins -TODO +Plugins will allow you to add custom commands without altering the source code. This is not implemented yet. ## Examples Stop Nginx on VMs that have a label `role` with value `nginx` and a label named `project` with value `someproject` ```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. ```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 @@ -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`. -#### Run portal as a systemd unit -TODO +#### Run Portal as a systemd service +Find a sample unit [here](init/portal.service) #### Use self signed certificates during testing In the [scripts](scripts/) folder you can find scripts that will help you generate: diff --git a/assets/architecture-overview.png b/assets/architecture-overview.png index 16efe1b..f146c62 100644 Binary files a/assets/architecture-overview.png and b/assets/architecture-overview.png differ