Commit Graph

22 Commits

Author SHA1 Message Date
Self Hosters
eeba4c116d Add missing database and infrastructure changes from previous session
Changes include:
- GetHostIDForImage method in storage with ORDER BY last_seen DESC
- Agent deployment script improvements
- Build time tracking in agent Dockerfile
- Additional vulnerability scanning infrastructure

These changes were made in previous session but not committed.

🤖 Generated with Claude Code
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-12 07:00:43 -05:00
Self Hosters
2cf3b7c0d6 Fix module path and add build time display to UI
Backend changes:
- Updated go.mod module path from github.com/container-census to
  github.com/selfhosters-cc to match correct GitHub organization
- Updated all import paths across codebase to use new module name
- This fixes ldflags injection of BuildTime during compilation
- BuildTime now correctly shows in /api/health response

Frontend changes:
- Added build time badge next to version in header
- Shows date and time in compact format (e.g., "🔨 12/11/2025 8:06 PM")
- Hover shows full timestamp
- Only displays if build_time is not "unknown"

The build script already sets BuildTime via ldflags, but it was being
ignored because the module path in go.mod didn't match the ldflags path.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-11 20:12:10 -05:00
Self Hosters
8f960fbf68 Fix sidebar navigation and plugin routing issues
- Always show "Manage Plugins" link in sidebar even when all plugins disabled
- Restore NPM plugin static page to avoid bundle.js 404 errors
- Remove npm from dynamic route generateStaticParams (uses static route)
- NPM plugin now properly uses its dedicated React component
- Graph and security plugins continue to use dynamic [pluginId] route

This fixes the issue where disabling all plugins made it impossible to
re-enable them, and resolves bundle.js loading errors for NPM plugin.
2025-12-07 20:22:52 -05:00
Self Hosters
8242ab3767 Added a helper script to test the build process locally 2025-12-06 12:01:37 -05:00
Self Hosters
45036ca19e Convert graph plugin to built-in and fix UI issues
- Convert graph-visualizer from external to built-in plugin
- Add webpack build process for graph plugin frontend
- Fix history modal: reverse timeline sort (newest first)
- Fix history modal: correct lifetime calculation
- Fix container cards: deduplicate port displays
- Update build scripts to compile graph plugin bundle
- Fix plugin bundle URL routing in Next.js

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-05 16:53:13 -05:00
Self Hosters
1971c9674b Added NPM plugin (built-in) 2025-12-03 13:42:29 -05:00
Self Hosters
e7ed72dbb8 Switched to a Next JS interface and simplified the UI 2025-12-02 21:22:02 -05:00
Self Hosters
8dde58ba88 Add trending statistics to telemetry dashboard (hottest, movers, new entries)
- Add /api/stats/hottest endpoint for popular images by containers and adoption
- Add /api/stats/movers endpoint for week-over-week risers and fallers
- Add /api/stats/new-entries endpoint for newly discovered images
- Add image_stats_weekly table with automatic weekly snapshots
- Add Trends tab to vanilla JS dashboard with interactive charts
- Add collector-build.sh and collector-run.sh scripts for local development
- Add Next.js example components (HottestImagesChart, MoversChart, NewEntriesCard)
- Update telemetry-api.ts with new trending API methods and types

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-27 16:17:41 -05:00
Self Hosters
a3c7e6995f Release v1.7.1: Fix image update detection and add agent version display
Fixed:
- Image update detection now uses registry digest (RepoDigests) instead of
  local image ID, eliminating false positive updates for containers already
  running the latest image
- Multi-arch image timestamps now correctly fetched by resolving platform-
  specific manifest (linux/amd64) from manifest lists
- Logout button hidden when authentication is disabled
- JS files served with no-cache headers to ensure updates are seen without
  hard refresh

Added:
- Agent version display on Hosts page with version fetched on each scan
- Onboarding tour now re-shows on major/minor version upgrades to display
  "What's new" information to returning users

