Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 27 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ For Linux users, you can use either the archive from golang.org, or install from
```shell script
# pacman -S go
```

2. Then, clone the repository:

```shell script
Expand All @@ -59,10 +59,10 @@ can now proceed to build `librespeed-cli` with the build script:

If you want to build for another operating system or system architecture, use the `GOOS` and `GOARCH` environment
variables. Run `go tool dist list` to get a list of possible combinations of `GOOS` and `GOARCH`.

Note: Technically, the CLI can be compiled with older Go versions that support Go modules, with `GO111MODULE=on`
set. If you're compiling with an older Go runtime, you might have to change the Go version in `go.mod`.

```shell script
# Let's say we're building for 64-bit Windows on Linux
$ GOOS=windows GOARCH=amd64 ./build.sh
Expand All @@ -74,7 +74,7 @@ can now proceed to build `librespeed-cli` with the build script:
$ ls out
librespeed-cli-windows-amd64.exe
```

5. Now you can use the `librespeed-cli` and test your Internet speed!

## Install from AUR
Expand All @@ -97,6 +97,26 @@ $ makepkg -si

See the [librespeed-cli Homebrew tap](https://github.com/librespeed/homebrew-tap#setup).

## Container Image

You can run `librespeed-cli` in a container.

1. Build the container image:

```shell script
docker build -t librespeed-cli:latest .
```

2. Run the container:

```shell script
docker run --rm --name librespeed-cli librespeed-cli:latest
# With options
docker run --rm --name librespeed-cli librespeed-cli:latest --telemetry-level disabled --no-upload
# To avoid "Failed to ping target host: socket: permission denied" errors when using --verbose
docker run --rm --name librespeed-cli --sysctl net.ipv4.ping_group_range="0 2147483647" librespeed-cli:latest --verbose
```

## Usage

You can see the full list of supported options with `librespeed-cli -h`:
Expand Down Expand Up @@ -145,15 +165,15 @@ GLOBAL OPTIONS:
multiple times. Cannot be used with --server
--server-json value Use an alternative server list from remote JSON file
--local-json value Use an alternative server list from local JSON file,
or read from stdin with "--local-json -".
or read from stdin with "--local-json -".
--source SOURCE SOURCE IP address to bind to
--timeout TIMEOUT HTTP TIMEOUT in seconds. (default: 15)
--duration value Upload and download test duration in seconds (default: 15)
--chunks value Chunks to download from server, chunk size depends on server configuration (default: 100)
--upload-size value Size of payload being uploaded in KiB (default: 1024)
--secure Use HTTPS instead of HTTP when communicating with
LibreSpeed.org operated servers (default: false)
--skip-cert-verify Skip verifying SSL certificate for HTTPS connections (self-signed certs) (default: false)
--skip-cert-verify Skip verifying SSL certificate for HTTPS connections (self-signed certs) (default: false)
--no-pre-allocate Do not pre allocate upload data. Pre allocation is
enabled by default to improve upload performance. To
support systems with insufficient memory, use this
Expand Down Expand Up @@ -205,7 +225,7 @@ As you can see in the example, all servers have their schemes defined. In case o
`librespeed-cli` will use `http` by default, or `https` when the `--secure` option is enabled.

## Use a custom telemetry server
By default, the telemetry result will be sent to `librespeed.org`. You can also customize your telemetry settings
By default, the telemetry result will be sent to `librespeed.org`. You can also customize your telemetry settings
via the `--telemetry` prefixed options. In order to load a custom telemetry endpoint configuration, you'll have to use the
`--telemetry-json` option to specify a local JSON file containing the configuration bits. The format is as below:

Expand Down
17 changes: 17 additions & 0 deletions dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
FROM golang:1.17.7-buster as builder

# Set working directory
WORKDIR /usr/src/librespeed-cli

# Copy librespeed-cli
COPY . .

# Build librespeed-cli
RUN ./build.sh

FROM golang:1.17.7-buster

# Copy librespeed-cli binary
COPY --from=builder /usr/src/librespeed-cli/out/librespeed-cli* /usr/src/librespeed-cli/librespeed-cli

ENTRYPOINT ["/usr/src/librespeed-cli/librespeed-cli"]