API-Auth dazu

automatisch auf INFLUX schalten, wenn es Chi-ID gibt
zuzsätzlich option db=m zum erzwingen von Moing
Anzeige Mongo/Influx im Datenstrom
This commit is contained in:
2025-11-05 09:47:25 +00:00
parent 6d9d94f2fa
commit bd44740649
9 changed files with 973 additions and 22 deletions

18
generate-apikey.js Executable file
View File

@@ -0,0 +1,18 @@
#!/usr/bin/env node
// Script to generate API keys for the SensorAPI
import crypto from 'crypto'
const count = parseInt(process.argv[2]) || 1
console.log(`Generating ${count} API Key(s):\n`)
for (let i = 0; i < count; i++) {
const apiKey = crypto.randomBytes(32).toString('hex')
console.log(`${i + 1}. ${apiKey}`)
}
console.log('\nAdd these keys to your .env file:')
console.log('API_KEYS=key1,key2,key3')
console.log('\nOr set API_AUTH_REQUIRED=true to enable authentication')