Commit graph

28 commits

Author SHA1 Message Date
roberts
9fee17af17 Disable browser caching for all static assets
Add no-cache middleware to set Cache-Control: no-store on CSS, JS,
asset, and HTML responses so code changes appear immediately.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-15 00:54:59 -05:00
roberts
3c295ba302 Replace file manager toolbar buttons with hamburger menu
Removed individual delete, upload, hidden files, and refresh buttons.
Added a hamburger (☰) menu with:
- Select: toggles selection mode with checkboxes for multi-select
- Delete: enabled only when files are selected
- Upload: file upload
- Refresh: reload current directory
- Show Hidden Files: toggles dotfile visibility, persisted via localStorage

Toolbar now only has New File, New Folder, and the hamburger menu for a
cleaner interface.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-15 00:48:33 -05:00
roberts
30f0536b00 Make hidden files toggle button more visible
The middle-dot character was too small at 14px. Use a larger period
with explicit 20px font size so the button is actually visible in
the toolbar.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-15 00:41:45 -05:00
roberts
11c4817497 Add show/hide hidden files toggle to file manager
Toolbar button (·) toggles visibility of dotfiles. Hidden by default,
click to show. Active state highlighted with accent color. Filtering
happens client-side so no backend changes needed.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-15 00:39:26 -05:00
roberts
6a0c8757f8 Run terminals and GUI apps as the authenticated user, not root
Atlus runs as root (systemd) but user-facing processes must run under the
authenticated user's identity. Added privilege-dropping via preexec_fn
(os.setgid + os.initgroups + os.setuid) to both terminal PTY spawning
and GUI app launching. System admin operations (services, packages,
network, updates) intentionally remain root.

Autostart apps now support a configurable default_user; without one set,
autostart defers until the first user logs in and runs as that user.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-15 00:35:52 -05:00
roberts
e44ee2fe64 Fix panel apps not rendering and Add button disappearing
Restructured loadPanelApps() to use per-operation try/catch instead of
one giant try/catch that silently swallowed errors. The Add button is now
appended unconditionally after the app list, so it always remains visible.
Each app row renders independently — a single bad app config won't break
the entire panel.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-15 00:24:16 -05:00
roberts
14f5ce7cf1 Add ethernet link watchdog and prevent disabling last active interface
- Ethernet watchdog: background task polls /sys/class/net every 5s, detects
  cable plug-in on disabled interfaces and auto-enables with DHCP
- interface_down endpoint now refuses to disable the only active interface
  (returns 409), preventing accidental lockout
- Frontend shows the error message instead of silently failing

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-15 00:12:00 -05:00
roberts
8d48e3eeb8 App exit diagnostics, desktop file discovery, WiFi wpa_supplicant fix
- Capture stderr from GUI apps and show meaningful exit reasons (signal names,
  error messages) instead of generic "Application exited"
- Add /api/display/discover-apps endpoint that scans .desktop files for
  installed GUI apps, replacing manual-only app configuration
- Settings > Applications now shows discoverable apps with one-click Add,
  with manual form available as fallback
- Fix WiFi: start wpa_supplicant before bringing interface up, handle rfkill
  blocks, add retry logic and error messages to scan results
- Fix WiFi scan frontend bug: response is {networks:[...]} not a bare array
- Add iw and wpasupplicant to install.sh dependencies

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-15 00:03:13 -05:00
roberts
f8fe4e1296 Move GUI apps from left dock to right panel only, refresh panel on add/remove
- Remove dock button creation from display.js initGuiApps (apps belong in right panel)
- Register GUI app modules dynamically in loadPanelApps for newly added apps
- Refresh right panel immediately after adding/removing apps in Settings
- Expose loadPanelApps globally for cross-module panel refresh

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-14 23:55:52 -05:00
roberts
076ca348d7 Fix package detection using dpkg-query, add apt-get update before install, add libxcb-cursor0 dep
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-14 23:51:53 -05:00
roberts
983857bd5b Notification for required packages install prompt added. 2026-03-14 23:51:03 -05:00
roberts
23e4906d08 Replace panel services with docked apps, add autostart and update scanner settings
Panel: SERVICES section becomes APPLICATIONS — shows configured GUI apps with
status dots, launch/stop controls, and "+ Add" button linking to Settings.

Backend: DisplayManager.autostart_apps() launches autostart-enabled GUI apps on
service startup (always-on desktop session). Lifespan calls it before yield.

Settings: new Applications section for managing GUI apps (add/remove/autostart
toggle). General section gains update scanner interval + enable/disable toggle.
Config adds update_check_enabled and update_check_interval fields.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-14 23:40:44 -05:00
roberts
06e958f488 Add WiFi SSID/password support and replace DHCP/Static toggle with radio buttons
Backend: wireless interface detection, wpa_supplicant config writing, WiFi scan
endpoint via iw/iwlist. Frontend: segmented radio selector for DHCP/Static (fixes
text overflow behind right panel), SSID/password fields for wireless interfaces
with network scan dropdown, Apply handler sends WiFi credentials.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-14 23:21:47 -05:00
roberts
a73b515258 Add native GUI app support via per-window frame streaming
Each configured GUI app (e.g. Nextcloud) gets its own dock icon and
opens as a regular Atlus tab. Under the hood: Xvfb virtual display,
ImageMagick captures individual window pixmaps as JPEG, streams over
WebSocket to a canvas element, with xdotool forwarding mouse/keyboard
input back to the X11 window. Apps persist in background when tab is
closed, and streaming pauses when no viewers are attached.

