GOTIFY - Golang notification application for digIT internal services
1.3K
Sends notifications trough calls to rest interface.
Currently supports the following notification types:
How to use the running application
All request must inclue a header with the preshared key.
Authorization: pre-shared: your...key
POST /mail
Json Request:
{
"to": "....",
"from": "....",
"subject": "....",
"body": "...."
}
Steps to run the application. this include configuration and key files at the moment
The application can be configured through a config file or environment variables. Environment variables take precedence.
config.toml can reside in your working directory, /etc/gotify/ or $HOME/.gotify/
port = "8080"
pre-shared-key = "......"
debug-mode = false
mock-mode = false
[google-mail]
keyfile = "gapps.json"
admin-mail = "[email protected]"
See Environment Variables for config explanation
GOTIFY_PORT: Port for the web service, defaults to 8080 (string)GOTIFY_PRE-SHARED-KEY*: Random string used by other apps to authenticateGOTIFY_DEBUG-MODE: Bool indicating debug mode defaults to falseGOTIFY_GOOGLE-MAIL.KEYFILE: the file described in Google config file defaults to gapps.jsonGOTIFY_GOOGLE-MAIL.ADMIN-MAIL*: The google administrator email.This file (gapps.json by default config) should be placed in the working directory
(digIT can find this file on their wiki)
Go to Google developer console to retrieve this file
You must also allow mail api calls:
client_id from the credentials file previously retrievedhttps://www.googleapis.com/auth/gmail.sendYou can either set this project up manually or with a simple docker compose setup. The manual setup is recommended if you'll be doing extensive development.
Please referer to the software design document before starting development: DESIGN.md
See issues for suggested features.
Make sure you have golang installed and you $GOPATH setup.
go get -d ./...cmd/main.goUse gin for hot reloading.
go get github.com/codegangsta/gingin -d cmd -a 8080 run main.godocker-compose up --buildYou can install additional dependencies without restarting the container by running docker exec gotify_web_1 go get ..., gotify_web_1 is the name of the container and ... is the dependency.
pre-shared-key config/environment variable.mock-mode config/environment variable to trueExample docker-compose entry for mock service:
services:
...
gotify:
image: cthit/gotify:latest
environment:
GOTIFY_PRE-SHARED-KEY: "123abc"
GOTIFY_MOCK-MODE: "true"
Other services would then be able to reach this service on http://gotify:8080/... with 123abc as the preshared key
Content type
Image
Digest
Size
10.9 MB
Last updated
almost 7 years ago
docker pull cthit/gotify