Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Always use base dsm host to format camera live view paths #137

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ruimarinho
Copy link

Hi @mib1185,

This PR introduces a change which should make everyone's life just a little bit easier: when setting up this module, we have to provide a hostname or IP for the Synology DSM connection. However, due to a number of reasons — such as Docker network configuration, multiple NICs being used, reverse proxies and others — the actual camera live view URL will always return the IP or host configuration that Synology believes to be more adequate.

However, think about this: we, as module consumers, configure the hostname or IP based on what we know about our own network setup and routing, to eventually receive back an unexpected — and potentially unreachable — URL of a camera's live view.

In my opinion, we can magically fix this by replacing whatever hostname or IP Synology Surveillance Station returns with the base URL configured in the module. It is guaranteed to succeed since connectivity has been achieved already.

My particular network configuration involves a bit of an elaborate macvlan setup inside Docker on Synology DSM, which makes the originally returned IP become unreachable due to host <> container network limitations in this network topology.

Example:

Before

  • Configure module to connect to nas.mywebsite.me.
  • Connection succeeds, cameras are listed.
  • Obtaining a camera live view URL yields rtsp://syno:[email protected]:554/Sms=1.unicast

After

  • Configure module to connect to nas.mywebsite.me.
  • Connection succeeds, cameras are listed.
  • Obtaining a camera live view URL yields rtsp://syno:[email protected]:554/Sms=1.unicast

@ruimarinho
Copy link
Author

@mib1185 is this something you could consider for the module?

@apires
Copy link

apires commented Jan 19, 2023

+1, even if added as a quirk

@mib1185
Copy link
Owner

mib1185 commented Jan 21, 2023

Hi @ruimarinho

I think this should be optional, but not always.
To do so, the logic about overriding the life view path with the base url should be placed within the get_camera_live_view_path function of SynoSurveillanceStation and toggled by a additional argument like override_lifeview_base_url=False.

@mib1185 mib1185 added the enhancement PR that adds new feature label Jan 29, 2023
Copy link
Owner

@mib1185 mib1185 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement PR that adds new feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants