Compare commits
No commits in common. "master" and "citesting" have entirely different histories.
|
@ -16,7 +16,9 @@ steps:
|
|||
from_secret: dockerhub_password
|
||||
repo: ctdo/raumstatus
|
||||
tags: latest
|
||||
when:
|
||||
ref:
|
||||
- refs/heads/master
|
||||
dry_run: true
|
||||
# when:
|
||||
# ref:
|
||||
# - refs/heads/master
|
||||
|
||||
|
||||
|
|
26
README.md
26
README.md
|
@ -23,13 +23,6 @@ Fionera fügte HTML5 Push notifications hinzu.
|
|||
|
||||
Danach kleinere Änderungen und Erweiterungen von henne, zeus, smash.
|
||||
|
||||
## config via environment variablen
|
||||
|
||||
PING_INTERVAL_MS default 60000
|
||||
MQTT_SERVER default 'mqtt://mqtt.ctdo.de
|
||||
FLUKSO_URL default "/sensor/cf00e0b22230f4a8870af58f2b8719dd
|
||||
FLUKSO_HOST default"flukso.raum.ctdo.de"
|
||||
STATUS_POLL_HOST default "snapserv.ctdo.de"
|
||||
|
||||
|
||||
## Entrümpelung 2022
|
||||
|
@ -37,7 +30,7 @@ Danach kleinere Änderungen und Erweiterungen von henne, zeus, smash.
|
|||
Das meiste an Funktionn wurde wiede raus geworfen weil sich die CTDO infrastruktur
|
||||
sehr verändert hat und einiges kaputt war.
|
||||
|
||||
Der Status zeigt nur noch Power und Raumstatus an. Es läuft wie gehabt via ICMP Ping.
|
||||
Der Status zeit nur noch Power und Raumstatus an. Es läuft wie gehabt via nmap-Ping.
|
||||
|
||||
|
||||
|
||||
|
@ -52,19 +45,6 @@ Dependencies installieren und Server lokal laufen lassen:
|
|||
node raumstatus.js
|
||||
|
||||
|
||||
Docker container bauen zum testen:
|
||||
|
||||
docker build . -t ctdo/ctdo-raumstatus
|
||||
|
||||
Es gibt hier eine .drone.yml Datei die eine Pipeline auf ci.ctdo.de konfiguriert.
|
||||
Jeder Push auf den master branch triggert einen Build Prozess. Dann wird ein neues Docker
|
||||
Image gebaut und auf hub.docker.com gepushed.
|
||||
|
||||
|
||||
## ToDos
|
||||
|
||||
- [ ] Automatisch Version aus package.json nehmen beim Docker bauen und taggen
|
||||
- [ ] Hosts einstellbar machen via ENV (welcher host zum Pingen ist, flukso adresse+url)
|
||||
- [ ] Ping Intervall einstellbar machen via ENV
|
||||
|
||||
Docker container bauen:
|
||||
|
||||
docker build . -t ctdo/ctdo-raumstatus
|
|
@ -8,8 +8,7 @@ var IpPoll = require("./ip-poll");
|
|||
var routes = require("./routes");
|
||||
var path = require('path');
|
||||
var mqttClient = require('mqtt');
|
||||
var process = require('process')
|
||||
// phone: "+49 231 8 404 777",
|
||||
|
||||
var spaceanswer = {
|
||||
api: "0.13",
|
||||
ext_ccc: "erfa",
|
||||
|
@ -26,7 +25,7 @@ var spaceanswer = {
|
|||
lat: 51.527611
|
||||
},
|
||||
contact: {
|
||||
phone: "",
|
||||
phone: "+49 231 8 404 777",
|
||||
irc: "irc://irc.hackint.eu/#ccc.do",
|
||||
ml: "discuss@lists.chaostreff-dortmund.de",
|
||||
twitter: "@ctdo",
|
||||
|
@ -64,20 +63,15 @@ var spaceanswer = {
|
|||
var simpleanswer = {state: "unknown", lastchange: 0, power: 0};
|
||||
|
||||
|
||||
var ippoll = new IpPoll(process.env.STATUS_POLL_HOST || "snapserv.raum.ctdo.de");
|
||||
var flukso = new Flukso(process.env.FLUKSO_HOST || "flukso.raum.ctdo.de",
|
||||
process.env.FLUKSO_URL || "/sensor/cf00e0b22230f4a8870af58f2b8719dd");
|
||||
var mqtt = mqttClient.connect(process.env.MQTT_SERVER || 'mqtt://mqtt.ctdo.de');
|
||||
var ippoll = new IpPoll("rpi3.raum.ctdo.de");
|
||||
var flukso = new Flukso("flukso.raum.ctdo.de", "/sensor/cf00e0b22230f4a8870af58f2b8719dd");
|
||||
var mqtt = mqttClient.connect('mqtt://raum.ctdo.de');
|
||||
var connected = false;
|
||||
|
||||
//express js settings
|
||||
var port = process.env.HTTP_PORT || '9911';
|
||||
var port = '9911';
|
||||
var address = '0.0.0.0';
|
||||
|
||||
process.on('SIGINT', () => {
|
||||
console.info("Interrupted")
|
||||
process.exit(0)
|
||||
})
|
||||
|
||||
ippoll.on('doneState', function (state) {
|
||||
spaceanswer.state.open = state;
|
||||
|
@ -119,7 +113,7 @@ function work() {
|
|||
sendSimple();
|
||||
}
|
||||
|
||||
setInterval(work, process.env.PING_INTERVAL_MS || 60000);
|
||||
setInterval(work, 60000);
|
||||
work();
|
||||
|
||||
setInterval(flukso.pollPower, 5000);
|
||||
|
|
Loading…
Reference in New Issue