61 Commits

Author SHA1 Message Date
MayaTheShy
099f5aa287 fix: enhance WebSocket bridge connection to flush pending commands and improve initial sync 2026-03-29 14:42:47 -04:00
MayaTheShy
badde91336 fix(docker): clone platform from git instead of additional_contexts
The additional_contexts approach required cc-platform-core to exist on
the Docker host at a relative path. This fails on servers where the
repo layout differs. Instead, use a multi-stage build: stage 1 clones
cc-platform-core from Gitea (depth 1), stage 2 copies server/ into the
app and rewrites the file: path. Fully self-contained — no host deps.
2026-03-28 22:37:57 -04:00
MayaTheShy
c3344288a8 fix(docker): resolve @cc-platform/server file: dep in container build
Use additional_contexts to copy platform server package into the Docker
build context. Rewrites the file: dependency path and removes the
lockfile so npm install can resolve the local package correctly.
2026-03-28 22:35:39 -04:00
MayaTheShy
021b351248 feat: replace hand-rolled WebSocketServer with createWebSocketManager for improved connection handling and state updates 2026-03-26 16:00:58 -04:00
MayaTheShy
b782d5c8f9 feat: add @cc-platform/server dependency and update package-lock.json 2026-03-26 16:00:53 -04:00
MayaTheShy
075d42ecab feat: update server log messages to use dynamic port variable 2026-03-26 15:20:01 -04:00
MayaTheShy
379d08b594 feat: refactor server setup to use createPlatformServer and streamline middleware 2026-03-26 15:19:27 -04:00
MayaTheShy
d54855bf19 feat: add missing dependency for cc-platform server in package.json 2026-03-26 15:19:22 -04:00
MayaTheShy
97983156c6 feat: expand upstream CDN mapping for additional modpack support 2026-03-26 13:43:50 -04:00
MayaTheShy
46f7b0c98a feat: expand supported mods in download-textures script for enhanced asset management 2026-03-26 13:43:47 -04:00
MayaTheShy
13b374d7f8 feat: implement smart texture resolution and indexing for improved asset management 2026-03-26 13:11:06 -04:00
MayaTheShy
981e561c2d feat: add download-textures script to package.json for texture management 2026-03-26 13:11:02 -04:00
MayaTheShy
a50a6e9697 feat: add texture download logic to entrypoint script for initial setup 2026-03-26 13:10:53 -04:00
MayaTheShy
c74898049a feat: add download-textures script for bulk downloading Minecraft and Create textures 2026-03-26 13:10:49 -04:00
MayaTheShy
5dd9bd9344 feat: add recursive crafting and recipe management endpoints for enhanced crafting capabilities 2026-03-25 22:37:08 -04:00
MayaTheShy
e59b6c1832 feat: upgrade Node.js version to 20-alpine in Dockerfiles and improve healthcheck command 2026-03-22 22:44:26 -04:00
MayaTheShy
96afe8dcb7 Fix silent Docker crash: recursive chown, db error handling
- Entrypoint: chown -R /data (not just the directory) so existing
  volume files owned by root become writable by node user
- Entrypoint: add echo logging so startup progress is visible
- db.js: verify /data is writable before opening SQLite
- db.js: wrap Database() constructor in try-catch with clear error
  message instead of crashing silently at ESM import time
2026-03-22 21:22:30 -04:00
MayaTheShy
1b0b1c570d Fix health check: use wget -qO instead of --spider, increase start_period to 30s 2026-03-22 21:15:43 -04:00
MayaTheShy
173a0a9f95 Persist config files across Opus package updates
The Opus package manager deletes the entire package directory on
update (fs.delete(packageDir)) before re-downloading files. This
wiped all config files (.manager_config, .client_config, etc.) that
were stored inside packages/inventory-manager/.

Fix: add _configPath() helper to every program that resolves config
file paths to usr/config/inventory-manager/ when running under Opus,
which lives outside the package directory and survives updates.
Falls back to the local _path() for standalone (non-Opus) use.

Updated files:
- inventoryManager.lua, manager/config.lua, inventoryClient.lua,
  inventoryWebBridge.lua, dropperController.lua, craftingTurtle.lua
- .package install script: saves configs to usr/config/inventory-manager/
- autorun/startup.lua: checks both persistent and package dirs
- startup/client.lua: uses persistent dir for .client_setup/.dropper_config
- web/server/Dockerfile: switch health check to wget (from prior fix)
2026-03-22 20:51:31 -04:00
MayaTheShy
01eef4eead fix: correct typo in HEALTHCHECK start-period option 2026-03-22 20:44:57 -04:00
MayaTheShy
a499446366 fix: use wget for Docker health check instead of node
Spawning a full Node process for health checks is slow on Alpine and
can exceed the 3s timeout, causing the container to be marked unhealthy.
Use wget (built into Alpine) instead, and increase start_period to 15s.
2026-03-22 20:42:37 -04:00
MayaTheShy
b49574f39b fix: SQLite readonly error in Docker container
- Add entrypoint script that ensures /data is owned by node user
  before dropping privileges with su-exec
- Remove USER node from Dockerfile (entrypoint handles it)
- Change client depends_on to service_healthy so nginx waits for
  the server to pass its healthcheck before starting
