Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
76 commits
Select commit Hold shift + click to select a range
079598b
fix(plugins): Remove compatible_versions requirement from single plug…
Jan 3, 2026
5241bbf
fix(7-segment-clock): Update submodule with separator and spacing fixes
Jan 3, 2026
6b81873
fix(plugins): Add onchange handlers to existing custom feed inputs
Jan 4, 2026
d01c343
Add array-of-objects widget support to web UI
Jan 5, 2026
668fadb
Update plugins_manager.js cache-busting version
Jan 5, 2026
d7b9c47
Fix: Move array-of-objects detection before file-upload/checkbox checks
Jan 5, 2026
a9351f1
Update cache-busting version for array-of-objects fix
Jan 5, 2026
7d67495
Remove duplicate array-of-objects check
Jan 5, 2026
893436f
Update cache version again
Jan 5, 2026
4d7274b
Add array-of-objects widget support to server-side template
Jan 5, 2026
6da2059
Use window. prefix for array-of-objects JavaScript functions
Jan 5, 2026
ecea139
Fix syntax error: Missing indentation for html += in array else block
Jan 5, 2026
be62ac6
Update cache version for syntax fix
Jan 5, 2026
2993e67
Add debug logging to diagnose addArrayObjectItem availability
Jan 5, 2026
b38027d
Fix: Wrap array-of-objects functions in window check and move outside…
Jan 5, 2026
e2b0ab2
Update cache version for array-of-objects fix
Jan 5, 2026
1fa8e6a
Move array-of-objects functions outside IIFE to make them globally av…
Jan 5, 2026
8e86e58
Update cache version for IIFE fix
Jan 5, 2026
8803556
Fix: Add array-of-objects functions after IIFE ends
Jan 5, 2026
63bf148
Update cache version for array-of-objects fix
Jan 5, 2026
16928c0
Fix: Remove all orphaned code and properly add array-of-objects funct…
Jan 5, 2026
927b893
Add array-of-objects functions after IIFE ends
Jan 5, 2026
e0fff2c
Update cache version for syntax fix
Jan 5, 2026
f7d77de
Fix syntax error: Add missing closing brace for else block
Jan 5, 2026
1b14e4e
Update cache version for syntax fix
Jan 5, 2026
a920784
Replace complex array-of-objects widget with simple table interface
Jan 5, 2026
cefe17b
Add simple table interface for custom feeds
Jan 5, 2026
a8c262f
Fix custom feeds table issues
Jan 5, 2026
a50afed
Add fallback fix for feeds.custom_feeds dict-to-array conversion
Jan 5, 2026
a9a4281
feat(web): Add checkbox-group widget support for plugin config arrays
Jan 6, 2026
19b6fc2
feat(install): Add one-shot installation script
Jan 8, 2026
38ffaf0
fix: Remove accidental plugins/7-segment-clock submodule entry
Jan 8, 2026
b88842e
fix(array-objects): Fix schema lookup, reindexing, and disable file u…
Jan 8, 2026
c80c23c
fix(security): Fix XSS vulnerability in handleCustomFeedLogoUpload
Jan 8, 2026
0eb457f
fix: Update upload button onclick when reindexing custom feed rows
Jan 8, 2026
89f07b8
fix: Make custom feeds table widget-specific instead of generic fallback
Jan 8, 2026
3f36c3a
fix: Add image/gif to custom feed logo upload accept attribute
Jan 8, 2026
89f9876
fix: Add hidden input for enabled checkbox to ensure false is submitted
Jan 8, 2026
520b87a
fix: Expose renderArrayObjectItem to window for addArrayObjectItem
Jan 8, 2026
77c68ce
fix: Reorder array type checks to match template order
Jan 8, 2026
fc33bcf
fix: Handle None value for feeds config to prevent TypeError
Jan 8, 2026
57aa7d1
fix: Add default value for AVAILABLE_SPACE to prevent TypeError
Jan 8, 2026
8c2e350
fix: Wrap debug console.log in debug flag check
Jan 8, 2026
deef9a1
fix: Expose getSchemaProperty, disable upload widget, handle bracket …
Jan 8, 2026
97c684a
fix: Remove duplicate submit handler to prevent double POSTs
Jan 8, 2026
f17214f
fix: Use indexed names for checkbox-group to work with existing parser
Jan 8, 2026
6f6b42c
fix: Set values from item data in fallback array-of-objects rendering
Jan 8, 2026
9416f1b
fix: Remove extra closing brace breaking if/else chain
Jan 8, 2026
d7b4299
fix: Remove local logger assignments to prevent UnboundLocalError
Jan 8, 2026
fba7769
Merge remote-tracking branch 'origin/main' into feature/one-shot-inst…
Jan 8, 2026
37eaafe
fix: Fix checkbox-group serialization and array-of-objects key leakage
Jan 8, 2026
36f948a
fix: Make _data field matching more specific to prevent false positives
Jan 8, 2026
52d835c
fix: Add HTML escaping to prevent XSS in fallback code and checkbox-g…
Jan 8, 2026
c198fec
fix: Recreate one-shot install script with APT permission and non-int…
Jan 9, 2026
7b90abd
fix: Pass both -y flag and env var to first_time_install.sh for non-i…
Jan 9, 2026
17cc0ae
fix: Improve /tmp permission handling and non-interactive mode detection
Jan 9, 2026
885e49c
refactor: Simplify /tmp permission handling - only fix if actually wrong
Jan 9, 2026
a05c503
fix: Remove user confirmation prompts in install_wifi_monitor.sh for …
Jan 9, 2026
f2db1d2
fix: Explicitly pass ASSUME_YES to install_wifi_monitor.sh and simpli…
Jan 11, 2026
4e7342c
refactor: Remove all prompts from install_wifi_monitor.sh - install p…
Jan 11, 2026
50e54c1
fix: Address multiple issues in debug script, array rendering, and cu…
Jan 11, 2026
2f199fd
fix: Make install_wifi_monitor.sh more resilient to failures
Jan 11, 2026
31faac6
fix: Make WiFi monitor installation failure non-fatal in first_time_i…
Jan 11, 2026
550ab42
fix: Use JSON encoding for bracket-notation arrays and add sentinel f…
Jan 11, 2026
16f0702
fix: Harden upload flow - HTTP status check, path normalization, prop…
Jan 11, 2026
60aad56
fix: Add bracket notation to checkbox-group input names
Jan 11, 2026
a315693
fix: Swap order of enabled checkbox and hidden input in custom-feeds
Jan 11, 2026
a482a9e
fix: Enable upload buttons for existing custom feed rows in template
Jan 11, 2026
f148bc2
fix: Expose escapeHtml to window object for use by global functions
Jan 11, 2026
2d7704a
fix: Escape single quotes in checkbox-group JSON value attribute
Jan 11, 2026
5315c8f
fix: Move hidden input before checkbox for enabled field in custom-feeds
Jan 11, 2026
1172e97
fix: Use dataset-driven indices for custom feed row reindexing
Jan 11, 2026
94f77d7
fix: Reset file input value to allow re-uploading same file
Jan 11, 2026
7d708ab
fix: Add proper attribute escaping for renderArrayObjectItem
Jan 11, 2026
80e5798
fix: Expose escapeAttribute to window object
Jan 11, 2026
aca5ae7
Merge origin/main into feature/one-shot-installer
Jan 11, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 36 additions & 17 deletions first_time_install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -239,11 +239,20 @@ echo ""
if [ "$ASSUME_YES" = "1" ]; then
echo "Non-interactive mode: proceeding with installation."
else
read -p "Do you want to proceed with the installation? (y/N): " -n 1 -r
echo
if [[ ! $REPLY =~ ^[Yy]$ ]]; then
echo "Installation cancelled."
exit 0
# Check if stdin is available (not running via pipe/curl)
if [ -t 0 ]; then
read -p "Do you want to proceed with the installation? (y/N): " -n 1 -r
echo
if [[ ! $REPLY =~ ^[Yy]$ ]]; then
echo "Installation cancelled."
exit 0
fi
else
# Non-interactive mode but ASSUME_YES not set - exit with error
echo "✗ Non-interactive mode detected but ASSUME_YES not set." >&2
echo " Please run with -y flag or set LEDMATRIX_ASSUME_YES=1" >&2
echo " Example: sudo ./first_time_install.sh -y" >&2
exit 1
fi
fi

