Commit graph

25 commits

Author SHA1 Message Date
Deco Vander
fd3cbe686d Fix persistent locations not showing on homepage
The public /api/locations endpoint was only returning locations within 48 hours,
but it should also include persistent locations regardless of their age.

Updated SQL query to: 'WHERE created_at > ? OR persistent = 1'

This ensures that:
- Regular reports show for 48 hours (as intended)
- Persistent reports show indefinitely (as intended)
- Both types appear on the public map and homepage
2025-07-03 20:56:27 -04:00
Deco Vander
570fd92d00 Add comprehensive session security to admin panel
Security improvements:
- Auto-logout after 30 minutes of inactivity
- Session warning 5 minutes before expiry with option to extend
- Activity-based session extension on user interaction
- Session validation on page load and API calls
- Periodic session validity checks every minute
- Secure cleanup of tokens and timers on logout
- Protection against expired session usage

This prevents unauthorized access if admin leaves session open or if tokens are compromised.
2025-07-03 20:53:44 -04:00
Deco Vander
d9559f71fe Update HTML files to use Bunny.net CDN for static assets
- Updated all static asset URLs to use iceymi.b-cdn.net CDN
- Changed favicon, CSS, and JS file references in index.html, admin.html, and privacy.html
- API calls remain pointed to origin server for dynamic content
- Ready for CDN deployment with proper cache separation
2025-07-03 20:44:16 -04:00
Deco Vander
f73221e5cc Add custom map icons for persistent vs. temporary reports
- Created custom map markers with distinct colors and symbols:
  - 🔒 Green circles with lock icon for persistent reports
  - ⚠️ Red circles with warning icon for temporary reports
- Updated popup text to indicate persistent status
- Applied consistent styling to both MapBox and Nominatim versions
- Enhanced visual distinction between report types on the map
2025-07-03 01:34:39 -04:00
Deco Vander
a8a5523dd4 Show 'Persistent' in table view for persistent reports
- Updated getTimeRemaining() to return 'Persistent' for persistent reports
- Modified getRemainingClass() to handle persistent report styling
- Table view now clearly indicates which reports are persistent vs. expiring
- Maintains color coding for non-persistent reports based on time remaining
2025-07-03 01:32:28 -04:00
Deco Vander
12fd378e8c Fix CSP to allow Leaflet marker icons from unpkg.com
- Updated Content-Security-Policy img-src directive to include unpkg.com
- Resolves CSP violation preventing Leaflet marker icons from loading
- Maintains security while allowing necessary external image resources
2025-07-03 01:24:51 -04:00
Deco Vander
a3b450de1a Add mobile responsiveness and persistent reports feature
- Enhanced mobile responsiveness across entire site and admin panel
  - Optimized layouts, font sizes, and spacing for screens ≤768px and ≤480px
  - Made forms, tables, maps, and buttons touch-friendly
  - Added responsive breakpoints for better mobile experience

- Added persistent reports functionality
  - Added 'persistent' column to database with automatic migration
  - Updated cleanup logic to preserve persistent reports (no auto-expiration)
  - Added admin panel toggle for marking reports as persistent
  - Added persistent report count to admin dashboard stats
  - Visual indicators with lock/unlock icons for persistent status

- Improved admin panel UI
  - Standardized header button styling and sizing
  - Added 'Return to Homepage' button for better navigation
  - Enhanced mobile responsiveness for admin interface
  - Fixed table layouts and button arrangements for mobile devices

- Backend API enhancements
  - New PATCH endpoint for toggling persistent status
  - Updated admin routes to include persistent field
  - Backwards compatible database migration
2025-07-03 01:17:41 -04:00
Deco Vander
5e56d59bbd Add map/table toggle view for current reports
 New Features:
- Toggle between map and table view for current reports
- Table view shows location, details, reported time, and time remaining
- Color-coded time remaining: urgent (red), warning (orange), normal (green)
- Responsive design with mobile-optimized table layout
- Real-time updates work in both map and table views
- Sorted by most recent reports first

🎨 UI Improvements:
- Professional toggle buttons with active state
- Clean table design with hover effects
- Accessibility-friendly with proper titles and tooltips
- Mobile-responsive layout adjustments

