Development
The project has Linux-specific features and is aimed to be run in the Linux ecosystem, however the client control utility (cgi-ctl) and server (trusted-cgi) should work on most platforms (Darwin, Linux, Windows).
Requirements for backend
- go 1.13 and higher - 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
- Another possibility would be the 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 the 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 the debugger if needed.
This is an example of my runner in Goland (nothing complicated, but change working directory to your folder out of GIT tracking)
Embedding UI
Requirements should be the 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