Expand Down Expand Up @@ -973,28 +982,38 @@ if [ -f "$PROJECT_ROOT_DIR/scripts/install/install_wifi_monitor.sh" ]; then

if [ ! -f "/etc/systemd/system/ledmatrix-wifi-monitor.service" ] || [ "$NEEDS_UPDATE" = true ]; then
echo "Installing/updating WiFi monitor service..."
bash "$PROJECT_ROOT_DIR/scripts/install/install_wifi_monitor.sh"
# Run install script but don't fail installation if it errors (WiFi monitor is optional)
if bash "$PROJECT_ROOT_DIR/scripts/install/install_wifi_monitor.sh"; then
echo "✓ WiFi monitor service installation completed"
else
INSTALL_EXIT_CODE=$?
echo "⚠ WiFi monitor service installation returned exit code $INSTALL_EXIT_CODE"
echo " Continuing installation - WiFi monitor is optional and can be installed later"
fi
fi

# Harden service file permissions (if service was created)
if [ -f "/etc/systemd/system/ledmatrix-wifi-monitor.service" ]; then
chown root:root "/etc/systemd/system/ledmatrix-wifi-monitor.service" || true
chmod 644 "/etc/systemd/system/ledmatrix-wifi-monitor.service" || true
systemctl daemon-reload || true
fi

