-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAppConfig.h
More file actions
37 lines (34 loc) · 1.03 KB
/
Copy pathAppConfig.h
File metadata and controls
37 lines (34 loc) · 1.03 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
/*
* Libation Locker by Dan Roberts
*
* Local, self-hosted ESP32 web app for tracking spirits / bottle inventory.
* - AP-first with optional STA join
* - LittleFS persistence
* - JSON REST API + single-page UI
*
* Creator: Dan Roberts
* License: GPL-3.0
*/
#pragma once
#include <Arduino.h>
struct RuntimeConfig {
String apSsid = "LibationLocker";
// IMPORTANT: For safety when sharing the device, do NOT leave this blank.
// If blank at boot, AppConfig::begin() will use the compiled-in default.
String apPass = "adminadmin";
// HTTP Basic Auth for UI + API.
// If webUser is blank, auth is disabled. Default is admin/admin.
// If webUser is set, requests must include valid Basic Auth credentials.
String webUser = "admin";
String webPass = "admin";
// data paths (unused when persistence disabled)
String inventoryPath = "/data/inventory.json";
String configPath = "/data/config.json";
};
class AppConfig {
public:
static void begin();
static const RuntimeConfig& get();
private:
static RuntimeConfig _cfg;
};