zmNinja for desktops

Discussion topics related to mobile applications for ZoneMinder
User avatar
knnniggett
Posts: 1988
Joined: Thu Oct 18, 2007 1:55 pm
Location: Shiloh, IL

Re: zmNinja for desktops

Post by knnniggett » Sat Nov 14, 2015 9:41 pm

@BiloxiGeek You need to turn on DEEP_STORAGE. The only reason the old storage is still supported is to give users of old zoneminders a migration path.
To turn it on when running master, you should run "zmupdate.pl --migrate-events" to convert the existing events. Or just delete your events and start over with a new database (or go into the Config table and turn that bit on if you are comfortable doing that).
Visit my blog for ZoneMinder related projects using the Raspberry Pi, Orange Pi, Odroid, and the ESP8266
All of these can be found at https://zoneminder.blogspot.com/

BiloxiGeek
Posts: 220
Joined: Tue Feb 11, 2014 2:04 pm

Re: zmNinja for desktops

Post by BiloxiGeek » Sat Nov 14, 2015 10:53 pm

While I don't particularly like the deep storage, I can live with it. :)

But something is still borked up with event watching in zmNinja. When I try to view a recorded event via the web interface it works just fine. Using zmNinja I get a bunch of this in the ssl_error.log:

Code: Select all

[Sat Nov 14 16:48:26.951890 2015] [:error] [pid 28669] [client <ipaddr>.1:44198] PHP Fatal error:  Call to undefined function imagescale() in /usr/share/zoneminder/www/views/image.php on line 125
It appears to put one of those errors in the log for each frame of the event.

rockedge
Posts: 580
Joined: Fri Apr 04, 2014 1:46 pm
Location: Connecticut,USA
Contact:

Re: zmNinja for desktops

Post by rockedge » Sat Nov 14, 2015 11:01 pm

[quote="asker"]Rockedge, can you please give this a try for linux? If this works, it was a 32bit problem. I doubt however, it will work with Puppy linux, but please give it a try

Very Cool! I am downloading and will report in a moment.

rockedge
Posts: 580
Joined: Fri Apr 04, 2014 1:46 pm
Location: Connecticut,USA
Contact:

Re: zmNinja for desktops

Post by rockedge » Sat Nov 14, 2015 11:06 pm

[quote="asker"]Rockedge, can you please give this a try for linux? If this works, it was a 32bit problem. I doubt however, it will work with Puppy linux, but please give it a try

Nice! it runs like a champ! I will configure it and test against my 1.28.108 install and report back.

rockedge
Posts: 580
Joined: Fri Apr 04, 2014 1:46 pm
Location: Connecticut,USA
Contact:

Re: zmNinja for desktops

Post by rockedge » Sat Nov 14, 2015 11:24 pm

On Puppy Linux Tahr 6.0.3 and so far everything works except for the functions that are not finished. Going for normal usage tests for the next days.

asker
Posts: 829
Joined: Sun Mar 01, 2015 12:12 pm

Re: zmNinja for desktops

Post by asker » Sat Nov 14, 2015 11:45 pm

rockedge wrote:On Puppy Linux Tahr 6.0.3 and so far everything works except for the functions that are not finished. Going for normal usage tests for the next days.
damn - good to know the puppy likes the ninja. I'll set up the 32 bit download as part of a regular update
--
My collection of ZoneMinder learnings:
https://wiki.zoneminder.com/Various_ZM_thoughts

asker
Posts: 829
Joined: Sun Mar 01, 2015 12:12 pm

Re: zmNinja for desktop

Post by asker » Sun Nov 15, 2015 4:33 am

BiloxiGeek wrote:While I don't particularly like the deep storage, I can live with it. :)

But something is still borked up with event watching in zmNinja. When I try to view a recorded event via the web interface it works just fine. Using zmNinja I get a bunch of this in the ssl_error.log:

Code: Select all

[Sat Nov 14 16:48:26.951890 2015] [:error] [pid 28669] [client <ipaddr>.1:44198] PHP Fatal error:  Call to undefined function imagescale() in /usr/share/zoneminder/www/views/image.php on line 125
It appears to put one of those errors in the log for each frame of the event.

Zoneminder uses ZMS to show images. ZmNinja does not. ZMS sucks in general especially on mobiles. You need to figure out which a library on scilinux to offers image scale
--
My collection of ZoneMinder learnings:
https://wiki.zoneminder.com/Various_ZM_thoughts

abi
Posts: 50
Joined: Fri Oct 23, 2015 11:25 am

Re: zmNinja for desktops

Post by abi » Sun Nov 15, 2015 5:10 pm

1. Is it possible to run zmNinja on CentOS7 ? It has only php54, so no imagescale() function available. https://github.com/pliablepixels/zmNinj ... r-with-API states that 54 should be enough.

2. Are you going to support plain auth on apache side? As zoneminder wiki states, ZM auth is not secure.

asker
Posts: 829
Joined: Sun Mar 01, 2015 12:12 pm

Re: zmNinja for desktops

Post by asker » Sun Nov 15, 2015 5:22 pm

abi, Im pretty sure CentOS has imageScale --> knnnigget maintains the CentOS ports and this particular feature was merged after knnnigget confirmed it works https://github.com/ZoneMinder/ZoneMinder/pull/1001

Can you check with him?

As a sidenote:
It's pretty easy to make zmNinja work without scale support for the desktop version:

a) Go to developer settings -> make event image scale % to 100 and save. This should make "event footage" work not quick scrub
b) To make quick scrub work, needs one to change one line of code which it a little more complicated for the downloaded archives

IF this scaling is a pain in terms of platforms not supporting them, I'll add a flag in the next version to enable/disable it.
--
My collection of ZoneMinder learnings:
https://wiki.zoneminder.com/Various_ZM_thoughts

