Commit graph

53 commits

Author SHA1 Message Date
Erik
8f681398ee Fix login page: allow /icons/ through auth middleware, match color scheme to AC logo 2026-04-10 20:07:06 +02:00
Erik
6e090eb4dc Fix bcrypt incompatibility: replace passlib with direct bcrypt 5.x API 2026-04-10 19:55:55 +02:00
Erik
b09169ade2 feat: add app-level authentication with login, session cookies, and admin panel
Replace Nginx basic auth with proper user accounts:
- Session cookies via itsdangerous (30-day expiry, httponly, secure)
- Password hashing with bcrypt via passlib
- Login page with AC-themed UI
- Admin page for user management (CRUD)
- AuthMiddleware exempts plugin WS and browser WS endpoints
- Issues/comments author auto-populated from session
- Sidebar shows logged-in username, admin link, and logout
- Seed users: erik (admin), alex, lundberg
- SECRET_KEY env var for cookie signing
2026-04-10 19:45:08 +02:00
Erik
f96171a345 feat: issues board - add submitter name, comments, and edit support 2026-04-10 17:36:08 +02:00
Erik
21e72b438f fix: use content-type instead of path for no-cache detection
Root "/" path doesn't match .html ending. Checking the response's
content-type header catches index.html served via html=True and is
more robust for any URL that returns HTML/JS/CSS/JSON.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-10 09:59:03 +02:00
Erik
4fe0977b71 fix: also apply no-cache to root path serving index.html
The StaticFiles path is empty for root "/" which served index.html via
html=True. Include root/directory paths in the no-cache match.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-10 09:58:13 +02:00
Erik
994bc618db fix: force browser revalidation for JS/CSS/HTML static files
FastAPI StaticFiles sets Last-Modified/ETag but no Cache-Control, so
browsers use heuristic caching and can serve stale code after git pull.

Subclass StaticFiles to add 'Cache-Control: no-cache, must-revalidate'
on .html/.js/.css/.json files. ETag/Last-Modified still work, so
revalidation returns efficient 304 Not Modified when unchanged.

Other assets (images, fonts, tile textures) are unaffected and cache
normally.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-10 09:57:00 +02:00
Erik
604d4376b4 feat: two-step issue resolution (resolve then delete)
- New PATCH /issues/{id} endpoint to toggle resolved flag
- Add resolved:false to new issues
- Frontend: click "✓ Resolve" marks issue green with strikethrough
- Resolved issues show "↺ Reopen" and "🗑 Delete" buttons
- Delete requires confirmation
- Sort: unresolved first, then resolved
- Issues persist until explicitly deleted

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-10 09:48:20 +02:00
Erik
f2b43fce0b fix: store openissues.json in bind-mounted static/ dir
Was stored at /app/openissues.json (ephemeral container filesystem).
Moved to /app/static/openissues.json which is bind-mounted to the
host at ./static/, persisting across container rebuilds.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-09 19:32:28 +02:00
Erik
38ca6ead12 feat: version display + issues board
Version: CalVer + git hash shown in top-right corner of main page.
Built via Docker ARG BUILD_VERSION at build time. Served via /api-version.

Issues Board: shared notepad window for tracking issues with plugin,
overlord, nav files, macros. Stored in openissues.json on server.
- GET/POST/DELETE /issues endpoints
- Draggable window matching Chat/Radar pattern
- Category tags (plugin, overlord, nav, macro, other) with colors
- Add/resolve issues through the UI

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-09 12:53:06 +02:00
Erik
b941a29f04 feat: add dungeon map streaming and rendering in radar
- Backend: dungeon_map event handler with permanent in-memory cache
  by landblock ID, request_dungeon_map for late-joining browsers
- Frontend: render dungeon cells as colored rectangles when in dungeon,
  multi-level Z support (current floor bright, others dimmed),
  automatic overworld/dungeon switching based on is_dungeon flag,
  raw physics coordinate positioning for dungeon objects

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-08 13:16:36 +02:00
Erik
3852cf205e Add real-time radar feature for nearby objects
Browser can open a radar window per character that streams nearby
monsters, players, NPCs, portals, and other objects in real-time.
On-demand activation via start_radar/stop_radar commands through
the existing WebSocket command channel.

- Backend: nearby_objects event handler with in-memory cache and broadcast
- Frontend: canvas mini-map + entity list table in draggable window
- Radar button added to player list alongside Chat/Stats/Inventory/Char

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-07 23:01:05 +02:00
erik
c0da36c280 fix: decouple browser broadcast from plugin WebSocket receive loop
🧝‍♂️ Fix 1: The Mailman Story

Imagine you're a mailman delivering letters. Before, you had to
knock on every door and wait for someone to answer before you could
go back to your truck and get more letters.

But your truck keeps getting MORE letters dumped in it! And if
you're stuck waiting at grandma's door... your truck overflows
and letters fall everywhere! 📬💥

The fix: Now you have a magic helper elf! You hand the letters to
the elf and say "you go deliver these!" while you run back to the
truck to grab more. The elf handles the doors, you handle the truck.
Nobody waits! 🧝‍♂️

🍕 Fix 2: The Pizza Party Story

Now let's talk about that elf. The elf had a problem too!

Imagine you have 5 friends at a pizza party and you're handing out
slices. Before, the elf would:

1. Give pizza to Tommy → wait for him to take a bite 🍕
2. Give pizza to Sally → wait for her to take a bite 🍕
3. Give pizza to Bobby → wait for him to take a bite 🍕

So boring! Everyone's just sitting there hungry!

The fix: Now the elf throws ALL the pizza slices at the same time!
🍕🍕🍕🍕🍕 Everyone gets their pizza at once and nobody has to
wait for Tommy to finish chewing!

