From 9212301af62eb09ebbb9a5af0594cd7d2c54cb3c Mon Sep 17 00:00:00 2001 From: Maddie Zhan Date: Fri, 3 Apr 2020 09:23:22 +0800 Subject: [PATCH] Update installation instructions --- README.md | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 4bfce32..c6c0870 100644 --- a/README.md +++ b/README.md @@ -35,13 +35,25 @@ Works with mobile versions too. You need Go 1.13+ to compile the binary. -1. Use this to install the binary into your `GOPATH`: +1. Clone this repository: ``` - $ go get github.com/librespeed/speedtest@go + $ git clone github.com/librespeed/speedtest + # Switch to the Go branch + $ git checkout -b go ``` -2. If you have telemetry enabled, +2. Build + ``` + # Change current working directory to the repository + $ cd speedtest + # Compile + $ go build -ldflags "-w -s" -trimpath -o speedtest main.go + ``` + +3. Copy the `assets` directory, `settings.toml` file along with the compiled `speedtest` binary into a single directory + +4. If you have telemetry enabled, - For PostgreSQL/MySQL, create database and import the corresponding `.sql` file under `database/{postgresql,mysql}` ``` @@ -55,13 +67,13 @@ You need Go 1.13+ to compile the binary. database_file="speedtest.db" ``` -3. Put `assets` folder under the same directory as your compiled binary. +5. Put `assets` folder under the same directory as your compiled binary. - Make sure the font files and JavaScripts are in the `assets` directory - You can have multiple HTML pages under `assets` directory. They can be access directly under the server root (e.g. `/example-singleServer-full.html`) - It's possible to have a default page mapped to `/`, simply put a file named `index.html` under `assets` -4. Change `settings.toml` according to your environment: +6. Change `settings.toml` according to your environment: ```toml # bind address, use empty string to bind to all interfaces