New files: backend/display.py (DisplayManager + ManagedGuiApp),
backend/routers/display.py (WebSocket + REST), frontend display.js/css.
Config: gui_apps array in settings for registered applications.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-14 23:09:15 -05:00
roberts
6b407a056b Remove X11/noVNC display feature entirely
The Xvfb + x11vnc + websockify + noVNC approach defeats the purpose
of a native web desktop environment. Removed all related backend
(display.py, routers/display.py), frontend (xdisplay.js/css, panel
tray polling), and installer (X11 deps) code.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-14 22:45:18 -05:00
roberts
a88e7bbb06 Fixed polling agent and status bars. 2026-03-14 22:41:00 -05:00
roberts
91e3fa13c6 Poll for updates every 60 seconds instead of 30 minutes
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-14 22:04:18 -05:00
roberts
c773eddea4 Use mono font for update status to match panel style
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-14 22:02:47 -05:00
roberts
436a009059 Update panel: always show version status (up-to-date or update available)
Replace dismissable toast with persistent status row showing a green
dot + "Up to date" with commit hash, or amber dot + "Update available"
with an inline Install button. One or the other is always visible.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-14 21:49:37 -05:00
roberts
eb1aa9d434 Fix update checker: find git despite systemd minimal PATH
shutil.which("git") fails under systemd's stripped PATH. Added
_find_git() that checks common locations (/usr/bin/git, etc.)
as fallback. Also added null-safe check on apiFetch response
in the update checker frontend code.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-14 21:48:34 -05:00
roberts
68fe9b4435 Fix terminal session: better error handling, reliable state save
- Fix asyncio.get_event_loop() → get_running_loop() in PTY reader
- Add error logging for PTY spawn failures
- Add POST /api/session/state endpoint for sendBeacon (beforeunload)
- Use navigator.sendBeacon for reliable state save on page close
- Improve frontend error reporting when terminal creation fails

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-14 21:46:08 -05:00
roberts
220a5234cd Add persistent/roaming desktop sessions
PTY terminals now survive browser refresh and close. Session manager
owns PTY lifecycle independently of WebSocket connections, with
background readers storing scrollback for replay on reconnect. Desktop
state (open apps, active app, terminal tabs) persists server-side and
restores automatically on login. Auth tokens moved to localStorage.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-14 21:41:28 -05:00
roberts
c3e127421b Fix package manager: better error handling, debug endpoint, robust PATH
- Rewrote _apt helper as _run_cmd that never raises (returns rc/stdout/stderr)
- Handle stderr warnings from apt-cache gracefully (common on Armbian)
- Catch FileNotFoundError if binary missing despite PATH fix
- Show actual backend error message in frontend instead of generic "Search failed"
- Add /api/packages/debug endpoint for troubleshooting apt-cache issues
- Add logging throughout for server-side diagnostics

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-14 19:33:04 -05:00
roberts
0ec9726db4 Fix PATH for apt/git/nmcli in systemd service environment
systemd runs services with a minimal PATH that may not include
/usr/bin or /usr/sbin. Add _safe_env() helpers that ensure standard
paths are present, and expand apt-cache discovery to check common
locations directly.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-14 19:20:28 -05:00
roberts
9c402e3726 Add package manager, text editor, file manager enhancements, auto-updates
Package Manager (new app):
- Search, install, remove apt packages via web UI
- Backend: apt-cache/dpkg-query/apt-get wrapper with input validation
- Frontend: searchable package list with expandable detail panels

Text Editor / File Viewer (new app):
- Opens from file manager, supports text editing with line numbers
- Image preview via authenticated blob URLs
- Binary file info display with download option
- Ctrl+S / Cmd+S save, dirty tracking, tab key support

File Manager enhancements:
- Toolbar: New File, New Folder, Upload, Delete, Refresh buttons
- Context menu: New File/Folder options, Open in Editor
- Double-click files to open in editor
- Right-click empty area for create options

Auto-update notification:
- Backend checks git repo for new commits (fetch + compare)
- One-click update: git pull + pip install + service restart
- Toast notification in right panel with dismiss option
- Polls every 30 minutes, retry logic for server restart

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-14 19:13:13 -05:00
roberts
4631ebc07a Add network configuration to Settings (DHCP/static, WiFi scan/connect)
Full NetworkManager (nmcli) backed network management:
- Backend: new network.py router with endpoints for device status,
  connection config, IPv4 DHCP/static toggle, WiFi scan/connect/disconnect
- Frontend: interactive network settings UI with per-device config,
  WiFi network list with signal strength, inline password input
- Graceful 503 fallback to read-only psutil view when nmcli unavailable

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-14 18:29:35 -05:00
roberts
342dc0f0cf Fix robustness issues across backend and frontend
- Add shutil.which guard to _run() in settings, asi_bridge routers
- Catch RuntimeError on WebSocket disconnect in services, asi_bridge
- Make file listing resilient to individual entry errors
- Fix keyboard double-fire on touch devices (touchstart + click)
- Update install.sh with correct Gitea repo URL
- Add six to requirements.txt (python-pam dependency)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-14 17:41:43 -05:00
roberts
f9743bb29a Initial commit — Atlus web desktop environment for SBCs
Full-stack implementation: FastAPI backend with PAM auth, WebSocket
stats/terminal, and vanilla JS frontend with tiling desktop shell.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-14 16:53:46 -05:00