- Goto $GOPATH/src and then
git clone [email protected]:tera-insights/2Q2R-enterprise.git 2q2r
- Install Glide. Make sure
you've either set your
$GOBIN
or your$PATH
includes$GOPATH/bin
. make install_dependencies
will install dependencies insidevendor/
.go run
is not always aware of the vendor folder. Specifically, as of 1.7.3, go ignoresvendor
unless it is run inside the$GOPATH
. See more here. So, make sure you have installed this package inside your$GOPATH
.- Install a MaxMind City database. The free tier, GeoLite2, is available
here. Make sure its path is
either set in the
config.yaml
or is the default./db.mmdb
. - Bootstrap the database with
go run cmd/bootstrap/bootstrap.go
. This script requires abootstrap.json
config file that is aserver.NewAdminRequest
.
The first admin's public key must be signed by Tera Insights by
go run cmd/sign/sign.go
. This script takes an info file that has the admin's
public key and generates a file with the admin ID and signature.
- If not already done, bootstrap the database with
go run cmd/bootstrap/bootstrap.go
. Also make sure you have the latest bootstrap file from the 2Q2R Slack; if you replace an older bootstrap file, you will need to deletetest.db
before running the new one. - Generate a private key with the following shell script:
openssl ecparam -name secp521r1 -genkey -out priv.pem -noout
make run
(which simply executesgo run cmd/server/server.go
)
Edit the file config.yaml
and set at least BaseURL
. The local changes
will not be checked into the GIT repository. Potentially, the Port
needs
to be changed as well. Make sure the port is prefixed by :, e.g. :8080
To bootstrap the database, grab the file bootstrap.go
from slack.
Edit it to contain desired info (such as appIDs and such). The info here
has to match the info in the demo app.
Run it with
go run bootstrap.go
make run
sqlite3 test.db
.schema
select * from app_server_infos;
select * from keys;
Run godoc -http=:6060
and then navigate to localhost:6060/pkg/2q2r
.