added README.md, example config files, binaries, updated CHANGELOG.md

This commit is contained in:
itwrx 2024-12-07 11:49:03 -06:00
parent e79c37d169
commit a87b907139
7 changed files with 68 additions and 0 deletions

View File

@ -2,3 +2,4 @@
## 0.1.0 - 12-7-24
- Intitial Release.
- Binaries compiled with Fedora 40 and Alpine Linux 3.20.

30
README.md Normal file
View File

@ -0,0 +1,30 @@
# GoAccessReporter
A small program for web hosts, or self hosters, that reads TOML config files (TOML v0.5.0 currently), generates reports with [GoAccess](https://goaccess.io/), and emails them to config'd recipients. The user can schedule with cron, systemd-timers, etc. Written and tested for linux.
# System package dependencies
-- GoAccessReporter expects `GoAccess` to be installed and configured(working with your nginx log files), as well as `tar` being installed.
# Building from source?
-- You will need Nim installed, which probably also contains Nimble, the Nim package manager.
-- Install the non-stdlib dependencies: `nimble install parsetoml, smtp, mime`
-- Compile goaccess_reporter.nim with: `nim c --d:threads:off -d:ssl -d:release goaccess_reporter.nim`
# Or Just Download a binary
-- Download whichever binary you need from the `binaries` directory. The default binary is compiled for x86_64 GNU libc (in Fedora), and the other is compiled for x86_64 musl (in Alpine Linux). I will try to note the distros' versions in the CHANGELOGs for a given release, so users can gauge the compatibility of the binaries.
# Configuration and use.
-- Copy the binary to `/usr/local/bin`, or wherever you prefer in your PATH on your server, and make it executable with `chmod +x goaccess_reporter_binary_name`.
-- Create `/etc/goaccess-reporter` (dash, not underscore) and copy `example_config_files/email.toml` and `example_config_files/sites.toml` there and edit them for your needs.
-- Run the program with cron by copying `example_config_files/run_goaccess_reporter.sh` to `/etc/periodic/monthly` on your server, or use whatever scheduling method you prefer.
-- GoAccessReporter will create `~/.goaccess-reporter`, `~/.gooaccess-reporter/reports` and `~/.goaacess-reporter/goaccess-reporter.log` when it runs. If `delete-after = false` is set in `sites.toml` for a site, the report will be saved in the `reports` directory.
# But Why?
Many website owners want some stats on page visits, referrering urls, etc., so they can gauge their SEO and marketing efforts, but adding analytics scripts to sites can slow them down, and/or turn them into third party spyware. GoAccess is FOSS (Free/Open Source Software) that simply parses the webserver log, and makes it available as a nice html report. GoAccessReporter allows web hosts to easily configure which sites GoAccess generates reports for, and then emails those reports to configured addresses.
Enjoy!

BIN
binaries/goaccess_reporter_0.1.0 Executable file

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1,5 @@
[server]
hostname = "email.mydomain.org"
starttls-port = 587
sender-address = "maileraddress@mydomain.org"
sender-password = "supersecretpassword"

View File

@ -0,0 +1,6 @@
#! /bin/sh
#the name of your compiled goaccess_reporter binary.
goaccess_reporter_0.1.0_alpine
exit

View File

@ -0,0 +1,26 @@
#name of the site. can company name, domain, whatever makes the most sense.
[site1]
#webserver log location.
log-file = "/var/www/www-logs/site1-access.log"
#where to save the report and how to name it.
output = "/home/myuser/.goaccess_reporter/site1-report.html"
#append date to report name. This prevents overwriting existing reports. IDK if i even tested with "append-date = false".
append-date = true
#delete saved report.html after tarballing and emailing it.
delete-after = true
#array/seq of email addresses to send the report to.
email-addresses = ["jack@site1.org", "jill@site1.org"]
[site2]
log-file = "/var/www/www-logs/site2-access.log"
output = "/home/myuser/.goaccess_reporter/site2.html"
append-date = true
delete-after = false
email-addresses = ["john@site2.com", "jane@site2.com"]
[site3]
log-file = "/var/www/www-logs/site3-access.log"
output = "/home/myuser/.goaccess_reporter/site3-report.html"
append-date = true
delete-after = true
email-addresses = ["admin@site3.org"]