11#!/command/with-contenv bash
22
3+ echo "[CasaOS-LocalStorage] Starting CasaOS Local Storage service..."
4+ echo "[CasaOS-LocalStorage] Waiting for dependencies..."
5+
36# Get the message bus URL
47runtime_file="/var/run/casaos/message-bus.url"
58
9+ echo "[CasaOS-LocalStorage] Waiting for message bus to be ready..."
610while [ ! -f "$runtime_file" ]; do
711 sleep 1
8- echo "Casa Main waiting for message bus URL..."
12+ echo "[CasaOS-LocalStorage] Still waiting for message bus URL..."
913done
14+ echo "[CasaOS-LocalStorage] Message bus is ready!"
1015
1116# Wait for /var/run/casaos/routes.json to be created
17+ echo "[CasaOS-LocalStorage] Waiting for gateway routes configuration..."
1218while [ ! -f /var/run/casaos/routes.json ]; do
13- echo "Waiting for /var/run/casaos/routes.json to be created ..."
19+ echo "[CasaOS-LocalStorage] Still waiting for gateway routes ..."
1420 sleep 1
1521done
22+ echo "[CasaOS-LocalStorage] Gateway routes found!"
1623
1724# Wait for main service to be ready
25+ echo "[CasaOS-LocalStorage] Waiting for main service to be ready..."
1826while [ ! -f /var/run/casaos/casaos.url ]; do
27+ echo "[CasaOS-LocalStorage] Still waiting for main service..."
1928 sleep 1
2029done
30+ echo "[CasaOS-LocalStorage] Main service is ready!"
2131
2232# Define log filter function
2333filter_logs() {
@@ -84,4 +94,7 @@ filter_logs() {
8494 done
8595}
8696
87- exec gosu "$PUID:$PGID" /usr/local/bin/casaos-local-storage 2>&1 | filter_logs
97+ echo "[CasaOS-LocalStorage] Starting local storage server as UID:GID $PUID:$PGID..."
98+ echo "[CasaOS-LocalStorage] Local storage service ready - filtering logs for clarity"
99+ touch /var/run/casaos-status/local-storage-started
100+ exec gosu "$PUID:$PGID" /usr/local/bin/casaos-local-storage 2>&1 | filter_logs "local-storage"
0 commit comments