Commit graph

19 commits

Author SHA1 Message Date
Tim Zöller
4fe283f246 Account >D
eletion
2026-01-04 08:18:21 +01:00
Tim Zöller
9f13e89632 Fix Weather API access 2026-01-04 07:37:42 +01:00
Tim Zöller
a19d4870f7 Batch Import 2026-01-03 08:56:57 +01:00
Tim Zöller
7ecb5456cc Fix integration test: Add sourceFileFormat to test activity builder
ActivityControllerIntegrationTest was failing because the helper method
createTestActivity() didn't set the source_file_format field, which
became required after migration V15.

Added sourceFileFormat("FIT") to the Activity builder in the test helper.

Test Results:
-  128 tests passing
-  0 failures
-  0 errors
- 4 tests skipped (expected)

All integration tests now pass with Docker/Testcontainers.

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

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-01-02 18:03:23 +01:00
Tim Zöller
f4be439002 Add GPX file support for activity imports
This commit adds comprehensive GPX file support alongside existing FIT file support, enabling users to import activities from Strava, Komoot, and other GPS apps.

## Key Features

### Core Components
- **GpxParser**: Full GPX 1.1 parsing with Garmin TrackPointExtension support
- **GpxFileValidator**: Validation for GPX file format and structure
- **ActivityFileService**: Unified service with automatic format detection (FIT/GPX)
- **ParsedActivityData**: Common data structure for both FIT and GPX files

### GPX Parsing Capabilities
- GPS track point extraction (latitude, longitude, elevation, timestamp)
- Garmin extension data (heart rate, cadence, temperature)
- Activity type detection from GPX metadata
- Distance calculation using Haversine formula
- Elevation gain/loss calculation
- Speed calculation from consecutive GPS points
- Speed smoothing to remove GPS artifacts
- Timezone detection from GPS coordinates
- Moving time vs. stopped time analysis

### Database Changes
- Migration V15: Renamed raw_fit_file → raw_activity_file
- Added source_file_format column (FIT/GPX) with constraint
- Index on source_file_format for performance
- Updated Activity entity with new fields

### Controller & UI Updates
- ActivityController: Now handles both FIT and GPX uploads
- Upload form: Updated to accept .fit and .gpx files
- Help text: Clarified both formats are supported

### Testing
- GpxParserIntegrationTest: 9 comprehensive tests with real GPX file
- Tests cover: parsing, validation, heart rate extraction, distance calculation,
  elevation metrics, speed calculation, chronological ordering, smoothing
- Fixed TrainingLoadServiceTest date issue (testDate outside 30-day window)
- All 97 unit tests passing (integration tests require Docker)

### Technical Details
- Supports GPX 1.0 and 1.1 specifications
- Handles multiple track segments
- Processes Garmin TrackPointExtension v1 and v2
- Same track simplification as FIT (Douglas-Peucker algorithm)
- Consistent JSONB storage format for track points
- Compatible with existing analytics, heatmaps, and image generation

## Testing Summary
-  9/9 GpxParserIntegrationTest tests passing
-  4/4 FitParserIntegrationTest tests passing
-  14/14 FitFileServiceTest tests passing
-  97/97 total unit tests passing

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

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-01-02 13:31:05 +01:00
Tim Zöller
f391028061 Added Heatmaps 2026-01-01 23:48:05 +01:00
Tim Zöller
0e092e670b Smoothen Speed 2025-12-16 15:01:20 +01:00
Tim Zöller
5b687883b0 Better Federation Support 2025-12-15 21:55:17 +01:00
Tim Zöller
6158707daa Fixes 2025-12-14 17:29:33 +01:00
Tim Zöller
ecb9e1f540 Don't duplicated updates activities 2025-12-14 16:12:20 +01:00
Tim Zöller
d3dbf8e80a Tests 2025-12-05 20:38:53 +01:00
Tim Zöller
0e81a65d62 Good stuff 2025-12-05 10:21:45 +01:00
Tim Zöller
9e428a0499 Nicer sharepics 2025-12-04 22:39:15 +01:00
Tim Zöller
a32b9e99e0 Nicer sharepics 2025-12-04 22:08:56 +01:00
Tim Zöller
7d07653d2a Stuff 2025-12-04 18:39:01 +01:00
Tim Zöller
9c745cf07d Fix RFC 1123 date format - use zero-padded day
The issue was that Java's DateTimeFormatter.RFC_1123_DATE_TIME produces
dates like 'Tue, 2 Dec 2025' (without zero-padded day) but Mastodon
requires strict RFC 1123 format with zero-padded day: 'Tue, 02 Dec 2025'.

This was causing HTTP Signature validation failures (401 Unauthorized)
because the Date header in the signed string didn't match the actual header.

Changes:
- Fixed date format in HttpSignatureValidator to use custom pattern
- Pattern: 'EEE, dd MMM yyyy HH:mm:ss GMT' with Locale.US
- Added date format test to verify correct output
- Added debug endpoint for key validation
- Explicitly set Host header in FederationService

This should fix the 401 errors when federating with Mastodon.
2025-12-02 21:51:52 +01:00
Tim Zöller
cc8e309821 Fix HTTP Signature by explicitly setting Host header
- Added key pair validation debug endpoint
- Verified that public/private key pairs match correctly
- Fixed HTTP Signature issue by explicitly setting Host header
- Previously relied on RestTemplate to auto-set Host, which could differ from signed value
- Now explicitly set Host header to match the value used in signature calculation

This should fix the 401 Unauthorized errors when sending activities to Mastodon
2025-12-02 21:46:08 +01:00
Tim Zöller
1901daf5ce More ActivityPub 2025-11-28 09:00:07 +01:00
Tim Zöller
0bc4fb3118 Fit File Processing and Persistence 2025-11-27 22:59:45 +01:00