5 Commits
0.0.7 ... main

Author SHA1 Message Date
5a25204f2f new database
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
2025-01-09 14:31:39 +01:00
52b414f60f use matest in local env
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
2024-12-02 13:11:54 +01:00
3fc83eefe6 logging
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
ci/woodpecker/tag/woodpecker Pipeline was successful
2024-12-02 11:48:24 +01:00
a58959a316 counter fix
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
ci/woodpecker/tag/woodpecker Pipeline was successful
2024-12-02 10:59:29 +01:00
2c21ab00a0 counter fix
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed
ci/woodpecker/tag/woodpecker Pipeline failed
2024-12-02 10:31:11 +01:00
4 changed files with 7 additions and 10 deletions

View File

@ -4,7 +4,7 @@ PGHOST=`kubectl get services traefik -n system -o jsonpath="{.status.loadBalance
PGPASSWORD=`kubectl get secrets ma-db-cred -n $N -o jsonpath="{.data.PGPASSWORD}" | base64 --decode`
PGUSER=`kubectl get secrets ma-db-cred -n $N -o jsonpath="{.data.PGUSER}" | base64 --decode`
PGSSLMODE=`kubectl get secrets ma-db-cred -n $N -o jsonpath="{.data.PGSSLMODE}" | base64 --decode`
PGDATABASE="ma"
PGDATABASE="matest"
export PGUSER PGHOST PGPASSWORD PGSSLMODE PGDATABASE
MA_CONF=`cat config-test.json`

View File

@ -1,10 +1,6 @@
#!/bin/bash
export PGUSER=`kubectl get secret -n database timescaledb -o jsonpath="{.data.superuser-username}" | base64 --decode`
export PGHOST=`kubectl get services traefik -n system -o jsonpath="{.status.loadBalancer.ingress[0].ip}"`
export PGPASSWORD=`kubectl get secret -n database timescaledb -o jsonpath="{.data.superuser-password}" | base64 --decode`
export PGSSLMODE=require
. ~/Workspace/mykubernetesenv/ENVDB1
DATABASE=ma
LOGIN=ma
@ -33,7 +29,7 @@ kubectl create secret generic ma-db-cred \
--from-literal=PGUSER="$LOGIN" \
--from-literal=PGPASSWORD="$PASSWORD" \
--from-literal=PGDATABASE="$DATABASE" \
--from-literal=PGHOST="timescaledb.database.svc.cluster.local" \
--from-literal=PGHOST="database.database1.svc.cluster.local" \
--from-literal=PGSSLMODE="require" | \
kubectl apply -f - -n $NAMESPACE

View File

@ -7,7 +7,7 @@ import "time"
//import "net/url"
import "ma/mqtt"
//import "ma/config"
import "ma/counter"
//import "ma/counter"
import "ma/database"
var dbh *database.DatabaseHandle
@ -31,6 +31,5 @@ func InputArchiver() {
func handleMessage(message database.Message) {
// log.Printf("Archiving Timestamp: %s, Topic: %s, Payload: %s", message.Time, message.Topic, message.Payload)
dbh.StoreMessage(&message)
counter.S("Stored")
}

View File

@ -122,7 +122,9 @@ func StartMqttClient() {
if token := mqttClient.Connect(); token.Wait() && token.Error() != nil {
log.Fatalf("Unable to connect to broker %s, error %s", broker, token.Error())
}
//log.Printf("Successfully connected to broker %s", broker)
log.Printf("Successfully connected to broker %s", broker)
log.Printf("Include topics: %s", config.Config.IncludeTopics)
log.Printf("Exclude topics: %s", config.Config.ExcludeTopics)
go outputDispatcher(mqttClient)