Repository navigation
Expand file tree
/
Copy pathsecrets.h.example
More file actions
58 lines (51 loc) · 2.36 KB
/
Copy pathsecrets.h.example
File metadata and controls
58 lines (51 loc) · 2.36 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
#ifndef SECRETS_H
#define SECRETS_H
// ========================================
// SECURITY CREDENTIALS
// Copy this file to secrets.h and fill in your real values.
// Do NOT commit secrets.h (it is in .gitignore).
// ========================================
// MQTT Server Details
#define SECRET_MQTT_SERVER "your-broker.example.com"
#define SECRET_MQTT_PORT 8883
// MQTT Authentication.
//
// The username must be the NODE role, not the server one: the production ACL
// (deploy/mosquitto/aclfile) lets `quakealert-node` publish to
// sensor/<station_id>/{trigger,heartbeat,status} and read only its own command
// topic. A node that connected as `quakealert-server` could subscribe to every
// station in the network and inject commands into other nodes — and this
// credential is readable from any node someone takes apart.
//
// The password is MQTT_NODE_PASSWORD from deploy/.env.prod, hashed into the
// broker's passwd file by deploy/scripts/init-mqtt-users.sh. Because every node
// shares it, rotating it means reflashing the fleet: keep it out of any build
// that leaves your hands.
#define SECRET_MQTT_USER "quakealert-node"
#define SECRET_MQTT_PASS "your_mqtt_node_password"
// MQTT TLS trust anchors.
//
// Leave BOTH of the defines below out for production. The firmware then pins
// the ISRG (Let's Encrypt) roots from src/mqtt_ca.h, which is what the broker's
// ACME certificate chains to, and verifies the hostname in SECRET_MQTT_SERVER
// against the certificate.
//
// Broker with its own CA (self-signed, or a private PKI): paste the CA
// certificate here and it replaces the public roots. Only the CA is needed, not
// the leaf: pinning the leaf means reflashing the fleet at every renewal.
//
// #define SECRET_MQTT_CA_CERT \
// "-----BEGIN CERTIFICATE-----\n" \
// "...\n" \
// "-----END CERTIFICATE-----\n"
// Last resort for a local broker whose certificate nothing can verify. This
// turns certificate validation OFF: the session is still encrypted, but any
// machine that can answer for the broker's name can collect the shared node
// credential and impersonate a station. The firmware announces it on every boot
// for that reason. Never ship a node with this set.
//
// #define SECRET_MQTT_ALLOW_INSECURE_TLS 1
// Optional: WiFi Backup (If WiFiManager fails)
#define SECRET_WIFI_SSID "YOUR_WIFI_NAME"
#define SECRET_WIFI_PASS "YOUR_WIFI_PASSWORD"
#endif