feat: use go1.16 and resources embedding (#235)
* feat: use go1.16 embedding for resources We want to embed everything that can be easily embedded. We should, at a minimum, replace the downloading of resources and bindata. Ref: https://github.com/ooni/probe/issues/1367. * fix: get rid of bindata and use go embed instead * fix: start unbreaking some automatic tests * fix: fetch resources as part of the mobile build * fix: convert more stuff to go1.16 I still expect many breakages, but we'll fix them. * fix: make the windows CI green * fix: get resources before running QA * fix: go1.16 uses modules by default * hopefully fix all other outstanding issues * fix(QA/telegram.py): add another DC IP address * Apply suggestions from code review
This commit is contained in:
parent
c33af04e29
commit
322394fe63
51 changed files with 439 additions and 778 deletions
|
|
@ -22,6 +22,7 @@ import (
|
|||
"github.com/ooni/probe-cli/v3/internal/engine/netx/bytecounter"
|
||||
"github.com/ooni/probe-cli/v3/internal/engine/probeservices"
|
||||
"github.com/ooni/probe-cli/v3/internal/engine/resources"
|
||||
"github.com/ooni/probe-cli/v3/internal/engine/resourcesmanager"
|
||||
"github.com/ooni/probe-cli/v3/internal/version"
|
||||
)
|
||||
|
||||
|
|
@ -414,12 +415,7 @@ func (s *Session) UserAgent() (useragent string) {
|
|||
|
||||
// MaybeUpdateResources updates the resources if needed.
|
||||
func (s *Session) MaybeUpdateResources(ctx context.Context) error {
|
||||
return (&resources.Client{
|
||||
HTTPClient: s.DefaultHTTPClient(),
|
||||
Logger: s.logger,
|
||||
UserAgent: s.UserAgent(),
|
||||
WorkDir: s.assetsDir,
|
||||
}).Ensure(ctx)
|
||||
return (&resourcesmanager.CopyWorker{DestDir: s.assetsDir}).Ensure()
|
||||
}
|
||||
|
||||
func (s *Session) getAvailableProbeServices() []model.Service {
|
||||
|
|
|
|||
Loading…
Reference in a new issue