Commit Graph

36 Commits

Author SHA1 Message Date
stellarshenson
d5cfbebed5 fix: URL handling in admin fetch interceptor and nav links
- Handle URL objects (not just strings) in fetch interceptor
- Strip query params before checking isUserCreation endpoint
- Remove duplicate 'hub' prefix from authorize/change-password links
2026-01-06 20:52:12 +01:00
stellarshenson
7ee223b193 fix: Dockerfile to copy from templates_enhanced (was reverted) 2026-01-06 20:46:04 +01:00
stellarshenson
6370255746 fix: handle URL objects in fetch interceptor 2026-01-06 20:39:38 +01:00
stellarshenson
139fe144fa feat: admin user creation with auto-generated credentials modal
- Add after_insert event listener to auto-create NativeAuth UserInfo
- Generate memorable 3-word passwords for admin-created users
- Auto-approve users created by admin (is_authorized=1)
- Add after_delete listener to clean up UserInfo on user deletion
- Add GetUserCredentialsHandler API for credential retrieval
- Add password cache (5min expiry) for secure credential handoff
- Enhanced admin.html with credentials modal (copy/download)
- Add templates_enhanced directory with customized templates
- Add NativeAuth nav items (Change Password, Authorize Users)
- Bump version to 3.5.8 (manual)
2026-01-06 20:20:05 +01:00
stellarshenson
d3fe78bb39 fix: sync NativeAuthenticator on admin panel rename
- SQLAlchemy event listener on orm.User.name intercepts ALL renames
- Removed broken SyncedUserAPIHandler (extra_handlers doesn't override)
- Removed RenameUserHandler (redundant with event listener)
- Added version display in browser console (styled badge)
- Build scripts source project.env for VERSION
2026-01-06 17:27:35 +01:00
stellarshenson
79393273ab fix: sync NativeAuthenticator on admin panel rename
- Add SyncedUserAPIHandler extending UserAPIHandler
- Override /api/users/{username} to intercept rename operations
- Sync UserInfo.username after successful JupyterHub rename
- Fixes broken login after admin panel rename
2026-01-06 16:58:35 +01:00
stellarshenson
e001169663 feat: add user rename API and ENABLE_SIGNUP env variable
- RenameUserHandler: PATCH /hub/api/users/{username}/rename
  preserves NativeAuthenticator authorization on rename
- ENABLE_SIGNUP env var controls self-registration (default: 1)
- Updated README, compose.yml, Dockerfile with new config
2026-01-06 16:43:06 +01:00
stellarshenson
acd62e92bf feat: add CERTIFICATE_DOMAIN_NAME env variable for cert generation
- Add CERTIFICATE_DOMAIN_NAME to compose.yml (defaults to localhost)
- Update 00_generate_ssl_cert.sh to use env variable
- Allows custom domain names for self-signed certificates
2026-01-05 15:09:32 +01:00
stellarshenson
dea9e75fbb chore: cleanup startup scripts and bump version to 3.3.2
Removed obsolete 01_nvidia-smi.sh (GPU detection handled in jupyterhub_config.py).
Renamed 02_ensure_groups.py to 01_ensure_groups.py for sequential ordering.
2025-12-04 19:01:11 +01:00
stellarshenson
12953ee4d6 feat: add optional volume descriptions for UI
Added VOLUME_DESCRIPTIONS config dict allowing optional user-friendly
descriptions for volumes shown in management UI.

Changes:
- Added VOLUME_DESCRIPTIONS dict in jupyterhub_config.py (optional, co-defined
  with DOCKER_SPAWNER_VOLUMES)
- Exposed volume_descriptions via c.JupyterHub.template_vars
- Updated home.html to conditionally display descriptions if defined
- If volume not in VOLUME_DESCRIPTIONS, no description shown (UI remains agnostic)

Configuration example:
VOLUME_DESCRIPTIONS = {
    'home': 'User home directory files, configurations',
    'workspace': 'Project files, notebooks, code',
    'cache': 'Temporary files, pip cache, conda cache'
}

Documentation:
- Updated .claude/CLAUDE.md with Manage Volumes implementation details
- Simplified Restart Server section for consistency
- Added template variables to doc/ui-template-customization.md

UI now shows volume name, Docker volume path, and optional description
(if configured). Fully backward compatible - descriptions are optional.
2025-11-09 22:50:13 +01:00
stellarshenson
d03ad7be22 feat: make volume management UI configuration-agnostic
Updated volume management to dynamically read volume names from
DockerSpawner.volumes configuration instead of hardcoding them:

- Added get_user_volume_suffixes() function to extract volume suffixes from
  config matching jupyterlab-{username}_<suffix> pattern
- Exposed USER_VOLUME_SUFFIXES via c.JupyterHub.template_vars for templates
- Updated home.html to use Jinja2 loop generating checkboxes dynamically
  from user_volume_suffixes variable
- Modified ManageVolumesHandler to validate against configured volumes
  instead of hardcoded {'home', 'workspace', 'cache'}
- Removed volume descriptions (e.g., "Contains: User home directory...") to
  keep UI truly agnostic

Now works correctly if volumes are renamed, added, or removed in configuration
without requiring template or handler changes. Volume names displayed exactly
as defined in config (home, workspace, cache by default).
2025-11-09 22:36:22 +01:00
stellarshenson
0e39fac7ac feat: add admin notification broadcast system for active JupyterLab servers
Implemented comprehensive notification broadcast functionality allowing
administrators to send notifications to all active user JupyterLab servers
simultaneously through a dedicated admin panel.

Core Features:
- Admin-only notification panel accessible at /hub/notifications
- Concurrent delivery to all active servers using asyncio with 5s timeout
- Temporary API token generation (5-minute expiry) for authentication
- Support for 6 notification types: default, info, success, warning, error, in-progress
- 140-character message limit with live character counter
- Auto-close toggle and dismiss button in notifications
- Dynamic endpoint URL construction using spawner.server.base_url
- Comprehensive error handling with user-friendly messages
- One-line logging per server with message preview and outcome

Technical Implementation:
- Created BroadcastNotificationHandler in custom_handlers.py
- Created NotificationsPageHandler for admin UI rendering
- Added notifications.html template with Bootstrap 5 form
- Registered handlers in jupyterhub_config.py extra_handlers
- Sends to /jupyterlab-notifications-extension/ingest endpoint
- Payload includes type, message, autoClose, and actions array
- Navigation link added to home.html for admin access

Integration:
- Requires jupyterlab_notifications_extension installed on JupyterLab servers
- Uses correct payload format (type field, not variant)
- Includes Dismiss action button for manual notification closure

Documentation:
- Updated .claude/CLAUDE.md with complete feature documentation
- Updated README.md Features section with notification broadcast details
- Updated .claude/JOURNAL.md with implementation summary
- Removed obsolete FEATURE_PLAN.md

Version: 3.2.0 (bumped from 3.1.2)
2025-11-09 22:05:06 +01:00
stellarshenson
067b613397 feat: add group-based docker.sock access control for privileged users
Implemented built-in protected group system enabling admins to grant trusted users read-write Docker socket access within their JupyterLab containers. Groups are managed through admin panel and cannot be permanently deleted.
2025-11-05 20:15:30 +01:00
stellarshenson
db483de36d feat: build jupyterhub_config.py into Docker image by default
- Change Docker build context from services/jupyterhub to project root
- Copy config/jupyterhub_config.py into image at /srv/jupyterhub/jupyterhub_config.py
- Users can still override with volume mount if needed
- Update all COPY paths in Dockerfile to reflect new build context
- Enables container to work out-of-the-box without external config file

Benefits:
- Image is self-contained and ready to run without dependencies
- Volume mount remains optional for custom configurations
- Default config includes GPU auto-detection and self-service features
2025-11-04 23:25:17 +01:00
stellarshenson
e985786499 fix: add /srv/jupyterhub to Python path for custom_handlers import
- Add /srv/jupyterhub to sys.path before importing custom_handlers
- Separate shell scripts and Python files in Dockerfile COPY commands
- Resolves ModuleNotFoundError for custom_handlers module
- JupyterHub now starts successfully with custom API handlers
2025-11-04 11:06:25 +01:00
stellarshenson
64e2a9d557 fix: pin JupyterHub base image to version 5.4.2
- Replace 'latest' tag with explicit version 5.4.2
- Resolves hadolint DL3007 warning in CI/CD pipeline
- Ensures reproducible builds and prevents unexpected breaking changes
2025-11-04 10:51:04 +01:00
stellarshenson
d9896a7073 feat: add icons to buttons and auto-refresh on stop, implement GitHub Actions CI/CD
UI Enhancements:
- Add Font Awesome icons to all control buttons (stop, start, restart, manage volumes)
- Auto-refresh page after server stop with smooth UI transitions
- Hide/show appropriate buttons based on server state (Restart vs Manage Volumes)
- Re-inject icons removed by JupyterHub's DOM manipulation

Technical Implementation:
- MutationObserver watches for JupyterHub DOM changes after stop
- Immediate UI state correction before page refresh
- Comprehensive console logging for debugging

CI/CD:
- Add GitHub Actions workflow for Dockerfile validation with hadolint
- Triggers on push to main, version tags, and pull requests
- Uses hadolint to ensure Dockerfile best practices
2025-11-04 10:49:32 +01:00
stellarshenson
c06baa8372 docs: add features section and screenshots to README v3.0.14
Documentation enhancements:
- Add comprehensive Features section highlighting key capabilities
- Document GPU auto-detection, user self-service, isolated environments
- Include production-ready features (Traefik, TLS, Watchtower)
- Add Self-Service Volume Management subsection with visual examples
- Include three screenshots demonstrating UI features:
  - Restart Server button (active state)
  - Manage Volumes button (stopped state)
  - Volume selection modal (checkbox interface)
- Position screenshots prominently after feature list
- Provide one-sentence descriptions for each screenshot

Technical updates:
- Increase Stop Server refresh delay to 3 seconds for stability
- Update version to 3.0.14

Screenshots stored in .resources/ directory for future reference
2025-11-04 10:16:45 +01:00
stellarshenson
cd74fc71db feat: evolve user self-service to multi-volume management v3.0.12
Major enhancements to self-service features:
- Transform single volume reset to multi-volume selection (home/workspace/cache)
- Add Font Awesome icons to buttons (fa-rotate, fa-database)
- Fix Bootstrap 5 modal compatibility (data-bs-*, btn-close)
- Fix template inheritance to properly extend default home.html
- Wrap JavaScript in RequireJS callback for proper module loading
- Implement page refresh after Stop/Manage/Restart actions
- Update API endpoint to /api/users/{username}/manage-volumes
- Backend processes multiple volumes with detailed response
- Add Makefile logs target for container log monitoring

Technical fixes:
- Add default JupyterHub templates to template_paths configuration
- Convert modal triggers from Bootstrap 4 to Bootstrap 5 syntax
- Update JavaScript to use Bootstrap 5 Modal getInstance API
- Add json import to custom_handlers.py for request body parsing

Version: 3.0.12_cuda-12.9.1_jh-5.4.2
2025-11-04 10:07:07 +01:00
stellarshenson
bc16b0ca4b debug: add console logging to custom handlers for troubleshooting
- Add console.log statements to track button clicks and API calls
- Log username, base URL, and button existence on page load
- Log success/error responses from API calls
- Help diagnose why restart server button does nothing
2025-11-03 20:44:18 +01:00
stellarshenson
0468a0da98 fix: properly extend jupyterhub default home template
- Replace custom template with proper extension of default home.html
- Keep all default functionality (Start/Stop, named servers, admin panel)
- Use correct template variables (default_server.active, base_url)
- Add custom buttons alongside existing controls
- Preserve default JavaScript (require home.js)
- Fix 404 errors on spawn and admin panel access
2025-11-03 20:39:29 +01:00
stellarshenson
a18024f1d9 fix: implement manual permission checking in custom handlers
- Remove non-existent @admin_or_self decorator
- Replace with manual permission validation using current_user
- Check authentication and admin/self access explicitly
- Use tornado.web.HTTPError for 403 responses
2025-11-03 20:28:37 +01:00
stellarshenson
3e52a91924 feat: implement reset home volume and restart server features
- Add custom API handlers for volume reset and server restart
- Create custom home.html template with self-service buttons and modals
- Register handlers in jupyterhub_config.py with @admin_or_self permissions
- Update Dockerfile to copy templates and handlers
- Add custom templates path to JupyterHub configuration
- Update .claude/CLAUDE.md with feature documentation
- Reset Home Volume: DELETE /hub/api/users/{username}/reset-home-volume
- Restart Server: POST /hub/api/users/{username}/restart-server
- Both features use Docker API directly via /var/run/docker.sock
2025-11-03 20:24:20 +01:00
stellarshenson
f76ee8711a makde package leaner 2025-08-10 04:42:06 +02:00
stellarshenson
fd991f3d4d updated to have certs still sourced from a volume 2025-08-10 04:39:02 +02:00
stellarshenson
a5ffcdb1f8 updated to have certificates mounted externally 2025-08-10 04:31:59 +02:00
stellarshenson
d034d41dd4 updated permissions 2025-08-08 20:16:08 +02:00
stellarshenson
800c259bee updated with the nvidia autodetection 2025-08-07 20:08:36 +02:00
stellarshenson
cb8e6e106f updated permissions 2025-08-07 17:22:30 +02:00
stellarshenson
8d8d874a1c updated names of the enable variables 2025-07-23 23:56:01 +02:00
stellarshenson
0dfe3bc882 updated 2025-07-18 02:50:24 +02:00
stellarshenson
444bb3fa6c updated permissions 2025-07-18 00:15:55 +00:00
stellarshenson
d85caedf8b updated with passing of the cmd arguments 2025-07-17 18:30:32 +00:00
stellarshenson
338e180d16 updated with config changes to traefik 2025-07-17 18:06:57 +02:00
stellarshenson
591d3a44f7 updated with the changes to certificate handling 2025-07-17 15:52:55 +02:00
stellarshenson
0f7f6fd1a1 moved to conform cloud development structure 2025-07-16 06:58:29 +02:00