ZoneMinder / zmNinja

High performance, cross platform ionic app for Home/Commerical Security Surveillance using ZoneMinder
http://zmninja.zoneminder.com
Other
1.01k stars 270 forks source link

Local and External Server configuration [$5] #133

Closed ttocsr closed 8 years ago

ttocsr commented 8 years ago

It would be ideal (to avoid having multiple servers configured for 1 physical server) to allow the configuration of local network and external network server configuration for a single server instance.

There are a couple reasons this would be helpful. Most consumer NATs don't support hair pinning and most don't support split dns. So it would be ideal to be able to configure the LAN ip address of the server and the WAN ip address of the NAT thats port forwarding to the server.

This should include separate fields for the port configuration due to the fact that most ISPs block port 80 and 443 for consumer internet plans. While most people who install zoneminder have the skill set to change the port configuration from 80 and 443 to something that isn't blocked. It would just be easier to implement this in the app. The following is an example for clarity.

LAN IP/Host: <192.168.1.100> HTTP LAN Port: <80> HTTPS LAN Port:<443>

WAN IP/Host: <74.125.226.87> WAN Port: <8080> HTTPS WAN Port: <8443>

Did you help close this issue? Go claim the $5 bounty on Bountysource.

pliablepixels commented 8 years ago

Thanks for the post - not ignoring it - its a bit complicated to get right (the detection part). I'm on travel till the 17th - once I am back, I'll exchange a few thoughts with you and then start work on it. I agree it's useful.

3esmit commented 8 years ago

You can workaround this by installing DNS server in some machine at your LAN (can be the zm server itself), where you configure a full mirror of a public dns and add a rule matching you DDNS address to answer the LAN IP. Outside LAN this DNS will not be visible, and so the connections would go to normal DDNS. This is a good solution, even if external/internal solution don't works. Maybe Zoneminder could provide a "fake dns'/'auto configure' server to mimic this behavior to make DDNS address point to LAN IP and forward all other DDNS.

3esmit commented 8 years ago

A quick fix would be isolate "server address" from "paths" and allow multiple address to same server. To be faster to implement multiple servers configuration just make server address accept values separated by commas. Example:

Server Address(es): 192.168.1.2,myhouse.ddns.net
Zoneminder path: /zm
Cgi-bin path: /zm/cgi-bin
API path: /zm/api/

Then make app watch for network changes, when it happens app test connection to server list, the first successful response sets the session server IP. Or simply when server looks down retry test connection to servers in list. In a more mature stage, if multiple serves added, then it could control, watch and learn (or user define) WiFi APs that are local and what are external. The DNS suggestion I did in the previous comment is the best option if you have a DNS in your home.

pliablepixels commented 8 years ago

How do you envision it switching between LAN and WAN ?

Here is the approach I am implementing: Instead of allowing just WAN/LAN I am allowing server profiles to be 'linked' as fallbacks. As of today, zmNinja allows you to define multiple server profiles.

Lets say you have profile A, profile B, profile C

In Profile A you say fallback profile is B. And in profile B you say fallback profile is C

Then, when you set "profile A" as default, zmN will try and use the settings of A. if it fails, it will go to B. Similarly, if B fails, it will go to A (and avoid loops too).

So if profile A = LAN and profile B = WAN. We will try LAN first, if it fails, we will try WAN. whichever succeeds becomes the "default profile" for the next time.

Now , beyond LAN/WAN, this allows you to specify as many chained fallbacks as you need (A->B->C->D)

How does this sound?

ttocsr commented 8 years ago

Sounds good.

That's basically how others work. They just call profile A LAN and profile B wan.

I like the idea of more than two options. Some people in business environments might have redundant wans On Mar 16, 2016 5:57 PM, "Pliable Pixels" notifications@github.com wrote:

How do you envision it switching between LAN and WAN ?

Here is the approach I am implementing: Instead of allowing just WAN/LAN I am allowing server profiles to be 'linked' as fallbacks. As of today, zmNinja allows you to define multiple server profiles.

Lets say you have profile A, profile B, profile C

In Profile A you say fallback profile is B. And in profile B you say fallback profile is C

Then, when you set "profile A" as default, zmN will try and use the settings of A. if it fails, it will go to B. Similarly, if B fails, it will go to A (and avoid loops too).

So if profile A = LAN and profile B = WAN. We will try LAN first, if it fails, we will try WAN. whichever succeeds becomes the "default profile" for the next time.

How does this sound?

— You are receiving this because you authored the thread. Reply to this email directly or view it on GitHub https://github.com/pliablepixels/zmNinja/issues/133#issuecomment-197612853

pliablepixels commented 8 years ago

@ttocsr -- can you shoot me an email (pliablepixels @ gmail) with the mobile OS version (Android or iOS and which version) you are on ? I'd like to send you a link to test.

3esmit commented 8 years ago

Works for me, not important but there are visual glitches in splashscreen, don't know if caused by this new feature.

2016-03-17 10:23 GMT-03:00 Pliable Pixels notifications@github.com:

@ttocsr https://github.com/ttocsr -- can you shoot me an email (pliablepixels @ gmail) with the mobile OS version (Android or iOS and which version) you are on ? I'd like to send you a link to test.

— You are receiving this because you commented. Reply to this email directly or view it on GitHub https://github.com/pliablepixels/zmNinja/issues/133#issuecomment-197877672

pliablepixels commented 8 years ago

sounds good. If you mean the logo fading out and a smaller logo fading in - thats not related to this. Thats because I reduced the startup delay to 0 for the splash screen (other folks complained about startup time) and cordova seems to do that with deviceReady - haven't dug into why.

3esmit commented 8 years ago

Me. You can see this info at bountysource. As I am satisfied with the changes I can release it but I don't know how to do it yet. Em 17/03/2016 17:01, "Pliable Pixels" notifications@github.com escreveu:

Out of curiosity, who added a bounty to this feature? The name of the contributor is not shown here

— You are receiving this because you commented. Reply to this email directly or view it on GitHub https://github.com/pliablepixels/zmNinja/issues/133#issuecomment-198058896

pliablepixels commented 8 years ago

cool - yes, I figured out right after I posted that note.