-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add manpage, ui module as well as github workflows
- Loading branch information
1 parent
f3b591b
commit c3c9fc7
Showing
12 changed files
with
534 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
name: Go package | ||
|
||
on: [push] | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Set up Go | ||
uses: actions/setup-go@v4 | ||
with: | ||
go-version: '1.21' | ||
- name: Test | ||
run: make test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
on: | ||
release: | ||
types: [created] | ||
|
||
jobs: | ||
releases-matrix: | ||
name: Release Go Binary | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
goos: [linux] | ||
goarch: ["386", amd64, arm64] | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: wangyoucao577/go-release-action@v1 | ||
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
goos: ${{ matrix.goos }} | ||
goarch: ${{ matrix.goarch }} | ||
project_path: "./cmd/whawty-alerts" | ||
binary_name: "whawty-alerts" | ||
pre_command: export CGO_ENABLED=0 | ||
extra_files: AUTHORS LICENSE README.md doc/man/whawty-alerts.8 | ||
md5sum: false | ||
sha256sum: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
'\" t | ||
.\" Title: whawty-alerts | ||
.\" Author: [see the "AUTHORS" section] | ||
.\" Generator: DocBook XSL Stylesheets vsnapshot <http://docbook.sf.net/> | ||
.\" Date: 10/12/2023 | ||
.\" Manual: \ \& | ||
.\" Source: \ \& | ||
.\" Language: English | ||
.\" | ||
.TH "WHAWTY\-ALERTS" "8" "10/12/2023" "\ \&" "\ \&" | ||
.\" ----------------------------------------------------------------- | ||
.\" * Define some portability stuff | ||
.\" ----------------------------------------------------------------- | ||
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
.\" http://bugs.debian.org/507673 | ||
.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html | ||
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
.ie \n(.g .ds Aq \(aq | ||
.el .ds Aq ' | ||
.\" ----------------------------------------------------------------- | ||
.\" * set default formatting | ||
.\" ----------------------------------------------------------------- | ||
.\" disable hyphenation | ||
.nh | ||
.\" disable justification (adjust text to left margin only) | ||
.ad l | ||
.\" ----------------------------------------------------------------- | ||
.\" * MAIN CONTENT STARTS HERE * | ||
.\" ----------------------------------------------------------------- | ||
.SH "NAME" | ||
whawty-alerts \- the simple alert manager | ||
.SH "SYNOPSIS" | ||
.sp | ||
\fBwhawty\-alerts\fR \fI[global options]\fR \fB<command>\fR \fI[command options]\fR \fI[arguments \&... ]\fR | ||
.SH "DESCRIPTION" | ||
.sp | ||
\fBwhawty\-alerts\fR is a simple daemon that handles notifications for monitoring alerts from the Prometheus Alertmanager\&. Notifications can be sent via eMail as well as SMS\&. Unless most other solutions whawty\&.alerts tries to be of use without access to the internet\&. This means sending eMails and SMS is not done using the API of some cloud provider but rather using local resources such as GSM modems connected via USB\&. | ||
.SH "GLOBAL OPTIONS" | ||
.sp | ||
The following global options can be passed to \fBwhawty\-alerts\fR\&. | ||
.PP | ||
\fB\-h | \-\-help\fR | ||
.RS 4 | ||
Show help text and exit\&. | ||
.RE | ||
.PP | ||
\fB\-v | \-\-version\fR | ||
.RS 4 | ||
Print version information and exit\&. | ||
.RE | ||
.SH "COMMANDS" | ||
.sp | ||
Any of the following commands supports \fB\-h | \-\-help\fR as an option\&. This will print extra help information for the command\&. All these commands use the auth store directory as specified by the global store configuration file\&. | ||
.SS "run \fI[options]\fR" | ||
.sp | ||
\&...tbd\&... | ||
.SS "runsa" | ||
.sp | ||
This is basically the same as \fBrun\fR but expects all sockets to be passed via systemd socket activation\&. \fBwhawty\-alerts\fR will run the web\-api on all TCP sockets\&. All other socket types are ignored\&. | ||
.SH "SIGNALS" | ||
.sp | ||
On HUP \fBwhawty\-alerts\fR tries to reload the configuration\&. I also runs a basic consistency check\&. If there is any error during that process the old configuration will be kept\&. | ||
.SH "BUGS" | ||
.sp | ||
Most likely there are some bugs in \fBwhawty\-alerts\fR\&. If you find a bug, please let the developers know at http://github\&.com/whawty/alerts\&. Of course, pull requests are preferred\&. | ||
.SH "SEE ALSO" | ||
.sp | ||
\fBpam\-whawty\fR(8) | ||
.SH "AUTHORS" | ||
.sp | ||
Christian Pointner <equinox@spreadspace\&.org> | ||
.SH "RESOURCES" | ||
.sp | ||
Main web site: http://github\&.com/whawty/alerts |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
whawty-alerts(8) | ||
================ | ||
|
||
NAME | ||
---- | ||
|
||
whawty-alerts - the simple alert manager | ||
|
||
|
||
SYNOPSIS | ||
-------- | ||
|
||
*whawty-alerts* '[global options]' *<command>* '[command options]' '[arguments ... ]' | ||
|
||
|
||
DESCRIPTION | ||
----------- | ||
|
||
*whawty-alerts* is a simple daemon that handles notifications for monitoring alerts from | ||
the Prometheus Alertmanager. Notifications can be sent via eMail as well as SMS. Unless | ||
most other solutions whawty.alerts tries to be of use without access to the internet. | ||
This means sending eMails and SMS is not done using the API of some cloud provider but | ||
rather using local resources such as GSM modems connected via USB. | ||
|
||
|
||
GLOBAL OPTIONS | ||
-------------- | ||
|
||
The following global options can be passed to *whawty-alerts*. | ||
|
||
*-h | --help*:: | ||
Show help text and exit. | ||
|
||
*-v | --version*:: | ||
Print version information and exit. | ||
|
||
|
||
COMMANDS | ||
-------- | ||
|
||
Any of the following commands supports *-h | --help* as an option. This will print | ||
extra help information for the command. All these commands use the auth store directory | ||
as specified by the global store configuration file. | ||
|
||
run '[options]' | ||
~~~~~~~~~~~~~~~ | ||
|
||
...tbd... | ||
|
||
runsa | ||
~~~~~ | ||
|
||
This is basically the same as *run* but expects all sockets to be passed via systemd | ||
socket activation. *whawty-alerts* will run the web-api on all TCP sockets. All other | ||
socket types are ignored. | ||
|
||
|
||
SIGNALS | ||
------- | ||
|
||
On HUP *whawty-alerts* tries to reload the configuration. I also runs a basic | ||
consistency check. If there is any error during that process the old configuration | ||
will be kept. | ||
|
||
|
||
BUGS | ||
---- | ||
|
||
Most likely there are some bugs in *whawty-alerts*. If you find a bug, please let | ||
the developers know at http://github.com/whawty/alerts. Of course, pull requests | ||
are preferred. | ||
|
||
|
||
SEE ALSO | ||
-------- | ||
|
||
*pam-whawty*(8) | ||
|
||
|
||
AUTHORS | ||
------- | ||
|
||
Christian Pointner <[email protected]> | ||
|
||
|
||
RESOURCES | ||
--------- | ||
|
||
Main web site: http://github.com/whawty/alerts |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
//go:build dev | ||
// +build dev | ||
|
||
// | ||
// Copyright (c) 2023 whawty contributors (see AUTHORS file) | ||
// All rights reserved. | ||
// | ||
// Redistribution and use in source and binary forms, with or without | ||
// modification, are permitted provided that the following conditions are met: | ||
// | ||
// * Redistributions of source code must retain the above copyright notice, this | ||
// list of conditions and the following disclaimer. | ||
// | ||
// * Redistributions in binary form must reproduce the above copyright notice, | ||
// this list of conditions and the following disclaimer in the documentation | ||
// and/or other materials provided with the distribution. | ||
// | ||
// * Neither the name of whawty.alerts nor the names of its | ||
// contributors may be used to endorse or promote products derived from | ||
// this software without specific prior written permission. | ||
// | ||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" | ||
// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE | ||
// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | ||
// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR | ||
// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER | ||
// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, | ||
// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | ||
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
// | ||
|
||
package ui | ||
|
||
import ( | ||
"net/http" | ||
) | ||
|
||
var Assets http.FileSystem = http.Dir("ui/assets") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<!DOCTYPE HTML> | ||
<html lang="en"> | ||
<head> | ||
<title>whawty alerts - admin interface</title> | ||
<meta charset="utf-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1"> | ||
<meta name="description" content="whawty alerts admin interface"> | ||
<meta name="author" content="Christian Pointner <[email protected]>"> | ||
|
||
</head> | ||
<body> | ||
<h1>Hello world</h1> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
//go:build ignore | ||
// +build ignore | ||
|
||
// | ||
// Copyright (c) 2023 whawty contributors (see AUTHORS file) | ||
// All rights reserved. | ||
// | ||
// Redistribution and use in source and binary forms, with or without | ||
// modification, are permitted provided that the following conditions are met: | ||
// | ||
// * Redistributions of source code must retain the above copyright notice, this | ||
// list of conditions and the following disclaimer. | ||
// | ||
// * Redistributions in binary form must reproduce the above copyright notice, | ||
// this list of conditions and the following disclaimer in the documentation | ||
// and/or other materials provided with the distribution. | ||
// | ||
// * Neither the name of whawty.alerts nor the names of its | ||
// contributors may be used to endorse or promote products derived from | ||
// this software without specific prior written permission. | ||
// | ||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" | ||
// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE | ||
// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | ||
// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR | ||
// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER | ||
// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, | ||
// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | ||
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
// | ||
|
||
package main | ||
|
||
import ( | ||
"log" | ||
"net/http" | ||
|
||
"github.com/shurcooL/vfsgen" | ||
) | ||
|
||
func main() { | ||
assets := http.Dir("assets") | ||
err := vfsgen.Generate(assets, vfsgen.Options{ | ||
PackageName: "ui", | ||
BuildTags: "!dev", | ||
VariableName: "Assets", | ||
}) | ||
if err != nil { | ||
log.Fatalln(err) | ||
} | ||
} |
Oops, something went wrong.