2026-03-22 19:15:04 -04:00
MayaTheShy
40df13e756 Refactor database test setup to use DB_PATH from vitest.config.js 2026-03-22 11:54:57 -04:00
MayaTheShy
f2634328ec Add Vitest configuration for testing environment setup 2026-03-22 11:54:51 -04:00
MayaTheShy
53863657d7 Refactor code structure for improved readability and maintainability 2026-03-22 11:54:07 -04:00
MayaTheShy
ba0cbfbbb6 Add unit tests for server logic including rate limiter, normalization helpers, and input validation 2026-03-22 11:52:33 -04:00
MayaTheShy
a8513b339c Add comprehensive tests for the database layer in db.test.js 2026-03-22 11:51:47 -04:00
MayaTheShy
21f12501ca Add testing scripts and update devDependencies in package.json 2026-03-22 11:46:57 -04:00
MayaTheShy
026d0c8d6b Add Cross-Project Integration API for RemoteTurtle system 2026-03-22 04:10:11 -04:00
MayaTheShy
2ac11350e6 Add API endpoint for remote reboot of CC:Tweaked computers 2026-03-22 03:15:36 -04:00
MayaTheShy
479e1918f5 Implement rate limiting and enhance input validation for API endpoints 2026-03-22 02:57:21 -04:00
MayaTheShy
9d5fceee5c Enhance Dockerfile to create SQLite data directory with proper ownership 2026-03-22 02:57:18 -04:00
MayaTheShy
78674714b1 Enhance WebSocket keep-alive mechanism to include bridge connections and handle stale connections 2026-03-22 02:41:52 -04:00
MayaTheShy
460cf34252 Enhance WebSocket error handling and implement command idempotency for dropper nickname and recipe management endpoints 2026-03-22 02:38:30 -04:00
MayaTheShy
0fb57d7c94 Ensure database is only closed if it is open in closeDb function 2026-03-22 02:38:17 -04:00
MayaTheShy
465efbeb0e Implement API key authentication for secure access to mutating endpoints and WebSocket connections 2026-03-22 02:13:24 -04:00
MayaTheShy
bbae2740a7 Implement idempotent command tracking with cleanup and caching for improved request handling 2026-03-22 02:12:18 -04:00
MayaTheShy
a5e6be7f4b Enhance command handling: implement monotonic ID for deduplication and improve acknowledgment process 2026-03-22 01:29:16 -04:00
MayaTheShy
bee1019fd6 Add dropper nickname management: implement get and set endpoints 2026-03-21 20:55:01 -04:00
MayaTheShy
5416f18f4b Add droppers to full state load: include droppers array from inventory metadata for comprehensive state management 2026-03-21 20:12:54 -04:00
MayaTheShy
9f75866ce7 Notify web clients on bridge connection status: broadcast updates when the bridge connects or disconnects 2026-03-21 20:05:45 -04:00
MayaTheShy
79eca14f4c Add dropper location selector: discover available droppers on network, pass through server, and add dropdown in order panel for location-based dispensing 2026-03-21 19:57:13 -04:00
MayaTheShy
fcfef379be Add droppers array to state update: ensure droppers data is handled correctly in the state from bridge 2026-03-21 19:41:56 -04:00
MayaTheShy
05f5a3519e Add texture proxy and caching mechanism: implement upstream fetching and local caching for texture assets 2026-03-21 19:29:59 -04:00
MayaTheShy
b5ae28944d Enhance health check and inventory endpoints: include bridge connection status and web client count 2026-03-21 19:26:36 -04:00
MayaTheShy
29498a2f6a Major UI overhaul: bigger icons, creative inventory tabs, grouped smelting, alerts popup, analytics, mod icons
- Inventory: Bigger item icons (48px) filling their slots, MC-style hover tooltips
- Creative inventory category tabs (All/Blocks/Tools/Combat/Food/Redstone/Materials/Misc)
- Smelting recipes grouped by output item with collapsible sections
- Alerts moved from full tab to popup overlay triggered from header bell icon
- New Analytics tab with SVG charts (storage over time, top items, item trend lookup)
- Mod icon support for ComputerCraft (CC:Tweaked) via GitHub CDN fallback
- Server: new /api/history-summary endpoint for aggregate storage history
- Store: fetchHistorySummary and fetchItemHistory for analytics data
2026-03-21 19:07:17 -04:00
MayaTheShy
c25ef9f2cc Fix inventory disappearing: add WS keep-alive pings + HTTP API fallback
- Server pings web clients every 25s to keep connections alive through reverse proxies
- Client fetches /api/inventory on page load (doesn't depend solely on WebSocket)
- Prevent duplicate WebSocket connections on reconnect
- Deduplicate initial_state/state_update handlers
2026-03-21 18:35:17 -04:00
MayaTheShy
4af91235e1 Refactor furnace input, fuel, and output handling: stringify on save and parse on load 2026-03-21 18:21:23 -04:00
MayaTheShy
80338d1973 Fix live updates: debounce DB writes, broadcast before saving, include smeltable/craftable in updates 2026-03-21 18:15:50 -04:00
MayaTheShy
aed7d1f735 Enhance database performance: add cache size and temp store settings; refactor alert clearing statement 2026-03-21 18:14:16 -04:00