🚀 Better UX:
- Easy switching between visual map and detailed table
- Time remaining countdown helps prioritize urgent reports
- Searchable and scannable table format for quick review
- Maintains all existing functionality while adding new view
2025-07-03 01:07:17 -04:00
Deco Vander
3581ea219d Fix rate limiting block syntax for caddy-ratelimit plugin
- Use proper rate_limit block syntax with key, rate, and window
- Rate 30 requests per minute for general API
- Rate 5 requests per minute for location submissions
- Should resolve 'wrong argument count' error
2025-07-03 01:00:07 -04:00
Deco Vander
118261a0bd Fix duplicate @submit matcher in Caddyfile
- Combined @submit matcher conditions into single block
- Fixed 'matcher is defined more than once' error
- Proper Caddyfile syntax for combining path and method matchers
2025-07-03 00:58:30 -04:00
Deco Vander
18fb9e5a73 Fix rate limiting syntax in Caddyfile
- Simplified rate limiting syntax to use 30r/m and 5r/m format
- Fixed matcher syntax for submission rate limiting
- Should resolve 'wrong argument count' error in Caddy
- Compatible with caddy-ratelimit plugin syntax
2025-07-03 00:56:26 -04:00
Deco Vander
c95d159a95 Install Caddy with rate limiting plugin for ARM64 deployment
- Install Go 1.21.5 for ARM64 architecture
- Use xcaddy to build Caddy with caddy-ratelimit plugin
- Create custom systemd service for plugin-enabled Caddy
- Restore rate limiting configuration in Caddyfile
- Production-ready setup with proper security and rate limiting
- Automatic SSL with enhanced protection against API abuse
2025-07-03 00:44:29 -04:00
Deco Vander
3d3eb2fd3b Enhance Caddyfile with explicit HTTPS and security features
- Added explicit HTTP to HTTPS redirects for clarity
- Improved security headers including CSP for MapBox/OSM
- Added health checks for reverse proxy
- Implemented rate limiting for API protection
- Added structured logging for security monitoring
- Enhanced compression with gzip and zstd
- Comprehensive www/non-www redirect handling
- Production-ready configuration for ICE Watch
2025-07-03 00:31:41 -04:00
Deco Vander
c203cdcbeb Update clone URLs to use SSH and correct repository name
- Changed all git clone URLs to use SSH (git@github.com:)
- Fixed repository name to derekslenk/ice (correct repo name)
- Updated both deployment script and README
- Provides better security for server deployments
2025-07-03 00:24:01 -04:00
Deco Vander
0af3b7eeea Update service user and group for icewatch service 2025-07-03 00:19:40 -04:00
Deco Vander
e35eb6c788 Update deployment instructions and service user/group 2025-07-03 00:14:42 -04:00
Deco Vander
2cda43edc9 Fix S3 upload: remove ACL parameters for bucket without ACL support
- Removed --acl public-read parameters from GitHub Action
- S3 bucket policy handles public access instead of ACLs
- Should resolve AccessControlListNotSupported error
2025-07-03 00:11:08 -04:00
Deco Vander
5b9c9f7396 Fix S3 bucket name and create deployment bucket
- Created S3 bucket: ice-puremichigan-lol
- Updated all references to use correct bucket name
- Applied public access policy for scripts/* path
- Ready for automated deployment via GitHub Actions
2025-07-03 00:02:52 -04:00
Deco Vander
e58e89ac72 Update S3 paths to use scripts folder with proper permissions
- Changed deployment URLs from /icewatch to /scripts
- Added cache control headers for better performance
- Updated bucket policy for scripts/* public access
- All deployment files now use consistent scripts/ path
2025-07-03 00:00:02 -04:00
Deco Vander
38ccd6d533 Update deployment URLs to use ice.puremichigan.lol S3 bucket
- Updated deployment script S3 URLs
- Updated README with correct bucket name
- Ready for automated S3 deployment via GitHub Actions
2025-07-02 23:57:27 -04:00
Deco Vander
08a8ded5f9 Add GitHub Actions workflow for S3 deployment
- Automated deployment script upload to public S3 bucket
- Uses GitHub OIDC for secure AWS authentication
- Updates README with current S3 URLs automatically
- Enables deployment from private repository
- Uploads systemd service and Caddyfile configurations
2025-07-02 23:56:18 -04:00
Deco Vander
5af83966d6 Fix deployment script URL in README 2025-07-02 23:51:30 -04:00
Deco Vander
e1b5f4caea Update README with correct repository URLs 2025-07-02 23:50:35 -04:00
Deco Vander
dd85ea6ee0 Update README with correct repository URLs 2025-07-02 23:48:58 -04:00
Deco Vander
edfdeb5117 Initial commit: ICE Watch Michigan community safety tool
- Node.js/Express backend with SQLite database
- Interactive map with real-time location tracking
- MapBox API integration for fast geocoding
- Admin panel for content moderation
- 24-hour auto-expiring reports
- Deployment scripts for Debian 12 ARM64
- Caddy reverse proxy with automatic HTTPS
2025-07-02 23:27:22 -04:00