maas-server

command module
v0.0.0-...-70bfa02 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 20, 2024 License: MIT Imports: 16 Imported by: 0

README

MaaS - Server Implementation

Implementation of Matomat As A Service using Golang. Work in progress, feel free to contribute.

Biggest TODOs

  • Properly set MQTT message format

(for not so big TODOs simply grep for TODO, the result will speak for itself ^^)

Requirements

  • golang version 1.7+
  • sqlite3
  • ~440MB RAM (measured using memusg=> see "Reference Links")

Installation

  1. Pull all go dependencies using go get ./...
  2. Create a sqlite3 db at the desired location using sqlite3 matomat.db < schema.sql; sqlite3 matomat.db < initial_data.sql
  3. Create SSL certificate data (public and private cert parts)
  4. Create a config.yml from config.yml.template and fill it with real values
  5. Run the server :-)

Initial user info

Use admin with password admin for initial login. Create new user and delete user admin afterwards. (Hash for the password in initial_data.sql was created with bcrypt using 10 rounds)

Shutting down the server

Send a SIGTERM or SIGINT, server will then shutdown after a grace period configured in config.yml.

Local testing

Easy creation of a self signed certificate for local TESTING.

go run $GOROOT/src/crypto/tls/generate_cert.go --rsa-bits 4096 --host 127.0.0.1,::1,localhost --ca --start-date "Jan 1 00:00:00 1970" --duration=1000000h

Event Dispatcher

Example MQTT Messages

'matomat;item-consumed;1;2;Bier;100;1;1556827023'
'matomat;item-consumed;1;1;Club Mate;100;1;1556827042'

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
General TODO: There sees to be too much boilderplate code.
General TODO: There sees to be too much boilderplate code.
util

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL