Compare commits
3 Commits
6d549ed69b
...
f903b5508a
| Author | SHA1 | Date | |
|---|---|---|---|
| f903b5508a | |||
| 4b86536e7e | |||
| 105cdc74c2 |
@@ -7,3 +7,9 @@ mocks
|
|||||||
test
|
test
|
||||||
node_modules
|
node_modules
|
||||||
doc
|
doc
|
||||||
|
.env*
|
||||||
|
*.md
|
||||||
|
deploy.sh
|
||||||
|
generate-apikey.js
|
||||||
|
test_influx_sql.js
|
||||||
|
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
import {DateTime} from "luxon"
|
import {DateTime} from "luxon"
|
||||||
import * as mongo from "../databases/mongo.js"
|
import * as mongo from "../databases/mongo.js"
|
||||||
import { returnOnError } from "../utilities/reporterror.js"
|
import { returnOnError } from "../utilities/reporterror.js"
|
||||||
|
import { fetchLatestLAmaxForChips } from '../databases/influx_sql.js'
|
||||||
|
|
||||||
|
|
||||||
// Default distance for center search ( in km)
|
// Default distance for center search ( in km)
|
||||||
@@ -127,6 +128,8 @@ export var getData4map = async (params) => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// Nur Einträge verwenden, die eine ESP-Chipid haben
|
||||||
|
query.chip = { $exists: true }
|
||||||
try {
|
try {
|
||||||
// fetch mapdata from mongodb
|
// fetch mapdata from mongodb
|
||||||
let { properties, err } = await mongo.getallProperties(mongo.properties_collection, query)
|
let { properties, err } = await mongo.getallProperties(mongo.properties_collection, query)
|
||||||
@@ -134,19 +137,26 @@ export var getData4map = async (params) => {
|
|||||||
return returnOnError(ret, 'NOPROPSFOUND', getData4map.name)
|
return returnOnError(ret, 'NOPROPSFOUND', getData4map.name)
|
||||||
}
|
}
|
||||||
let v4map = getValue4Map(typ)
|
let v4map = getValue4Map(typ)
|
||||||
|
|
||||||
|
const chipIds = properties.map(prop => prop.chip?.id).filter(id => id)
|
||||||
|
const result = await fetchLatestLAmaxForChips({ chipids: chipIds})
|
||||||
|
|
||||||
for (let sensor of properties) {
|
for (let sensor of properties) {
|
||||||
|
const resIndex = result.values.findIndex((id) => id.chipid == sensor.chip.id)
|
||||||
|
const chpvalues = result.values[resIndex]
|
||||||
let oneAktData = {}
|
let oneAktData = {}
|
||||||
if (sensor.values !== undefined) {
|
if (!((sensor.values === undefined) || (chpvalues === undefined))) {
|
||||||
oneAktData = {
|
oneAktData = {
|
||||||
location: sensor.location[0].loc.coordinates,
|
location: sensor.location[0].loc.coordinates,
|
||||||
id: sensor._id,
|
id: sensor._id,
|
||||||
name: sensor.name[0].name,
|
name: sensor.chip.name,
|
||||||
indoor: sensor.location[0].indoor,
|
indoor: sensor.location[0].indoor,
|
||||||
lastseen: sensor.values.timestamp
|
lastseen: chpvalues.timestamp
|
||||||
}
|
}
|
||||||
let now = new Date().getTime()
|
let now = new Date().getTime()
|
||||||
if(oneAktData.lastseen !== '') {
|
if(oneAktData.lastseen !== '') {
|
||||||
let diff = now - oneAktData.lastseen.getTime()
|
const dt = new Date(oneAktData.lastseen).getTime()
|
||||||
|
let diff = now - dt
|
||||||
if (diff >= 365 * 24 * 3600 * 1000) {
|
if (diff >= 365 * 24 * 3600 * 1000) {
|
||||||
oneAktData.value = -4
|
oneAktData.value = -4
|
||||||
} else if (diff >= 30 * 24 * 3600 * 1000) {
|
} else if (diff >= 30 * 24 * 3600 * 1000) {
|
||||||
@@ -156,15 +166,15 @@ export var getData4map = async (params) => {
|
|||||||
} else if (diff >= 2 * 3600 * 1000) {
|
} else if (diff >= 2 * 3600 * 1000) {
|
||||||
oneAktData.value = -1
|
oneAktData.value = -1
|
||||||
} else {
|
} else {
|
||||||
if (sensor.values !== undefined) {
|
if (chpvalues !== undefined) {
|
||||||
oneAktData.value = Math.round(sensor.values[v4map] * 100) / 100
|
oneAktData.value = Math.round(chpvalues[v4map] * 100) / 100
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
let weeks = Math.round(diff / (7 * 24 * 3600 * 1000))
|
let weeks = Math.round(diff / (7 * 24 * 3600 * 1000))
|
||||||
oneAktData.weeks = weeks
|
oneAktData.weeks = weeks
|
||||||
}
|
}
|
||||||
if (sensor.values.timestamp > lastDate) {
|
if (new Date(oneAktData.lastseen).getTime() > lastDate) {
|
||||||
lastDate = sensor.values.timestamp
|
lastDate = new Date(oneAktData.lastseen).getTime()
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
oneAktData.value = -5
|
oneAktData.value = -5
|
||||||
@@ -176,7 +186,7 @@ export var getData4map = async (params) => {
|
|||||||
ret = {
|
ret = {
|
||||||
err: null,
|
err: null,
|
||||||
options: {
|
options: {
|
||||||
lastdate: lastDate,
|
lastdate: new Date(lastDate).toISOString(),
|
||||||
count: aktData.length,
|
count: aktData.length,
|
||||||
data: 'map'
|
data: 'map'
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -144,9 +144,11 @@ const transformInfluxResult = (series) => {
|
|||||||
if (col === 'time') {
|
if (col === 'time') {
|
||||||
// Convert timestamp to ISO string for compatibility
|
// Convert timestamp to ISO string for compatibility
|
||||||
record.datetime = new Date(row[index]).toISOString()
|
record.datetime = new Date(row[index]).toISOString()
|
||||||
} else {
|
} else if (col.startsWith('DNMS')) {
|
||||||
col = col.slice(11)
|
col = col.slice(11)
|
||||||
record[col] = row[index]
|
record[col] = row[index]
|
||||||
|
} else {
|
||||||
|
record[col] = row[index]
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
result.push(record)
|
result.push(record)
|
||||||
@@ -423,5 +425,83 @@ export const fetchNoiseAVGData = async (opts) => {
|
|||||||
return ret
|
return ret
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Fetch latest LA_max values for multiple chip IDs
|
||||||
|
* @param {Object} opts - Options object
|
||||||
|
* @param {Array<string>} opts.chipids - Array of chip IDs
|
||||||
|
* @returns {Object} - {err: null, values: [{chipid, LA_max, timestamp}]}
|
||||||
|
*/
|
||||||
|
export const fetchLatestLAmaxForChips = async (opts) => {
|
||||||
|
let ret = { err: null, values: [] }
|
||||||
|
|
||||||
|
if (!opts.chipids || !Array.isArray(opts.chipids) || opts.chipids.length === 0) {
|
||||||
|
ret.err = 'No chip IDs provided'
|
||||||
|
logit(`ERROR ${fetchLatestLAmaxForChips.name}: ${ret.err}`)
|
||||||
|
return ret
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
// Build WHERE clause with multiple chip IDs using OR (InfluxQL doesn't support IN)
|
||||||
|
const chipIdConditions = opts.chipids.map(id => `"node" = '${id}'`).join(' OR ')
|
||||||
|
|
||||||
|
// Query to get latest LA_max for each chip
|
||||||
|
const query = `SELECT "DNMS_noise_LA_max", "node" FROM "DNMS" WHERE (${chipIdConditions}) AND time >= now() - 24h ORDER BY time DESC`
|
||||||
|
|
||||||
|
let { values: lamaxValues, err: lamaxErr } = await influxRead(query)
|
||||||
|
if (lamaxErr) {
|
||||||
|
ret.err = lamaxErr.toString()
|
||||||
|
logit(`ERROR ${fetchLatestLAmaxForChips.name}: ${ret.err}`)
|
||||||
|
return ret
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!lamaxValues || !lamaxValues.length || !lamaxValues[0].series) {
|
||||||
|
ret.err = 'NODATA'
|
||||||
|
logit(`ERROR ${fetchLatestLAmaxForChips.name}: No data returned from query`)
|
||||||
|
return ret
|
||||||
|
}
|
||||||
|
|
||||||
|
// Transform results
|
||||||
|
const allData = transformInfluxResult(lamaxValues[0].series)
|
||||||
|
|
||||||
|
// Get latest value for each chip (data is already sorted by time DESC)
|
||||||
|
const latestByChip = {}
|
||||||
|
|
||||||
|
allData.forEach(record => {
|
||||||
|
const chipid = record.node
|
||||||
|
const lamax = record.LA_max
|
||||||
|
|
||||||
|
// Only keep the first (latest) value for each chip
|
||||||
|
if (!latestByChip[chipid] && lamax !== null && lamax !== undefined) {
|
||||||
|
latestByChip[chipid] = {
|
||||||
|
chipid: chipid,
|
||||||
|
LA_max: lamax,
|
||||||
|
timestamp: record.datetime
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
// Convert to array
|
||||||
|
ret.values = Object.values(latestByChip)
|
||||||
|
|
||||||
|
// Add null entries for chips without data
|
||||||
|
opts.chipids.forEach(chipid => {
|
||||||
|
if (!latestByChip[chipid]) {
|
||||||
|
ret.values.push({
|
||||||
|
chipid: chipid,
|
||||||
|
LA_max: null,
|
||||||
|
timestamp: null
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
} catch (e) {
|
||||||
|
ret.err = e.toString()
|
||||||
|
logit(`ERROR ${fetchLatestLAmaxForChips.name}: ${ret.err}`)
|
||||||
|
return ret
|
||||||
|
}
|
||||||
|
|
||||||
|
return ret
|
||||||
|
}
|
||||||
|
|
||||||
// Export write function for compatibility
|
// Export write function for compatibility
|
||||||
export { influxWrite }
|
export { influxWrite }
|
||||||
|
|||||||
@@ -72,7 +72,7 @@ export const readChipData = async (sid) => {
|
|||||||
let ret = { err: null, chipdata: null}
|
let ret = { err: null, chipdata: null}
|
||||||
let client = await connectMongo()
|
let client = await connectMongo()
|
||||||
try {
|
try {
|
||||||
ret.chipdata = await client.db(MONGOBASE).collection('prop_flux').findOne({_id: sid},{projection: {chip: 1, _id: 0}})
|
ret.chipdata = await client.db(MONGOBASE).collection('properties').findOne({_id: sid},{projection: {chip: 1, _id: 0}})
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
ret.err = e
|
ret.err = e
|
||||||
}
|
}
|
||||||
|
|||||||
210
doc/2DomainsfuerContainer.rtf
Normal file
210
doc/2DomainsfuerContainer.rtf
Normal file
@@ -0,0 +1,210 @@
|
|||||||
|
{\rtf1\ansi\ansicpg1252\cocoartf2867
|
||||||
|
\cocoatextscaling0\cocoaplatform0{\fonttbl\f0\fnil\fcharset0 .SFNS-Regular;\f1\fnil\fcharset0 HelveticaNeue-Bold;\f2\fswiss\fcharset0 Helvetica;
|
||||||
|
\f3\fnil\fcharset0 .SFNS-Semibold;\f4\fnil\fcharset0 .AppleSystemUIFontMonospaced-Regular;\f5\fmodern\fcharset0 Courier;
|
||||||
|
\f6\fnil\fcharset0 .SFNS-Bold;}
|
||||||
|
{\colortbl;\red255\green255\blue255;\red14\green14\blue14;\red111\green90\blue30;\red0\green0\blue0;
|
||||||
|
\red181\green0\blue19;\red20\green0\blue196;\red13\green100\blue1;\red151\green0\blue126;\red135\green5\blue129;
|
||||||
|
\red0\green0\blue0;}
|
||||||
|
{\*\expandedcolortbl;;\cssrgb\c6700\c6700\c6700;\cssrgb\c51373\c42353\c15686;\csgray\c0;
|
||||||
|
\cssrgb\c76863\c10196\c8627;\cssrgb\c10980\c0\c81176;\cssrgb\c0\c45490\c0;\cssrgb\c66667\c5098\c56863;\cssrgb\c60784\c13725\c57647;
|
||||||
|
\cssrgb\c0\c0\c0;}
|
||||||
|
\paperw11900\paperh16840\margl1440\margr1440\vieww29020\viewh16240\viewkind0
|
||||||
|
\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\sl324\slmult1\pardirnatural\partightenfactor0
|
||||||
|
|
||||||
|
\f0\fs42 \cf2 Ja, das ist absolut m\'f6glich \uc0\u9989 \'97 du kannst
|
||||||
|
\f1\b denselben Docker-Container \'fcber mehrere Domains oder Subdomains
|
||||||
|
\f0\b0 via
|
||||||
|
\f1\b Traefik
|
||||||
|
\f0\b0 erreichbar machen, und
|
||||||
|
\f1\b im Container selbst unterscheiden
|
||||||
|
\f0\b0 , \'fcber welche Domain der Aufruf kam.\
|
||||||
|
\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\pardirnatural\partightenfactor0
|
||||||
|
|
||||||
|
\f2\fs24 \cf0 \
|
||||||
|
\uc0\u11835 \
|
||||||
|
\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\sl324\slmult1\pardirnatural\partightenfactor0
|
||||||
|
|
||||||
|
\f0\fs42 \cf2 \
|
||||||
|
\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\sl324\slmult1\pardirnatural\partightenfactor0
|
||||||
|
|
||||||
|
\f3\b\fs44 \cf2 \uc0\u55357 \u56615 \'dcberblick
|
||||||
|
\f0\b0\fs42 \
|
||||||
|
\
|
||||||
|
Traefik ist ein Reverse Proxy, der anhand von Regeln Anfragen an Container weiterleitet.\
|
||||||
|
Du kannst mehrere
|
||||||
|
\f1\b Router-Regeln
|
||||||
|
\f0\b0 definieren, die alle auf denselben
|
||||||
|
\f1\b Service
|
||||||
|
\f0\b0 (also denselben Container) zeigen.\
|
||||||
|
\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\pardirnatural\partightenfactor0
|
||||||
|
|
||||||
|
\f2\fs24 \cf0 \
|
||||||
|
\uc0\u11835 \
|
||||||
|
\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\sl324\slmult1\pardirnatural\partightenfactor0
|
||||||
|
|
||||||
|
\f0\fs42 \cf2 \
|
||||||
|
\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\sl324\slmult1\pardirnatural\partightenfactor0
|
||||||
|
|
||||||
|
\f3\b\fs44 \cf2 \uc0\u55358 \u56809 Beispiel: Zwei Domains auf denselben Container
|
||||||
|
\f0\b0\fs42 \
|
||||||
|
\
|
||||||
|
Angenommen, du hast zwei Domains:\
|
||||||
|
\pard\tqr\tx100\tx260\li260\fi-260\sl324\slmult1\sb240\partightenfactor0
|
||||||
|
\cf2 \'95
|
||||||
|
\f4 app.example.com
|
||||||
|
\f0 \
|
||||||
|
\'95
|
||||||
|
\f4 test.example.org
|
||||||
|
\f0 \
|
||||||
|
\
|
||||||
|
Und einen Container
|
||||||
|
\f4 myapp
|
||||||
|
\f0 , der auf Port 8080 lauscht.\
|
||||||
|
\
|
||||||
|
Dann kannst du in deinen
|
||||||
|
\f1\b Traefik-Labels
|
||||||
|
\f0\b0 Folgendes setzen:
|
||||||
|
\f2\fs24 \cf0 \
|
||||||
|
\
|
||||||
|
\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\pardirnatural\partightenfactor0
|
||||||
|
|
||||||
|
\f5\fs28 \cf3 version:\cf4 \cf5 '3.8'\cf4 \
|
||||||
|
\
|
||||||
|
\cf3 services:\cf4 \
|
||||||
|
\cf3 myapp:\cf4 \
|
||||||
|
\cf3 image:\cf4 \cf5 myapp:latest\cf4 \
|
||||||
|
\cf3 labels:\cf4 \
|
||||||
|
\cf6 -\cf4 \cf5 "traefik.enable=true"\cf4 \
|
||||||
|
\
|
||||||
|
\cf7 # Router 1\cf4 \
|
||||||
|
\cf6 -\cf4 \cf5 "traefik.http.routers.myapp1.rule=Host(`app.example.com`)"\cf4 \
|
||||||
|
\cf6 -\cf4 \cf5 "traefik.http.routers.myapp1.entrypoints=websecure"\cf4 \
|
||||||
|
\cf6 -\cf4 \cf5 "traefik.http.routers.myapp1.tls.certresolver=myresolver"\cf4 \
|
||||||
|
\cf6 -\cf4 \cf5 "traefik.http.routers.myapp1.service=myapp-service"\cf4 \
|
||||||
|
\
|
||||||
|
\cf7 # Router 2\cf4 \
|
||||||
|
\cf6 -\cf4 \cf5 "traefik.http.routers.myapp2.rule=Host(`test.example.org`)"\cf4 \
|
||||||
|
\cf6 -\cf4 \cf5 "traefik.http.routers.myapp2.entrypoints=websecure"\cf4 \
|
||||||
|
\cf6 -\cf4 \cf5 "traefik.http.routers.myapp2.tls.certresolver=myresolver"\cf4 \
|
||||||
|
\cf6 -\cf4 \cf5 "traefik.http.routers.myapp2.service=myapp-service"\cf4 \
|
||||||
|
\
|
||||||
|
\cf7 # Gemeinsamer Service\cf4 \
|
||||||
|
\cf6 -\cf4 \cf5 "traefik.http.services.myapp-service.loadbalancer.server.port=8080"
|
||||||
|
\f2\fs24 \cf0 \
|
||||||
|
\
|
||||||
|
\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\sl324\slmult1\pardirnatural\partightenfactor0
|
||||||
|
|
||||||
|
\f0\fs42 \cf2 Beide Router (
|
||||||
|
\f4 myapp1
|
||||||
|
\f0 ,
|
||||||
|
\f4 myapp2
|
||||||
|
\f0 ) leiten an denselben Service (
|
||||||
|
\f4 myapp-service
|
||||||
|
\f0 ) weiter, der den Container auf Port 8080 anspricht.\
|
||||||
|
\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\pardirnatural\partightenfactor0
|
||||||
|
|
||||||
|
\f2\fs24 \cf0 \
|
||||||
|
\uc0\u11835 \
|
||||||
|
\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\sl324\slmult1\pardirnatural\partightenfactor0
|
||||||
|
|
||||||
|
\f0\fs42 \cf2 \
|
||||||
|
\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\sl324\slmult1\pardirnatural\partightenfactor0
|
||||||
|
|
||||||
|
\f3\b\fs44 \cf2 \uc0\u55358 \u56800 Im Container unterscheiden, welche Domain aufgerufen wurde
|
||||||
|
\f0\b0\fs42 \
|
||||||
|
\
|
||||||
|
Sobald eine Anfrage im Container landet, kannst du anhand des
|
||||||
|
\f1\b HTTP-Headers Host
|
||||||
|
\f0\b0 erkennen, \'fcber welche Domain sie kam.\
|
||||||
|
\
|
||||||
|
Beispiel (z. B. in einer Node.js-, PHP-, Python- oder Go-App):
|
||||||
|
\f2\fs24 \cf0 \
|
||||||
|
\
|
||||||
|
\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\pardirnatural\partightenfactor0
|
||||||
|
|
||||||
|
\f5\fs28 \cf7 # Beispiel Flask / Python\cf4 \
|
||||||
|
\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\pardirnatural\partightenfactor0
|
||||||
|
\cf8 from\cf4 flask \cf8 import\cf4 Flask, request\
|
||||||
|
\
|
||||||
|
app = Flask(__name__)\
|
||||||
|
\
|
||||||
|
\cf9 @app.route(\cf5 '/'\cf9 )\cf4 \
|
||||||
|
\cf8 def\cf4 index():\
|
||||||
|
host = request.headers.get(\cf5 'Host'\cf4 )\
|
||||||
|
\cf8 return\cf4 \cf5 f"Aufgerufen \'fcber: \cf10 \{host\}\cf5 "\cf4 \
|
||||||
|
\
|
||||||
|
app.run(host=\cf5 '0.0.0.0'\cf4 , port=\cf6 8080\cf4 )
|
||||||
|
\f2\fs24 \cf0 \
|
||||||
|
\
|
||||||
|
\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\sl324\slmult1\pardirnatural\partightenfactor0
|
||||||
|
|
||||||
|
\f0\fs42 \cf2 Oder in Node.js:
|
||||||
|
\f2\fs24 \cf0 \
|
||||||
|
\
|
||||||
|
\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\pardirnatural\partightenfactor0
|
||||||
|
|
||||||
|
\f5\fs28 \cf4 app.get(\cf5 '/'\cf4 , (req, res) => \{\
|
||||||
|
res.send(\cf5 `Aufgerufen \'fcber: \cf10 $\{req.headers.host\}\cf5 `\cf4 );\
|
||||||
|
\});
|
||||||
|
\f2\fs24 \cf0 \
|
||||||
|
\
|
||||||
|
\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\sl324\slmult1\pardirnatural\partightenfactor0
|
||||||
|
|
||||||
|
\f0\fs42 \cf2 Das Feld
|
||||||
|
\f4 req.headers.host
|
||||||
|
\f0 enth\'e4lt genau den Hostnamen, den Traefik aus der Anfrage durchreicht (
|
||||||
|
\f4 app.example.com
|
||||||
|
\f0 oder
|
||||||
|
\f4 test.example.org
|
||||||
|
\f0 ).\
|
||||||
|
\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\pardirnatural\partightenfactor0
|
||||||
|
|
||||||
|
\f2\fs24 \cf0 \
|
||||||
|
\uc0\u11835 \
|
||||||
|
\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\sl324\slmult1\pardirnatural\partightenfactor0
|
||||||
|
|
||||||
|
\f0\fs42 \cf2 \
|
||||||
|
\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\sl324\slmult1\pardirnatural\partightenfactor0
|
||||||
|
|
||||||
|
\f3\b\fs44 \cf2 \uc0\u9989 Zusammengefasst
|
||||||
|
\f2\b0\fs24 \cf0 \
|
||||||
|
\
|
||||||
|
\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\sl324\slmult1\pardirnatural\partightenfactor0
|
||||||
|
|
||||||
|
\f6\b\fs40 \cf2 Ziel
|
||||||
|
\f2\b0\fs24 \cf0
|
||||||
|
\f6\b\fs40 \cf2 Vorgehen
|
||||||
|
\f2\b0\fs24 \cf0 \
|
||||||
|
\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\sl324\slmult1\pardirnatural\partightenfactor0
|
||||||
|
|
||||||
|
\f0\fs40 \cf2 Mehrere Domains/Subdomains auf denselben Container routen
|
||||||
|
\f2\fs24 \cf0
|
||||||
|
\f0\fs40 \cf2 Mehrere Traefik-Router mit unterschiedlichen
|
||||||
|
\f4 Host()
|
||||||
|
\f0 -Regeln, aber demselben Service
|
||||||
|
\f2\fs24 \cf0 \
|
||||||
|
|
||||||
|
\f0\fs40 \cf2 Domain im Container unterscheiden
|
||||||
|
\f2\fs24 \cf0
|
||||||
|
\f0\fs40 \cf2 Den
|
||||||
|
\f4 Host
|
||||||
|
\f0 -Header der Anfrage auslesen
|
||||||
|
\f2\fs24 \cf0 \
|
||||||
|
|
||||||
|
\f0\fs40 \cf2 SSL-Zertifikate
|
||||||
|
\f2\fs24 \cf0
|
||||||
|
\f0\fs40 \cf2 F\'fcr jede Domain einen Router mit
|
||||||
|
\f4 tls.certresolver
|
||||||
|
\f0 definieren (Traefik k\'fcmmert sich um Let\'92s Encrypt automatisch)
|
||||||
|
\f2\fs24 \cf0 \
|
||||||
|
\
|
||||||
|
\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\pardirnatural\partightenfactor0
|
||||||
|
\cf0 \
|
||||||
|
\uc0\u11835 \
|
||||||
|
\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\sl324\slmult1\pardirnatural\partightenfactor0
|
||||||
|
|
||||||
|
\f0\fs42 \cf2 \
|
||||||
|
Wenn du magst, kann ich dir ein vollst\'e4ndiges
|
||||||
|
\f4 docker-compose.yml
|
||||||
|
\f0 -Beispiel mit Traefik + deinem App-Container (inkl. HTTPS via Let\'92s Encrypt) zusammenstellen.\
|
||||||
|
\uc0\u55357 \u56393 Soll ich das machen?}
|
||||||
9
doc/ToDo.md
Normal file
9
doc/ToDo.md
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
# ToDos
|
||||||
|
|
||||||
|
2025-11-09 rxf
|
||||||
|
|
||||||
|
### Allgemain
|
||||||
|
|
||||||
|
* Daten, die via Mongo geholt werden (insbesondere die properties) cachen
|
||||||
|
* Vergleich auf die sensorid. Wenn die sich geändert hat, dann neu holen. Ansonsten aus dem Cache nehmen.
|
||||||
|
|
||||||
@@ -1,10 +1,10 @@
|
|||||||
{
|
{
|
||||||
"name": "sensorapi",
|
"name": "sensorapi_influx",
|
||||||
"version": "1.4.1",
|
"version": "1.5.0",
|
||||||
"date": "2023-11-29 16:00 UTC",
|
"date": "2025-11-22 10:00 UTC",
|
||||||
"private": true,
|
"private": true,
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"start": "node ./bin/www.js >>/var/log/sensorapi.log 2>&1",
|
"start": "node ./bin/www.js >>/var/log/sensorapi_i.log 2>&1",
|
||||||
"test": "mocha ./test/test.js"
|
"test": "mocha ./test/test.js"
|
||||||
},
|
},
|
||||||
"type": "module",
|
"type": "module",
|
||||||
|
|||||||
Reference in New Issue
Block a user