- Contributor Guidelines and Governance
- Pre-built images
- Build Requirements
- Building Executables and Images from Scratch
- Development
- Local Testing
Please see CONTRIBUTING and GOVERNANCE from the SPIFFE project for community guidelines.
Important
Before opening a new issue, search for any existing issues here to avoid duplication.
If you're new to this project, we recommend you join us on Slack for discussion of potential new features.
You can use pre-built images for various versions and Tornjak components. For a list of supported public images of Tornjak along with usage instructions please see our USAGE document.
Otherwise, you can follow instructions below to build Tornjak images.
In order to build, we require the following installations:
- Docker for the backend build
- npm for the frontend build if running locally
- Golang is required if you would like to run the Go backends locally
Building Tornjak manually can be done with the Makefile. Below is a list of local executable builds:
make bin/tornjak-backend
: makes the Go executable of the Tornjak backendmake bin/tornjak-manager
: makes the Go executable of the Tornjak managermake frontend-local-build
: makes the optimized ReactJS app locally for the Tornjak frontend. Uses environment variable configuration as in tornjak-frontend/.env
And below is a list of container image builds:
make image-tornjak-backend
: containerizes Go executable of the Tornjak backendmake image-tornjak-manager
:containerizes Go executable of the Tornjak managermake image-tornjak-frontend
: containerizes React JS app for the Tornjak frontend
For usage instructions of the containers, please see our USAGE document to get started.
We welcome all development attempts and contributions from the community. The easiest place to start is by reviewing our code architecture diagrams available in our api documentation.
- Fork the tornjak repo
- Ensure your branch is based on the latest commit in
main
- Commit changes to your fork. Make sure your commit messages contain a
Signed-off-by: <your-email-address>
line (seegit-commit --signoff
) to certify the DCO - Test your PR locally and ensure all tests in Github actions pass
- Open a pull request
against the upstream
main
branch
Important
Please make sure you open all PRs against the main
branch
Important
For any new feature design, or feature level changes, please create an issue first, then submit a PR with design details before code implementation.
At least one maintainer must approve the pull request.
Once your pull request is submitted, it's your responsibility to:
- Respond to reviewer's feedback
- Keep it merge-ready at all times until it has been approved and actually merged
Following approval, the pull request will be merged by the last maintainer to approve the request.
When third-party code must be included, all licenses must be preserved. This includes modified third-party code and excerpts, as well.
Thank you for contributing to Tornjak!
We highly recommend starting with our quickstart tutorial, using official images and preset configs before development. This tutorial creates a local instance of SPIRE on Minikube, adds Tornjak server, and runs a UI.
Additionally, one may test out several other features including the following:
- Running the Frontend Locally
- Running the Backend Locally
- Running the Tornjak Manager Locally
- User Management
Usage documentation for each of the Tornjak components can be found in our Usage document.
An excellent feature for frontend development is the ability to make changes to the frontend code without needing to restart the application. To start a local version of the Tornjak frontend, one must have it point at the running Tornjak APIs:
cd tornjak-frontend
npm install
REACT_APP_API_SERVER_URI=http://localhost:3000 npm start
This will start a server on http://localhost:3000
. Please be patient, as it might take a few minutes to compile and start the server.
The backend may also be run locally as well.
go run tornjak-backend/cmd/agent/agent.go
Note, the above command will print out usage documentation for the server. Please see our documentation for the backend here for more information. Additionally, full functionality of the server requires a SPIRE server to be running.
You may run the uncontainerized Tornjak manager by locally running the following:
go run tornjak-backend/cmd/manager/manager.go
which starts listening on port 50000.
To start the manager UI, run:
REACT_APP_API_SERVER_URI=http://localhost:50000/
REACT_APP_TORNJAK_MANAGER=true npm start
In this view, there is an additional navigation bar tab titled "Manage Servers" where you may register Tornjak agents.
Alternatively, one may also run these components in a container, as is described in our USAGE doc.
User Management is an optional feature that prevents un-authorized access to Tornjak and SPIRE APIs. We have several comprehensive resources for getting started with integrating user management in this User Management documentation.
-
On Windows, files use CRLF (
\r\n
) line endings, but Git (Linux) uses LF (\n
) line endings. -
We can check the status of line endings using:
git config --global core.autocrlf
-
If there is no status, Windows will use its own line endings. We can fix this issue by setting:
git config --global core.autocrlf true
-
Now if we run the command in step 2 again:
git config --global core.autocrlf
Windows should now output:
true
-
Files are now checked out with CRLF (Windows format), and files are committed with LF (Unix format).