Changed:
- Update progress UI shows "Pulling image..." immediately when update starts

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-27 15:11:37 -05:00
Self Hosters
0deb72774f Add authentication migration test suite
Prevent regression of the "authUsername is not defined" error by
adding comprehensive tests and pre-commit hooks.

New test files:
- scripts/test-auth-migration.sh: Full test suite (8 test cases)
  * Checks for obsolete auth variable references
  * Validates session management implementation
  * Verifies vulnerability functions use correct auth
  * Tests logout button and documentation

- scripts/pre-commit-hook.sh: Git pre-commit hook
  * Blocks commits containing authUsername/authPassword
  * Provides helpful error messages
  * Can be installed with symlink

- scripts/TESTING.md: Testing documentation
  * How to run tests
  * How to install pre-commit hook
  * Correct vs incorrect auth patterns
  * Troubleshooting guide

All tests currently passing (8/8). Pre-commit hook validated.

These tests ensure the session-based authentication migration
remains complete and prevent accidental reintroduction of removed
Basic Auth variables.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-23 21:37:20 -05:00
Self Hosters
96b6cc1fb6 Replace HTTP Basic Auth with session-based authentication
This commit replaces the browser's native Basic Auth prompt with a
custom login page to improve user experience and avoid browser
credential caching issues.

Authentication Changes:
- Add gorilla/sessions for cookie-based session management
- Create login page with instructions for finding credentials
- Add logout button (🚪 icon) to navbar
- Root path (/) now redirects to /login.html when unauthenticated
- Maintain backward compatibility with Basic Auth for API clients
- Add SESSION_SECRET environment variable for session encryption

Implementation:
- internal/auth/session.go: Session middleware and management
- internal/api/auth_handlers.go: Login/logout HTTP endpoints
- internal/api/handlers.go: Updated routing with selective auth
- cmd/server/main.go: Session store initialization
- web/login.html: Login page with credential finding instructions
- web/login.js: Login form handling
- web/app.js: 401 redirect handling and logout function
- web/index.html: Logout button in navbar

Documentation:
- README.md: Added SESSION_SECRET to docker-compose example
- README.md: Added "Authentication Issues" troubleshooting section
- scripts/run-local.sh: Added auth prompt with qwerty credentials

Onboarding Tour:
- Restored "Join the Selfhosting Community" telemetry opt-in step
- Added updateTelemetrySettings() method
- Tour now has 5 steps including community contribution option

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-17 10:12:58 -05:00
Self Hosters
55dc366545 Moved all configurations to the database and redid the onborading 2025-11-04 20:41:50 -05:00
Self Hosters
4018b35e35 Completed security tab and enhanced onboarding process 2025-11-04 13:23:29 -05:00
Self Hosters
aab5c3a5cd More progress on security scans 2025-11-02 18:03:51 -05:00
Self Hosters
be8084a691 Almost have the scanning complete. Tour is implemented 2025-11-02 13:47:47 -05:00
Self Hosters
87b3c79094 Mostly working security tab 2025-11-01 20:20:26 -04:00
Self Hosters
eb007cac88 Version 1.4.0 2025-11-01 17:24:40 -04:00
Self Hosters
9e3559897e Version 1.3.0
- Added CPU / Memory tracking
2025-10-30 14:37:01 -04:00
Self Hosters
1c26c73843 Added database view to the telemetry collector 2025-10-27 23:45:55 -04:00
Self Hosters
fa3ce2dd78 Added a graph view of all nodes 2025-10-23 17:52:31 -04:00
Self Hosters
9c1e075ab8 1. Updated the UI to allow all settings / configuration. Config file is only used for storage now, user doesn't have to edit it.
2. Added a visual indicator to the collector to show the user when new reports are arriving
3. Removed the reload config button as it's not needed
2025-10-17 00:29:35 -04:00
Self Hosters
808e49e465 Telemetry introduced 2025-10-10 08:02:48 -04:00