Yay! 🎉

Technical details:
- Use asyncio.create_task() to fire-and-forget broadcasts
- Use asyncio.gather() to send to all browsers concurrently
- Plugin receive loop no longer blocks on slow browser clients

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-30 20:53:59 +00:00
Erik
bb89aaa6bc fix: drop stalled browser websocket clients 2026-03-13 16:55:17 +01:00
Erik
40217572b1 fix: accept burden stats from plugin 2026-03-13 10:55:27 +01:00
Erik
a7e2d4d404 feat: stream live equipment cantrip states 2026-03-13 08:59:43 +01:00
Erik
b204ba8e75 fix: improve mana tracker state matching 2026-03-13 08:25:37 +01:00
erik
fc557ab1d5 feat: update inventory frontend and services to current production state 2026-03-07 08:37:32 +00:00
erik
973c3722bc fix: address code review findings for inventory delta feature
- Fix remaining f-string SQL injection in process_inventory (same pattern
  as single-item endpoints: parameterized ANY(:ids) queries)
- Add null guard for item_id in backend delta remove handler
- Add response status logging for inventory service HTTP calls
- Fix frontend ID fallback consistency in updateInventoryLive
- Replace debug print() with logger.debug()
- Add comment for Decal Slot_Decal magic number

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-28 15:58:10 +00:00
erik
664bd50388 feat: handle inventory_delta messages and broadcast to browsers
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-28 15:41:02 +00:00
erik
176fb020ec Redesign character window to match TreeStats layout and style
Replace the AC stone-themed single-scroll character window with a TreeStats-
style tabbed interface. Two side-by-side tab containers: left (Attributes,
Skills, Titles) and right (Augmentations, Ratings, Other), plus an Allegiance
section below. Exact TreeStats color palette (#000022 bg, #af7a30 gold
borders, purple specialized, teal trained). Backend accepts new properties
and titles fields in character_stats message for JSONB storage.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-27 14:39:20 +00:00
erik
ab9f86d7a6 Add character_stats table for persistent character data storage
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-26 14:59:49 +00:00
erik
e0265e261c Add suitbuilder backend improvements and SSE streaming fix
- Add dedicated streaming proxy endpoint for real-time suitbuilder SSE updates
- Implement stable sorting with character_name and name tiebreakers for deterministic results
- Refactor locked items to locked slots supporting set_id and spell constraints
- Add Mag-SuitBuilder style branch pruning tracking variables
- Enhance search with phase updates and detailed progress logging
- Update design document with SSE streaming proxy fix details

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-05 19:14:07 +00:00
erik
8cae94d87d Add client-side spell column sorting and improve inventory search
- Implement client-side sorting for all columns including spell_names
- Add computed_spell_names CTE for server-side sort fallback
- Add resizable columns with localStorage persistence
- Add Cloak slot detection by name pattern
- Increase items limit to 50000 for full inventory loading
- Increase proxy timeout to 60s for large queries
- Remove pagination (all items loaded at once for sorting)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-28 15:32:54 +00:00
erik
42d5dab319 fixed correct counting of kills 2026-01-20 21:43:21 +00:00
erik
e6db0f094c Fixed error portal insert 2025-09-23 20:13:35 +00:00
erik
6c646719dd reduced duplicate insert errors of portals, still present because of two players disovering the same portal at the same time, other changes to inventory 2025-09-22 18:21:04 +00:00
erik
4d19e29847 major fixes for inventory 2025-07-02 10:29:36 +00:00
erik
00ef1d1f4b Now with sawato life chat 2025-06-25 08:50:08 +00:00
erik
7ff94b59a8 fixed portals 2025-06-24 19:13:31 +00:00
erik
dffd295091 added portals, quest tracking, discord monitor etc etc 2025-06-23 19:26:44 +00:00
erik
72de9b0f7f fixed server status uptime for coldeve 2025-06-21 21:00:23 +00:00
erik
ca12f4807b added server tracking plus server metrics 2025-06-20 07:17:01 +00:00
erik
80a0a16bab Debug and inventory 2025-06-19 17:46:19 +00:00
erik
57a2384511 added inventory service for armor and jewelry 2025-06-12 23:05:33 +00:00
erik
09a6cd4946 added epic counters 2025-06-11 08:20:57 +00:00
erik
10c51f6825 added inventory, updated DB 2025-06-10 19:21:21 +00:00
erik
f218350959 Major overhaul of db -> hypertable conversion, updated GUI, added inventory 2025-06-08 20:51:06 +00:00
erik
fdf9f04bc6 added grafana and minor fix 2025-06-08 09:05:43 +00:00
erik
81ec59d220 caching queries to live and trails 2025-05-26 21:47:56 +00:00
erik
4de85b8db4 fixed CPU logging from db 2025-05-26 21:35:22 +00:00
erik
09404da121 new comments 2025-05-24 18:33:03 +00:00
erik
b2f649a489 New version with grafana 2025-05-23 08:11:11 +00:00
erik
f86ad9a542 fixed rares event 2025-05-22 16:29:05 +00:00
erik
c418221575 Working version with new streaming and DB 2025-05-22 15:30:45 +00:00
erik
c20d54d037 Refactor to async TimescaleDB backend & add Alembic migrations 2025-05-18 19:07:23 +00:00
erik
337eff56aa added favicon 2025-05-09 23:31:01 +00:00
erik
73ae756e5c ws version with nice DB select 2025-05-09 22:35:41 +00:00
erik
4f9fdb911e Websocket test 2025-05-01 19:26:00 +00:00
Johan Lundberg
431ce1c8d0 add make command make reformat
reformat python files with black
2025-05-01 20:41:53 +02:00