# Check if service was installed successfully
if systemctl list-unit-files | grep -q "ledmatrix-wifi-monitor.service"; then
echo "✓ WiFi monitor service installed"

# Check if service is running
if systemctl is-active --quiet ledmatrix-wifi-monitor.service 2>/dev/null; then
echo "✓ WiFi monitor service is running"
# Check if service was installed successfully
if systemctl list-unit-files | grep -q "ledmatrix-wifi-monitor.service"; then
echo "✓ WiFi monitor service installed"

# Check if service is running
if systemctl is-active --quiet ledmatrix-wifi-monitor.service 2>/dev/null; then
echo "✓ WiFi monitor service is running"
else
echo "⚠ WiFi monitor service installed but not running (may need required packages)"
fi
else
echo "⚠ WiFi monitor service installed but not running (may need required packages)"
echo "⚠ WiFi monitor service file exists but not registered with systemd"
fi
else
echo "⚠ WiFi monitor service installation may have failed"
fi
echo "⚠ WiFi monitor service file not created (installation may have failed)"
echo " You can install it later by running: sudo ./scripts/install/install_wifi_monitor.sh"
fi
else
echo "⚠ install_wifi_monitor.sh not found; skipping WiFi monitor installation"
Expand Down
85 changes: 85 additions & 0 deletions scripts/install/debug_install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
#!/bin/bash
# Quick diagnostic script to check why first_time_install.sh is failing
# Run this on the Pi: bash debug_install.sh

echo "=== Diagnostic Script for Installation Failure ==="
echo ""

echo "1. Checking if running as root:"
if [ "$EUID" -eq 0 ]; then
echo " ✓ Running as root (EUID=$EUID)"
else
echo " ✗ NOT running as root (EUID=$EUID, user=$(whoami))"
fi
echo ""

echo "2. Checking if first_time_install.sh exists:"
if [ -f "./first_time_install.sh" ]; then
echo " ✓ Found ./first_time_install.sh"
echo " Checking if executable:"
if [ -x "./first_time_install.sh" ]; then
echo " ✓ Is executable"
else
echo " ✗ NOT executable (fix with: chmod +x first_time_install.sh)"
fi
else
echo " ✗ NOT found in current directory"
echo " Current directory: $(pwd)"
fi
echo ""

