Skip to content

Building

Lucas Teske edited this page Apr 4, 2019 · 1 revision

Prepare

First of all, you should be aware how to configure your golang environment (which should be similar to all Operating Systems). For a more specific how-to please refer to official golang install: https://golang.org/doc/install

Building (any os)

For both remote-signer and standalone you can use standard golang build process since its a pure go code:

cd cmd/server
go get
go build -o remote-signer

Or if on windows:

cd cmd/server
go.exe get
go.exe build -o remote-signer.exe

For AgentUI the build process is a bit different since it uses Electron for the UI. There are few bugs in the anstielectron library dependency fetch that needs to be addressed as well.

cd cmd/agent-ui
go get ./...

# Workarround
go get github.com/asticode/go-astilectron
go get github.com/asticode/go-astilectron-bootstrap
go get github.com/asticode/go-astilectron-bundler/...
go install github.com/asticode/go-astilectron-bundler/astilectron-bundler

GO111MODULE=off go get github.com/asticode/go-astilectron
GO111MODULE=off go get github.com/asticode/go-astilectron-bootstrap
GO111MODULE=off go get github.com/asticode/go-astilectron-bundler/...
GO111MODULE=off go install github.com/asticode/go-astilectron-bundler/astilectron-bundler

cat << EOF > bind.go
// +build !linux,amd64
// +build !darwin,amd64
// +build !windows,amd64

// Placeholder file for assets binding
package main

func Asset(name string) ([]byte, error) {
	return []byte{}, nil
}

func AssetDir(name string) ([]string, error) {
	return []string{}, nil
}

func RestoreAssets(dir, name string) error {
	return nil
}
EOF

astilectron-bundler -logger-app-name=AgentUI -l

The program should be compiled and available at output/linux-amd64/AgentUI

For more details please check the auto-build process described in https://github.com/quan-to/remote-signer/blob/master/travis-binary-build.sh