zmNinja - Run in Browser - Can't Auth - only access via http://serverip:8100 not /domain.com/zm

Discussion topics related to mobile applications and ZoneMinder Event Server (including machine learning)
Post Reply
FreeSoftwareServers
Posts: 21
Joined: Mon Dec 07, 2015 10:37 pm

zmNinja - Run in Browser - Can't Auth - only access via http://serverip:8100 not /domain.com/zm

Post by FreeSoftwareServers »

Ok So I got both the Android and Windows client working and authorized and working great!

I then went to work on running ZMNinja in a browser.

I can get it so that if I access http://[private_ip]:8100 I can see the splash page.

Usually I use http://domain.com/zm, which still works but shows ZM console.

even so, I cant seem to Authenticate via the same information I use to authenticate Android and Windows clients. ( http://domain.com/zm)

Am I missing something, is this not how its meant to work?

I want to access ZoneMinder from remote/unconfigured computer browsers and see ZmNinja in the browser instead of ZoneMinder Console. But I am thinking I got the idea wrong, is that more like you can run the App from the host machine in a browser but not remotely?

Also if it is like I want, how would I create Filters? I don't see that option in ZmNinja.

I know this isn't technically "mobile" aka IOS/Android, but "mobile" should include the browser IMO since it can be accessed from any browser or mobile device.

[update] I have SSL on my domain, but havnt been using it for Auth, I doubt thats the reason, but thought I would mention. I can't get https to authenticate as of yet. but http works fine.
User avatar
asker
Posts: 1553
Joined: Sun Mar 01, 2015 12:12 pm

Re: zmNinja - Run in Browser - Can't Auth - only access via http://serverip:8100 not /domain.com/zm

Post by asker »

Yup, SSL common name is likely the problem

Please take a look at https://github.com/pliablepixels/zmNinja/wiki/FAQ (2nd or 3rd entry)
I no longer work on zmNinja, zmeventnotification, pyzm or mlapi. I may respond on occasion based on my available time/interest.

Please read before posting:
How to set up logging properly
How to troubleshoot and report - ES
How to troubleshoot and report - zmNinja
ES docs
zmNinja docs
User avatar
asker
Posts: 1553
Joined: Sun Mar 01, 2015 12:12 pm

Re: zmNinja - Run in Browser - Can't Auth - only access via http://serverip:8100 not /domain.com/zm

Post by asker »

asker wrote:Yup, SSL common name is likely the problem

Please take a look at https://github.com/pliablepixels/zmNinja/wiki/FAQ (2nd or 3rd entry)
Also if it is like I want, how would I create Filters? I don't see that option in ZmNinja.
Filters as in ZoneMinder filters? Use ZoneMinder web console. zmNinja is not intended to be a console replacement.

I know this isn't technically "mobile" aka IOS/Android, but "mobile" should include the browser IMO since it can be accessed from any browser or mobile device.
If you use the common name as the external DNS name while generating the certs, you can use it anywhere. Alternately, if its possible to generate multiple common names with Apache - that would work too - but I don't know enough of apache/SSL to guide you on this. The bottom line is this:

When you generate SSL certs for ZoneMinder (or use a package that does), the common name used when generating that certificate is what Apache allows as inbound connections. So if you used "192.168.1.10" and tried connecting to it from "myserver.dns.com" it fails.
I no longer work on zmNinja, zmeventnotification, pyzm or mlapi. I may respond on occasion based on my available time/interest.

Please read before posting:
How to set up logging properly
How to troubleshoot and report - ES
How to troubleshoot and report - zmNinja
ES docs
zmNinja docs
FreeSoftwareServers
Posts: 21
Joined: Mon Dec 07, 2015 10:37 pm

Re: zmNinja - Run in Browser - Can't Auth - only access via http://serverip:8100 not /domain.com/zm

Post by FreeSoftwareServers »

But what I don't get is I can authorize via http with both desktop and android application.

I have "real" signed SSL certs for my domain, what I want is to be able to use domain.com/zmninja and view the zmninja console.

I would keep the zoneminder console around then for the tweaking of specific settings/filets but just use zmninja for remote viewing.

Can this be done? Basically I want apache to serve zmninja in the browser from my server.

I can't imagine why I would need SSL.

I noticed when I do Ionic servce -c

It says there are 3 connection options

1) private ip
2) vpn ip
3) loopback

I am not sure which to choose.

Also the guide says to put:

(following this guide for Ubuntu 14.04) - https://github.com/pliablepixels/zmNinj ... rom-Source)

Now edit ionic.project and the in the line that says

"proxyUrl": "http://server.com/zm",

But above proxyUrl is an option called

"path": "/zm"

Which makes me think proxyUrl should be just

http://server.com

--note: I have multiple websites running on my server, currently SSL works great for the 2 enabled sites, but I am not sure if its configured 100% to work for authorizing 3rd party applications. *default-ssl has not been changed*
User avatar
asker
Posts: 1553
Joined: Sun Mar 01, 2015 12:12 pm