echo "3. Testing argument passing with -y flag:"
echo " Running: bash ./first_time_install.sh -y --help 2>&1 | head -20"
if [ -f "./first_time_install.sh" ]; then
bash ./first_time_install.sh -y --help 2>&1 | head -20 || echo " ✗ Script failed or not found"
else
echo " ✗ first_time_install.sh not found"
fi
echo ""

echo "4. Checking environment variable:"
echo " LEDMATRIX_ASSUME_YES=${LEDMATRIX_ASSUME_YES:-not set}"
echo " Testing with env: env LEDMATRIX_ASSUME_YES=1 bash -c 'echo ASSUME_YES would be set'"
env LEDMATRIX_ASSUME_YES=1 bash -c 'echo " ASSUME_YES would be: ${LEDMATRIX_ASSUME_YES:-not set}"'
echo ""

echo "5. Testing sudo with arguments:"
echo " Command: sudo -E env LEDMATRIX_ASSUME_YES=1 bash ./first_time_install.sh -y --help 2>&1 | head -20"
if [ -f "./first_time_install.sh" ]; then
sudo -E env LEDMATRIX_ASSUME_YES=1 bash ./first_time_install.sh -y --help 2>&1 | head -20 || echo " ✗ Sudo command failed"
else
echo " ✗ first_time_install.sh not found"
fi
echo ""

echo "6. Checking /tmp permissions:"
echo " /tmp is writable: $([ -w /tmp ] && echo 'YES' || echo 'NO')"
echo " /tmp permissions: $(stat -c '%a' /tmp 2>/dev/null || echo 'unknown')"
echo " TMPDIR: ${TMPDIR:-not set}"
echo ""

echo "7. Checking stdin/TTY:"
if [ -t 0 ]; then
echo " ✓ stdin is a TTY (interactive)"
else
echo " ✗ stdin is NOT a TTY (non-interactive/pipe)"
echo " This is expected when running via curl | bash"
fi
echo ""

echo "8. Latest installation log:"
# Determine project root directory (parent of scripts/install/)
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
PROJECT_ROOT_DIR="$(cd "$SCRIPT_DIR/../.." && pwd)"
LOG_DIR="$PROJECT_ROOT_DIR/logs"
LOG_FILE=$(ls -t "$LOG_DIR"/first_time_install_*.log 2>/dev/null | head -1)
if [ -n "$LOG_FILE" ]; then
echo " Found: $LOG_FILE"
echo " Last 30 lines:"
tail -30 "$LOG_FILE" | sed 's/^/ /'
else
echo " No log files found in $LOG_DIR/"
fi
echo ""

echo "=== Diagnostic Complete ==="
72 changes: 50 additions & 22 deletions scripts/install/install_wifi_monitor.sh
Original file line number Diff line number Diff line change
Expand Up @@ -40,20 +40,28 @@ if ! command -v nmcli >/dev/null 2>&1 && ! command -v iwlist >/dev/null 2>&1; th
fi

