From 800760054e8b0cdf79bfdbc892d7cbef84e0fc8c Mon Sep 17 00:00:00 2001 From: Maddie Zhan Date: Sat, 18 Sep 2021 01:58:35 +0800 Subject: [PATCH] Embed tzdata and rootcerts in binary For use in environments without tzdata or root certs (like embedded devices) Fixes #29 --- go.mod | 1 + go.sum | 2 ++ main.go | 6 ++++-- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/go.mod b/go.mod index cd1b7ec..ce78a8a 100644 --- a/go.mod +++ b/go.mod @@ -3,6 +3,7 @@ module github.com/librespeed/speedtest go 1.16 require ( + github.com/breml/rootcerts v0.1.0 // indirect github.com/fsnotify/fsnotify v1.5.1 // indirect github.com/go-chi/chi/v5 v5.0.4 github.com/go-chi/cors v1.2.0 diff --git a/go.sum b/go.sum index b7e1930..bf56dc8 100644 --- a/go.sum +++ b/go.sum @@ -45,6 +45,8 @@ github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da/go.mod h1:Q73ZrmV github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= github.com/bketelsen/crypt v0.0.4/go.mod h1:aI6NrJ0pMGgvZKL1iVgXLnfIFJtfV+bKCoqOes/6LfM= +github.com/breml/rootcerts v0.1.0 h1:jf/F4MHeXBi7FVAHrPq+/MBmPlGXTbUAyR977bZ0j4E= +github.com/breml/rootcerts v0.1.0/go.mod h1:24FDtzYMpqIeYC7QzaE8VPRQaFZU5TIUDlyk8qwjD88= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= diff --git a/main.go b/main.go index 0bf0ed4..5560ca7 100644 --- a/main.go +++ b/main.go @@ -2,13 +2,15 @@ package main import ( "flag" - - log "github.com/sirupsen/logrus" + _ "time/tzdata" "github.com/librespeed/speedtest/config" "github.com/librespeed/speedtest/database" "github.com/librespeed/speedtest/results" "github.com/librespeed/speedtest/web" + + _ "github.com/breml/rootcerts" + log "github.com/sirupsen/logrus" ) var (