abi
Posts: 50
Joined: Fri Oct 23, 2015 11:25 am

Re: zmNinja for desktops

Post by abi » Sun Nov 15, 2015 5:39 pm

asker wrote:abi, Im pretty sure CentOS has imageScale --> knnnigget maintains the CentOS ports and this particular feature was merged after knnnigget confirmed it works https://github.com/ZoneMinder/ZoneMinder/pull/1001
It is not. imagescale is from 5.5 http://php.net/manual/en/function.imagescale.php so it's not available on CentOS. Unofficial backport repos are available, but this is path to have issue on CentOS and it will break zmrepo deps as php is available under different name.

I think, the most acceptable solution not to disable feature at all, but add custom inplementation of imagescale in function_exists block. I am almost sure, it's just a helper to more general purpose function gd has for ages. This one http://php.net/manual/en/function.image ... ampled.php should do the job.

asker
Posts: 829
Joined: Sun Mar 01, 2015 12:12 pm

Re: zmNinja for desktops

Post by asker » Sun Nov 15, 2015 7:11 pm

That's interesting. I guess that PR needs to be reworked if that is the case - and should use a compatible API instead.
In the mean time I will add in that toggle in zmNinja so it works even if people don't have the server side fix.
abi wrote: It is not. imagescale is from 5.5 http://php.net/manual/en/function.imagescale.php so it's not available on CentOS. Unofficial backport repos are available, but this is path to have issue on CentOS and it will break zmrepo deps as php is available under different name.

I think, the most acceptable solution not to disable feature at all, but add custom inplementation of imagescale in function_exists block. I am almost sure, it's just a helper to more general purpose function gd has for ages. This one http://php.net/manual/en/function.image ... ampled.php should do the job.
--
My collection of ZoneMinder learnings:
https://wiki.zoneminder.com/Various_ZM_thoughts

abi
Posts: 50
Joined: Fri Oct 23, 2015 11:25 am

Re: zmNinja for desktops

Post by abi » Sun Nov 15, 2015 7:24 pm

asker wrote:That's interesting. I guess that PR needs to be reworked if that is the case - and should use a compatible API instead.
In the mean time I will add in that toggle in zmNinja so it works even if people don't have the server side fix.
Should I open the PR ? I can even write a patch, it looks trivial.

BTW, what about my second question - are you planning to add external (Apache) simple auth ? AFAIK, ZM auth is not very secure thing and I'd avoid to expose it on the Internet.

asker
Posts: 829
Joined: Sun Mar 01, 2015 12:12 pm

Re: zmNinja for desktops

Post by asker » Sun Nov 15, 2015 7:37 pm

Sure, if its not available then this PR will fail. I'm not a core ZM developer, so the call needs to be made by knnnigett/iconnor/fixxermet but given its not supported, I think you should PR anyway.


With respect to Apache auth:
1. I don't plan to add basic auth but wouldn't it just work if you did a user:password@host as part of the base URL setting of zmNinja? What I am not sure of is how Chrome treats it - my app uses a Chrome window and I read somewhere that it drops basic auth in URLs as its not secure (even if its over SSL, being a part of the URL means it can show up in referred by headers and termination logs as well). You can always give it a try

2. Can you point me to the article that says ZM auth is insecure?
abi wrote:
asker wrote:That's interesting. I guess that PR needs to be reworked if that is the case - and should use a compatible API instead.
In the mean time I will add in that toggle in zmNinja so it works even if people don't have the server side fix.
Should I open the PR ? I can even write a patch, it looks trivial.

BTW, what about my second question - are you planning to add external (Apache) simple auth ? AFAIK, ZM auth is not very secure thing and I'd avoid to expose it on the Internet.
--
My collection of ZoneMinder learnings:
https://wiki.zoneminder.com/Various_ZM_thoughts

abi
Posts: 50
Joined: Fri Oct 23, 2015 11:25 am

Re: zmNinja for desktops

Post by abi » Sun Nov 15, 2015 9:21 pm

Here you are. I'm not supplying diff as I doubt devs will use my newbie code :)
https://github.com/ZoneMinder/ZoneMinder/issues/1163

1. Didn't fugure this out. I'll try and report.
2. I read somewhere, maybe in wiki or option description that jpegs can be accessed by direct linking or something like this. Maybe just wrong interpretation, but, anyway, with apache auth I'm reducing attack surface.

Simpler
Posts: 28
Joined: Mon Nov 02, 2015 12:40 am

Re: zmNinja for desktops

Post by Simpler » Mon Nov 16, 2015 12:13 am

I'm trying out zmNinja on Linux Mint 17.2 with ZoneMinder 1.28.107. Most seems to be working well and looks great, but for some reason when I do a "Quick Scrub" or "View Footage" on an event, I only see a generic image of camera with a red question mark.

I can view the events in ZoneMinder, but not in zmNinja.

I turned on the debug switch in zmNinja and the top of the log file has the following:

Code: Select all

version:0.86.1D

Nov 15, 2015 7:09:34 PM INFO Stream authentication construction: 
Nov 15, 2015 7:09:34 PM INFO Data Model: Did not find any  stream mode of auth
Nov 15, 2015 7:09:34 PM INFO DataModel: Did not find a stream auth key, looking for user=
Nov 15, 2015 7:09:33 PM INFO Got API version: 1.28.107
Nov 15, 2015 7:09:33 PM INFO ZM_EVENT_IMAGE_DIGITS is 5
Nov 15, 2015 7:09:33 PM DEBUG DataModel: Getting auth from http://localhost/zm/index.php?view=watch
I'm not sure if that is relevant?

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest