data | ||
.gitignore | ||
config.example.json | ||
docker-compose.override.example.yml | ||
docker-compose.yml | ||
Dockerfile | ||
go.mod | ||
go.sum | ||
main.go | ||
README.md | ||
screenshot.png |
Git Notify
This Go application monitors one or more Git repositories for updates and sends notifications via Gotify.
Features
- Monitors specified branches in Git repositories.
- Sends notifications to a Gotify server upon detecting new commits.
- Persists known commit hashes to prevent duplicate notifications.
Usage
Before running, ensure you have Docker and Docker Compose installed on your system.
- Copy
docker-compose.override.example.yml
todocker-compose.override.yml
. - Copy
config.example.yml
toconfig.yml
. - Configure
docker-compose.override.yml
andconfig.yml
according to your needs (see Configuration section below). - If you are using HTTPS for your Gotify server and you have a custom CA
certificate, place your custom CA certificate in a file named
ca.crt
. If you don't need a custom CA certificate, create an emptyca.crt
file. - Run the command:
docker compose up -d --build
.
Configuration
The application reads configuration from config.json
. Required settings
include:
gotifyUrl
: URL of the Gotify server.gotifyApiKey
: API key for Gotify authentication.refreshInterval
: Update check interval (seconds).repos
: Repository paths (within the container) and branch configurations.
Example config.json
:
{
"gotifyUrl": "<GOTIFY_URL>",
"gotifyApiKey": "<GOTIFY_API_KEY>",
"refreshInterval": 3600,
"repos": {
"/repos/repo1": {
"branch": "main"
},
"/repos/repo2": {
"branch": "develop"
}
}
}
Example docker-compose.override.yml
:
services:
gitnotify:
volumes:
- <REPO_PATH_ON_HOST>:/repos/repo1
- <REPO_PATH_ON_HOST>:/repos/repo2
Here is where you can bind to your actual repositories on your host OS. Note
that the repo paths in the container (e.g. /repos/repo1
) must be consistent
with config.yml
. You can rename them to be more descriptive, too.
License
This is free and unencumbered software released into the public domain.
Anyone is free to copy, modify, publish, use, compile, sell, or distribute this software, either in source code form or as a compiled binary, for any purpose, commercial or non-commercial, and by any means.
In jurisdictions that recognize copyright laws, the author or authors of this software dedicate any and all copyright interest in the software to the public domain. We make this dedication for the benefit of the public at large and to the detriment of our heirs and successors. We intend this dedication to be an overt act of relinquishment in perpetuity of all present and future rights to this software under copyright law.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
For more information, please refer to https://unlicense.org/