Setting up the backend
To get started running the backend service you will need:- digger’s repo cloned https://github.com/diggerhq/digger
- some kind of ngrok to tunnel connections to port 3000 - this is needed to receive github webhooks to the service
- go 1.24 running on your machine
1
Install ngrok
You can use ngrok to tunnel connections to port 3000. You can find installation instructions here.
The reason we need this is so that we can receive github webhooks to the service
2
Create a local database
I usually start one with docker:which will create this connections tring:
3
Clone the repo
If you are planning to contribute you would need to fork the repo and clone it locally:
4
Creating environment variables
Create a note that you would need to source this file before running the backend serviceAnd after that you can run the service with:You should see a message that the service is listening on port 3000. Visiting that url should show you a ui screen that digger is up and running.
.env
file in the folder backend/ of the repo and add the following:5
Next steps
From here on you can follow the steps in the self hosting binary guide here
Setting up the cli
The cli is mainly meant to be used and invoked in CI systems. So in order to test cli changes the easiest way is to push it to your digger branch and then update the step to point to the branch directly:
Security Warning: Self-hosted runners have significant security implications. When using self-hosted runners, be aware that:From here onwards the cycle is to make a local change, rebuild the cli and then trigger in github to test that change. Its a much faster iterative cycle in comparison to building from a branch each time.
- Code from pull requests can run on your self-hosted runner, potentially executing malicious code on your machine
- If your repository is public, anyone can fork it and submit a pull request that could run code on your runner
- Only use self-hosted runners in private repositories where you trust all contributors, or implement proper security controls
- For more information, see GitHub’s security considerations for self-hosted runners