feat: enable SSL on Traccar device port 5055

- nginx stream module now terminates SSL on port 5055
- Backend returns HTTPS URL for device server
- More secure GPS data transmission

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
2026-02-02 23:27:35 +01:00
parent 6a10785ec8
commit 3814d175ff

View File

@@ -343,7 +343,7 @@ export class TraccarClientService implements OnModuleInit {
/** /**
* Get the device port URL for mobile app configuration * Get the device port URL for mobile app configuration
* Returns full HTTP URL - port 5055 uses OsmAnd protocol without SSL * Returns full HTTPS URL - nginx terminates SSL on port 5055
*/ */
getDeviceServerUrl(): string { getDeviceServerUrl(): string {
const port = this.configService.get<string>('TRACCAR_DEVICE_PORT') || '5055'; const port = this.configService.get<string>('TRACCAR_DEVICE_PORT') || '5055';
@@ -352,8 +352,8 @@ export class TraccarClientService implements OnModuleInit {
const traccarUrl = this.getTraccarUrl(); const traccarUrl = this.getTraccarUrl();
try { try {
const url = new URL(traccarUrl); const url = new URL(traccarUrl);
// Return HTTP URL (not HTTPS) - OsmAnd protocol on port 5055 doesn't use SSL // Return HTTPS URL - nginx terminates SSL and proxies to Traccar
return `http://${url.hostname}:${port}`; return `https://${url.hostname}:${port}`;
} catch { } catch {
return `http://localhost:${port}`; return `http://localhost:${port}`;
} }