Development
The project has Linux-specific features and aimed to be run in Linux ecosystem, however client control utility (cgi-ctl) and server (trusted-cgi) shall work on most platform (Darwin, Linux, Windows).
Requirements for backend
- go 1.13 and upper - see Go installation manual
- make - should be available in your OS repository
- git with LFS - for cloning binary UI
IDE:
- I am personally using professional Jetbrains Goland
- Someone can prefer use free Visual Studio Code with Go plugin
- Or use Liteide
Quick project setup:
- Install Go, setup
GOPATH
and addGOPATH/bin
in yourPATH
variable (should be described in the link) - Clone project somewhere (not required only under
GOAPTH
, because the project uses modules):git clone https://github.com/reddec/trusted-cgi.git
2.1 Pull LFS files:git lfs pull
- Change directory to the cloned folder (
cd trusted-cgi
) and build it:go get -v ./cmd/...
- Test project build:
trusted-cgi --help
(version should bedev
) - Run locally:
trusted-cgi --dev
When you decide to change something and check - repeat 3, 4, 5, however in a matured IDE (like Goland) it’s possible to run main.go
directly from UI that allows you to attach debugger if needed.
This is example of my runner in Goland (nothing complicated, but change working directory to your folder out of GIT tracking)
Embedding UI
Requirements should be same as for UI sub-repo
make clean
make embed_ui
Regenerating API
In case of API changes, generated files should also be update by following command
make regen