Skip to content

Conversation

giusebar
Copy link
Contributor

@giusebar giusebar commented Aug 27, 2025

Summary 📝

This PR adds some Django settings to handle TLS. The changes include:

  • Dynamic CSRF Trusted Origins:
    Introduced CSRF_TRUSTED_ORIGINS in settings.py using an environment variable. This ensures that Django admin POST requests work correctly over HTTPS.

  • Secure Proxy Header:
    Added SECURE_PROXY_SSL_HEADER = ("HTTP_X_FORWARDED_PROTO", "https") to trust the proxy header for detecting if the original request was made over HTTPS.

  • Foxglove WebSocket Security:
    Configured Foxglove WebSocket to use secure connections if the request is HTTPS.

This PR also adds a test to verify that HTTPS links associated to a device are handled correctly.

Checks

  • Tested Changes

@giusebar giusebar requested a review from artivis August 28, 2025 14:39
@giusebar giusebar changed the title Add setting to defined list of csrf trusted origins Add setting to handle HTTPS requests Aug 28, 2025
@giusebar giusebar changed the title Add setting to handle HTTPS requests Add settings to handle HTTPS requests Aug 28, 2025
@giusebar giusebar merged commit bd6b935 into main Aug 29, 2025
5 checks passed
@giusebar giusebar deleted the fix/set-csrf-trusted-origins branch August 29, 2025 07:50
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.

3 participants