Re: zmNinja - Run in Browser - Can't Auth - only access via http://serverip:8100 not /domain.com/zm

Post by asker »

Okay, I'm totally confused.

Why are you using ionic serve and not the desktop package?

Can you explain what you are trying to do, what you are using and what you have downloaded?
I no longer work on zmNinja, zmeventnotification, pyzm or mlapi. I may respond on occasion based on my available time/interest.

Please read before posting:
How to set up logging properly
How to troubleshoot and report - ES
How to troubleshoot and report - zmNinja
ES docs
zmNinja docs
FreeSoftwareServers
Posts: 21
Joined: Mon Dec 07, 2015 10:37 pm

Re: zmNinja - Run in Browser - Can't Auth - only access via http://serverip:8100 not /domain.com/zm

Post by FreeSoftwareServers »

I run a headless server for one, so the desktop package is a no go. I am trying to have apache serve the ZMninja user interface in the browser so I can remote access ZMnina via domain.com/zmninja

I am working on a guide, best for me to link it as I keep updated my changes, but I took a break and am back tackling this issue. The Ionic serve is a bit confusing to me to be honest.

Am I misunderstanding the use of the ZmNinja in a browser? If so, I think my application would make a lot of sense to implement and it couldn't be that hard.

The idea is I have my Android/IOS app for mobile viewing

The desktop app for desktop viewing from my PC

and the last is I can access the ZmNinja via domain.com/zmninja

Note: I have gotten SSL working, tho I still doubt that would matter.
Last edited by FreeSoftwareServers on Tue Dec 22, 2015 12:27 am, edited 1 time in total.
FreeSoftwareServers
Posts: 21
Joined: Mon Dec 07, 2015 10:37 pm

Re: zmNinja - Run in Browser - Can't Auth - only access via http://serverip:8100 not /domain.com/zm

Post by FreeSoftwareServers »

I got it working! Im pretty sure this is not its intended purpose, as it auto-logs in but is accessable from remote domain. But I secured page via htaccess.

All I did was symlink /zmninja/www /var/www/html/zmninja

then secure with htaccess/htpasswd. I will be continuing on my blog above, but for now it works enough that I can let it go :)

I now have desktop/mobile and remote browser zmninja :) via domain.com/zmninja
User avatar
asker
Posts: 1553
Joined: Sun Mar 01, 2015 12:12 pm

Re: zmNinja - Run in Browser - Can't Auth - only access via http://serverip:8100 not /domain.com/zm

Post by asker »

Excellent work!
so anyone can remotely access zmNinja from their browsers?

What happens if different people navigate different views at the same time? Are all the sessions treated separately?
Do you have a writeup on everything you did?
I no longer work on zmNinja, zmeventnotification, pyzm or mlapi. I may respond on occasion based on my available time/interest.

Please read before posting:
How to set up logging properly
How to troubleshoot and report - ES
How to troubleshoot and report - zmNinja
ES docs
zmNinja docs
McFuzz
Posts: 181
Joined: Tue Aug 28, 2012 7:03 am

Re: zmNinja - Run in Browser - Can't Auth - only access via http://serverip:8100 not /domain.com/zm

Post by McFuzz »

Whoops - realized this is the wrong thread for my question!
FreeSoftwareServers
Posts: 21
Joined: Mon Dec 07, 2015 10:37 pm

Re: zmNinja - Run in Browser - Can't Auth - only access via http://serverip:8100 not /domain.com/zm

Post by FreeSoftwareServers »

I posted my write up on my site >> https://www.freesoftwareservers.com/ind ... der-webui/

But in essence I only cloned the GIT didn't install any node/ionic etc etc. I just symlinked the /zmninja/www into /var/www/html/zmninja.

It has had issues remembering Auth. Sometimes it does, its like I have to auth for every browser like its remembering mac addresses almost. and I had to authenticate http and https. but both worked independantly of each other.

Also... I did access it remotly after authorizing and it just logged in :P. Thats no good!, So I used apache config and htpasswd (same as htaccess basically, but inside apache config instead of inside directory) and now apache asks for login credentials then ZmNinja just logs in as per usual like the desktop/mobile application.
FreeSoftwareServers
Posts: 21
Joined: Mon Dec 07, 2015 10:37 pm

Re: zmNinja - Run in Browser - Can't Auth - only access via http://serverip:8100 not /domain.com/zm

Post by FreeSoftwareServers »

Also I am the only Admin, and I'm just working on setting up 2 cameras :P (only been messing with ZoneMinder for about 2 months), so haven't tested with multiple online users simultaneously. I was pretty stoked when I got it working, all that hard work, and I took a step back and just started navigating the zmninja directory from the browser and when i clicked on www it just brought me to ZmNinja and everything worked. So I just figured what the heck, I will symlink that directory.

I then test on a brand new server where I DID NOT use node.js or ionic serve or anything and replicated the success.
Post Reply