Skip to content

Commit 612134d

Browse files
authored
configurable ephemeral mode (#23)
1 parent 1751cd6 commit 612134d

3 files changed

Lines changed: 21 additions & 0 deletions

File tree

config.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,12 @@ options:
1818
mqtt_push: false
1919
mqtt_frequency: 5
2020
mqtt_debug: false
21+
ephemeral_mode: false
2122
schema:
2223
mqtt_push: bool
2324
mqtt_frequency: int(1,120)
2425
mqtt_debug: bool
26+
ephemeral_mode: bool
2527
mqtt_host: str?
2628
mqtt_port: port?
2729
mqtt_user: str?

docker/entrypoint.sh

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,19 @@ date
77

88
# Start MQTT publishing in the background
99
CONFIG_PATH=/data/options.json
10+
if [ -n "$ORB_EPHEMERAL_MODE" ]; then
11+
echo "Using ORB_EPHEMERAL_MODE from environment variables"
12+
else
13+
EPHEMERAL_MODE=$(jq -r '.ephemeral_mode // false' "$CONFIG_PATH")
14+
if [ "$EPHEMERAL_MODE" = "true" ]; then
15+
ORB_EPHEMERAL_MODE="1"
16+
export ORB_EPHEMERAL_MODE
17+
echo "ORB_EPHEMERAL_MODE is enabled"
18+
else
19+
echo "ORB_EPHEMERAL_MODE is disabled"
20+
fi
21+
fi
22+
1023
if [ -n "$MQTT_PUSH" ]; then
1124
echo "Using MQTT_PUSH from environment variables"
1225
else

translations/en.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,12 @@ configuration:
1313
name: Enable Debug Logging
1414
description: >-
1515
If set to `true`, debug logging will be enabled for MQTT operations.
16+
ephemeral_mode:
17+
name: Ephemeral Mode
18+
description: >-
19+
If set to `true`, Orb will avoid writing runtime data to disk. Enable
20+
this for flash-based devices where reducing write cycles matters; data
21+
will not persist across restarts.
1622
mqtt_host:
1723
name: MQTT Host
1824
description: >-

0 commit comments

Comments
 (0)