maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   SailfishOS (https://talk.maemo.org/forumdisplay.php?f=52)
-   -   Prey antitheft for Jolla (https://talk.maemo.org/showthread.php?t=95940)

nieldk 2015-09-09 06:45

Prey antitheft for Jolla
 
Started this new thread, to replace the old one as it is out of date. The information below is in that old thread, but spread around, so here is a recollection to sum up the install procedure for new prey version:

To install recent nodejs build of Prey for SailfishOS:

Add my merproject repository

Code:

$ devel-su
# ssu ar nieldk http://repo.merproject.org/obs/home:/nielnielsen/sailfish_latest_armv7hl/
# pkcon refresh

Install nodejs and sudo

Code:

# pkcon install nodejs
# pkcon install sudo

Alternatively, install the rpm by downloading it from
https://build.merproject.org/package...latest_armv7hl

https://build.merproject.org/package...latest_armv7hl

If you do not want to add my repository.

Then, install prey:
You NEED to do this using devel-su!

Code:

$ devel-su
# npm install -g prey
# prey config hooks post_install
# prey config account setup

now enter your account credentials,
The device is added, and you are ready to track it on panel.preyproject.com
service to start prey on boot is installed and enabled automatically

nieldk 2015-09-09 06:46

Re: Prey antitheft for Jolla
 
So far, this is what is working:

* Get location of device
* Get device hardware information (CPU/memory)
* Get network information (IP, neighbour wlans)
* logged in user (usually nemo or root)

Features missing:
* Screenshot
* Camera
* Sound alerts on device
* Message alerts on device
* Lock device
* Erase device

Allthough the missing features are nice to have (especially the lock device) I believe it is at this point usefull that we can get location reports for a stolen device.

Prey have added the distro 'mer' to the recognized distributions, so, any updates that will be done to enable the missing features should be pushable to them, and as such that will make it much more easy to install, as everything will be part of Prey's 'native' eco system.

A certain well-known developer ;) may look at the Prey sources and hopefully, in a near future we can have a more SailfiishOS-native client, and hopefully Jolla can make this a part of 'standard firmware'.

What needs to be considered, is how to protect de-installation of Prey.
Prefferable Prey as service can be protected from de-installation, and any GUI part that would be de-installed would be for status information only.

hantoo 2015-09-13 17:50

Re: Prey antitheft for Jolla
 
Installed prey this morning, and couldn't get it to locate where my Jolla is. Went to terminal and typed Prey and it came up with this. Is there suppose to be that many errors and critical?
http://i.imgur.com/qLw5zm3.jpg

nieldk 2015-09-13 18:03

Re: Prey antitheft for Jolla
 
no.
Did you fllow instructions?

Not sure if it matters. But do try to install sudo.

coderus 2015-09-13 18:08

Re: Prey antitheft for Jolla
 
only i see dbus-monitor not found error in this image?

hantoo 2015-09-13 18:51

Re: Prey antitheft for Jolla
 
So after installing Sudo everything seems to be working. It still reports errors, some the same and some new. However it seems to be working : 'Prey' after installing sudo,
http://i.imgur.com/0NLjyqZ.jpg
After typing prey it would not let me type any other commands so I had to close the session. When I reconnected and typed prey it was happy :)
http://i.imgur.com/CuaTHYU.jpg

coderus 2015-09-13 19:25

Re: Prey antitheft for Jolla
 
also i decided to try prey myself, but:
Code:

Running "config activate" as prey
Error! Command failed: /bin/sh -c /usr/bin/node /usr/lib/node_modules/prey/node_modules/ocelot/runner.js prey /usr/lib/node_modules/prey/bin/prey config activate
child_process.js:1162
    throw errnoException(err, 'spawn');
          ^
Error: spawn EACCES
    at exports._errnoException (util.js:746:11)
    at ChildProcess.spawn (child_process.js:1162:11)
    at exports.spawn (child_process.js:995:9)
    at run_command (/usr/lib/node_modules/prey/node_modules/ocelot/runner.js:60:15)
    at Object.<anonymous> (/usr/lib/node_modules/prey/node_modules/ocelot/runner.js:95:1)
    at Module._compile (module.js:460:26)
    at Object.Module._extensions..js (module.js:478:10)
    at Module.load (module.js:355:32)
    at Function.Module._load (module.js:310:12)
    at Function.Module.runMain (module.js:501:10)


nieldk 2015-09-13 20:46

Re: Prey antitheft for Jolla
 
Quote:

Originally Posted by coderus (Post 1482407)
also i decided to try prey myself, but:
Code:

Running "config activate" as prey
Error! Command failed: /bin/sh -c /usr/bin/node /usr/lib/node_modules/prey/node_modules/ocelot/runner.js prey /usr/lib/node_modules/prey/bin/prey config activate
child_process.js:1162
    throw errnoException(err, 'spawn');
          ^
Error: spawn EACCES
    at exports._errnoException (util.js:746:11)
    at ChildProcess.spawn (child_process.js:1162:11)
    at exports.spawn (child_process.js:995:9)
    at run_command (/usr/lib/node_modules/prey/node_modules/ocelot/runner.js:60:15)
    at Object.<anonymous> (/usr/lib/node_modules/prey/node_modules/ocelot/runner.js:95:1)
    at Module._compile (module.js:460:26)
    at Object.Module._extensions..js (module.js:478:10)
    at Module.load (module.js:355:32)
    at Function.Module._load (module.js:310:12)
    at Function.Module.runMain (module.js:501:10)


Are you using my build of nodejs ?

nieldk 2015-09-13 21:23

Re: Prey antitheft for Jolla
 
Quote:

Originally Posted by coderus (Post 1482390)
only i see dbus-monitor not found error in this image?

Yeah. Prey needs sudo for some access, and to run scripts as a prey user

coderus 2015-09-13 21:24

Re: Prey antitheft for Jolla
 
works after running with devel-su, not root :)


All times are GMT. The time now is 20:05.

vBulletin® Version 3.8.8