if [ ${#MISSING_PACKAGES[@]} -gt 0 ]; then
echo "⚠ The following packages are required for WiFi setup:"
echo "Installing required packages for WiFi setup:"
for pkg in "${MISSING_PACKAGES[@]}"; do
echo " - $pkg"
done
echo ""
read -p "Install these packages now? (y/N): " -n 1 -r
echo ""
if [[ $REPLY =~ ^[Yy]$ ]]; then
sudo apt update
sudo apt install -y "${MISSING_PACKAGES[@]}"
echo "✓ Packages installed"

# Install packages automatically (no prompt)
# Use apt directly if running as root, otherwise use sudo
if [ "$EUID" -eq 0 ]; then
apt update || echo "⚠ apt update failed, continuing anyway..."
apt install -y "${MISSING_PACKAGES[@]}" || {
echo "⚠ Package installation failed, but continuing with WiFi monitor setup"
echo " You may need to install packages manually: apt install -y ${MISSING_PACKAGES[*]}"
}
else
echo "⚠ Skipping package installation. WiFi setup may not work correctly."
sudo apt update || echo "⚠ apt update failed, continuing anyway..."
sudo apt install -y "${MISSING_PACKAGES[@]}" || {
echo "⚠ Package installation failed, but continuing with WiFi monitor setup"
echo " You may need to install packages manually: sudo apt install -y ${MISSING_PACKAGES[*]}"
}
fi
echo "✓ Package installation completed"
fi

# Create service file with correct paths
Expand Down Expand Up @@ -81,7 +89,11 @@ WantedBy=multi-user.target
EOF
)

echo "$SERVICE_FILE_CONTENT" | sudo tee /etc/systemd/system/ledmatrix-wifi-monitor.service > /dev/null
if [ "$EUID" -eq 0 ]; then
echo "$SERVICE_FILE_CONTENT" | tee /etc/systemd/system/ledmatrix-wifi-monitor.service > /dev/null
else
echo "$SERVICE_FILE_CONTENT" | sudo tee /etc/systemd/system/ledmatrix-wifi-monitor.service > /dev/null
fi

# Check WiFi connection status before enabling service
echo ""
Expand Down Expand Up @@ -142,36 +154,52 @@ if [ "$WIFI_CONNECTED" = false ] && [ "$ETHERNET_CONNECTED" = false ]; then
echo " 2. Or connect via Ethernet cable"
echo " 3. Or proceed with installation - you can connect to LEDMatrix-Setup AP after reboot"
echo ""
if [ -z "${ASSUME_YES:-}" ] && [ -z "${LEDMATRIX_ASSUME_YES:-}" ]; then
read -p "Continue with WiFi monitor installation? (y/N): " -n 1 -r
echo ""
if [[ ! $REPLY =~ ^[Yy]$ ]]; then
echo "Installation cancelled. Connect to WiFi/Ethernet and run this script again."
exit 0
fi
fi
echo "Proceeding with WiFi monitor installation..."
echo " (WiFi monitor will enable AP mode if no network connection is detected)"
fi

# Reload systemd
echo ""
echo "Reloading systemd..."
sudo systemctl daemon-reload
if [ "$EUID" -eq 0 ]; then
systemctl daemon-reload
else
sudo systemctl daemon-reload
fi

# Enable and start the service
echo "Enabling WiFi monitor service to start on boot..."
sudo systemctl enable ledmatrix-wifi-monitor.service
if [ "$EUID" -eq 0 ]; then
systemctl enable ledmatrix-wifi-monitor.service
else
sudo systemctl enable ledmatrix-wifi-monitor.service
fi

echo "Starting WiFi monitor service..."
sudo systemctl start ledmatrix-wifi-monitor.service
if [ "$EUID" -eq 0 ]; then
systemctl start ledmatrix-wifi-monitor.service || echo "⚠ Failed to start service (may start on reboot)"
else
sudo systemctl start ledmatrix-wifi-monitor.service || echo "⚠ Failed to start service (may start on reboot)"
fi

# Check service status
echo ""
echo "Checking service status..."
if sudo systemctl is-active --quiet ledmatrix-wifi-monitor.service; then
if [ "$EUID" -eq 0 ]; then
SYSTEMCTL_CMD="systemctl"
else
SYSTEMCTL_CMD="sudo systemctl"
fi

if $SYSTEMCTL_CMD is-active --quiet ledmatrix-wifi-monitor.service 2>/dev/null; then
echo "✓ WiFi monitor service is running"
else
echo "⚠ WiFi monitor service failed to start. Check logs with:"
echo " sudo journalctl -u ledmatrix-wifi-monitor -n 50"
if [ "$EUID" -eq 0 ]; then
echo " journalctl -u ledmatrix-wifi-monitor -n 50"
else
echo " sudo journalctl -u ledmatrix-wifi-monitor -n 50"
fi
fi

echo ""
Expand Down
Loading