Skip to content

Conversation

@simkim
Copy link
Owner

@simkim simkim commented Dec 10, 2025

Summary

  • Ruby upgrade: Update from Ruby 2.7.2 to 3.3.6 with all dependencies updated
  • Frontend rewrite: Migrate from AngularJS to React 18 (CDN-based, no build step)
  • UI modernization: New design with Inter font, CSS variables, improved QR modal
  • Security hardening: Multiple security improvements (see below)
  • Bug fix: Hide delete button for files uploaded by other users
  • Docker optimization: Add .dockerignore file

Security improvements

  • Security headers (X-Content-Type-Options, X-Frame-Options, X-XSS-Protection, Referrer-Policy)
  • Rate limiting (configurable via DLCENTER_MAX_CONNECTIONS_PER_IP, default 50)
  • HTTPS enforcement (enable via DLCENTER_FORCE_HTTPS env var)
  • CSRF protection on POST endpoints
  • Input validation for all WebSocket messages (name, size, content_type, uuid)
  • Filename sanitization in Content-Disposition headers and zip files
  • Content-type validation
  • UUID format validation
  • Memory limits: 10MB buffer, 2MB max chunk, 100 shares/client
  • Zip path traversal prevention

Test plan

  • Verify app starts with bundle exec rackup
  • Test file sharing between two browsers on same network
  • Test QR code modal display and scanning
  • Test text/link sharing
  • Verify delete button only shows for own files
  • Run bundle exec rspec (24 examples, 0 failures)

🤖 Generated with Claude Code

simkim and others added 7 commits December 10, 2025 16:42
- Upgrade Ruby from 2.7.2 to 3.3.6
- Update Sinatra from 2.1 to 3.2 (kept 3.x for Rack 2.x compatibility with thin/sinatra-websocket)
- Update all gems to latest compatible versions
- Modernize Dockerfile with Ruby 3.3.6-slim and improved layering
- Update docker-compose files to modern compose spec format
- Fix outdated test expectation in registry_spec.rb

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

Co-Authored-By: Claude <noreply@anthropic.com>
Only show the remove icon for shares that exist in the local shares
object, meaning the current client uploaded them.

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

Co-Authored-By: Claude <noreply@anthropic.com>
- Replace AngularJS with React 18 loaded from CDN (no build step)
- Use Babel standalone for JSX transpilation in browser
- Split code into components.js, app.js, and utils.js
- Modernize UI with Inter font and Tailwind-inspired design
- Add CSS variables for consistent theming
- Fix QR code modal with qrcode-generator library from CDN
- Improve QR modal with larger code, close button, and animations
- Fix visited link and button colors
- Remove AngularJS files and old QR code libraries

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

Co-Authored-By: Claude <noreply@anthropic.com>
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Backend (app.rb, client.rb, share.rb, streamer.rb):
- Add security headers (X-Content-Type-Options, X-Frame-Options, etc.)
- Add rate limiting (configurable via DLCENTER_MAX_CONNECTIONS_PER_IP)
- Add HTTPS enforcement (enable via DLCENTER_FORCE_HTTPS)
- Add CSRF protection on POST endpoints
- Sanitize filenames in Content-Disposition headers
- Validate content-type format
- Validate UUID format on all endpoints
- Add input validation for WebSocket messages (name, size, content_type, uuid)
- Add memory limits: 10MB buffer, 2MB max chunk, 100 shares/client
- Sanitize zip filenames to prevent path traversal

Frontend (app.js):
- Use synchronous ref for local shares to fix streaming race condition

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

Co-Authored-By: Claude <noreply@anthropic.com>
- Builds on push to master and tags
- Pushes to GitHub Container Registry (ghcr.io)
- Uses Docker Buildx with layer caching
- Generates semantic version tags from git tags

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

Co-Authored-By: Claude <noreply@anthropic.com>
@simkim simkim self-assigned this Dec 10, 2025
@simkim simkim merged commit 8773ac1 into master Dec 10, 2025
1 check failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants