PDA

View Full Version : Prey antitheft for Jolla


nieldk
2015-09-09, 06:45
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

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

Install nodejs and sudo

# pkcon install nodejs
# pkcon install sudo

Alternatively, install the rpm by downloading it from
https://build.merproject.org/package/binaries/home:nielnielsen/nodejs?repository=sailfish_latest_armv7hl

https://build.merproject.org/package/binaries/home:nielnielsen/sudo?repository=sailfish_latest_armv7hl

If you do not want to add my repository.

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

$ 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
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
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
no.
Did you fllow instructions?

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

coderus
2015-09-13, 18:08
only i see dbus-monitor not found error in this image?

hantoo
2015-09-13, 18:51
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
also i decided to try prey myself, but: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
also i decided to try prey myself, but: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
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
works after running with devel-su, not root :)

rob_kouw
2015-09-14, 15:10
Yes, it works again! :)

At the end of the installation I got a message that I should fire up a GUI. I lost the exact message, but nothing was fired up when I ran the command. So I got it working with:
prey config settings update api_key aa9999999999
prey config account setup
The API-key is found on the Settings page (https://panel.preyproject.com/settings) on the Prey website, left bottom corner.

In the meantime I tried the PreyGUI from Warehouse, but that did not do the trick. So I uninstalled it again.

rob_kouw
2015-09-14, 15:28
Not everything is configurated now, it seems. Looking up the location from the Prey website provides the following log:
notice Mon, 14 Sep 2015 15:22:36 GMT [control-panel] Got valid push request!
warn Mon, 14 Sep 2015 15:22:38 GMT [control-panel] Got 1 commands.
info Mon, 14 Sep 2015 15:22:45 GMT [reports] Gathering status report.
error Mon, 14 Sep 2015 15:22:45 GMT [reports] Unable to get battery_status: Unable to read battery info.
error Mon, 14 Sep 2015 15:22:45 GMT [reports] Unable to get logged_user: No logged user detected.
info Mon, 14 Sep 2015 15:22:52 GMT [reports] Report gathered: status
info Mon, 14 Sep 2015 15:22:52 GMT [control-panel] Posting data
info Mon, 14 Sep 2015 15:22:53 GMT [control-panel] Got 200 response: OK
So the user is not detected or registered? I'm also puzzled by the following:
[root@Jolla nemo]# prey config check
Checking installation.
Installation seems to be clean as a bean. Good job!
Voila! All good.
[root@Jolla nemo]# prey config activate
Error! This command should be run as the prey user.

coderus
2015-09-14, 18:04
install sudo ;)

rob_kouw
2015-09-14, 19:44
install sudo ;)

I did. Followed the instructions by nieldk.

nieldk
2015-09-14, 20:24
I did. Followed the instructions by nieldk.

Well, not completely folloew instructions ;)

I suggest you follow them.

Better to start with removing prey, removing any registered device in control panel (prey site)

Then, start from beginning on 1st post

Btw. No. There is no GUI, yet. Except prey website.

Eminem
2015-10-24, 22:58
Got this when trying to install Prey on Sailfish OS 2.0.0.10. :(


[root@Jolla Downloads]# devel-su Password:
[root@Jolla Downloads]# npm install -g prey
npm ERR! git clone --template=/root/.npm/_git-remotes/_templates --mirror git://github.com/tomas/node-campfire.git /root/.npm/_git-remotes/git-github-com-tomas-node-campfire-git-82e0df35: undefined
npm ERR! git clone --template=/root/.npm/_git-remotes/_templates --mirror git://github.com/tomas/node-campfire.git /root/.npm/_git-remotes/git-github-com-tomas-node-campfire-git-82e0df35: undefined
npm ERR! Linux 3.4.108.20150901.1
npm ERR! argv "/usr/bin/node" "/usr/bin/npm" "install" "-g" "prey"
npm ERR! node v0.12.7
npm ERR! npm v2.11.3
npm ERR! code ENOGIT

npm ERR! not found: git
npm ERR!
npm ERR! Failed using git.
npm ERR! This is most likely not a problem with npm itself.
npm ERR! Please check if you have git installed and in your PATH.

> prey@1.3.9 preuninstall /usr/lib/node_modules/prey
> ./bin/prey config hooks pre_uninstall

module.js:338
throw err;
^
Error: Cannot find module 'commander'
at Function.Module._resolveFilename (module.js:336:15)
at Function.Module._load (module.js:278:25)
at Module.require (module.js:365:17)
at require (module.js:384:17)
at Object.<anonymous> (/usr/lib/node_modules/prey/lib/common.js:12:27)
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 Module.require (module.js:365:17)
npm WARN continuing anyway prey@1.3.9 preuninstall: `./bin/prey config hooks pre_uninstall`
npm WARN continuing anyway Exit status 1

npm ERR! Please include the following file with any support request:
npm ERR! /home/nemo/Downloads/npm-debug.log
[root@Jolla Downloads]# [root@Jolla Downloads]# devel-su Password:
bash: [root@Jolla: command not found
[root@Jolla Downloads]# [root@Jolla Downloads]# npm install -g prey
bash: [root@Jolla: command not found
[root@Jolla Downloads]# npm ERR! git clone --template=/root/.npm/_git-remotes/_templates --mirror git://github.com/tomas/node-campfire.git /root/.npm/_git-remotes/git-github-com-tomas-node-campfire-git-82e0df35: undefined
at Module.load (module.js:355:32)
at Function.Module._load (module.js:310:12)
at Module.require (module.js:365:17)
npm WARN continuing anyway prey@1.3.9 preuninstall: `./bin/prey config hooks pre_uninstall`
npm WARN continuing anyway Exit status 1

npm ERR! Please include the following file with any support request:
npm ERR! /home/nemo/Downloads/npm-debug.log
[root@Jolla Downloads]#

nieldk
2015-10-25, 05:30
Got this when trying to install Prey on Sailfish OS 2.0.0.10. :(

npm ERR! Please check if you have git installed and in your PATH.


Solution in your terminal session ;)

coderus
2015-10-25, 09:03
Solution in your terminal session ;)

OMG! If you think i need to read all these output AND understand it - you REALLY wrong here!! You need to make it work for everybody and without any problems! And i do not need to understand how it works, i just need to click INSTALL button and everything should be done automatically! You should fix it ASAP!

nieldk
2015-10-25, 10:02
OMG! If you think i need to read all these output AND understand it - you REALLY wrong here!! You need to make it work for everybody and without any problems! And i do not need to understand how it works, i just need to click INSTALL button and everything should be done automatically! You should fix it ASAP!

I will add a preinstall script that will prevent installation if you don't entré the correct last 4 ciphers of pi.

pichlo
2015-10-25, 10:16
I will add a preinstall script that will prevent installation if you don't entré the correct last 4 ciphers of pi.

THAT has made me ROTFLMAO. Thanks for giving my day a good start! :D:D:D

Eminem
2015-10-25, 13:54
Solution in your terminal session ;)

Found the solution and solved it. Prey is up and running/flying. :) Thanks for the hint and your pi script. ;)

nieldk
2015-10-25, 18:09
Found the solution and solved it. Prey is up and running/flying. :) Thanks for the hint and your pi script. ;)

Happy for you, and good you are now "protected"

objectifnul
2015-12-03, 12:51
Any change in Saimaa 2.0.0.10 with GPS/Location data retrieval?
Since I upgraded, Prey seems to be unable to locate my device.

nieldk
2015-12-03, 18:01
Any change in Saimaa 2.0.0.10 with GPS/Location data retrieval?
Since I upgraded, Prey seems to be unable to locate my device.

No. It still works.
But, perhaps the upgrade process removed some of what prey needs.
I cant really tell. I installed 2.0.0.10 from clean phone.

objectifnul
2015-12-03, 18:11
I also installed 2.0.0.10 after factory reset. Then installed Prey according to your instructions. Investigating.

Anyway «prey -r "get location"» returns a correct answer (locally). But panel.preyproject.com couldn't display it. Maybe an issue on server side (device only briefly seen by Prey service when Prey app is started, then shown as unreachable).

In prey.conf, 'auto_connect' is set to 'false' (which is surprisingly the default setting). Forcing it to 'true' doesn't fix the issue.

In prey-agent.service, 'TimeoutStopSec' is set to '20'. Should I increase it?

Eminem
2016-04-12, 06:23
Anyone tried it for the tablet and if so did it work?

Eminem
2016-05-06, 21:23
Get this at the end of installation.

Credentials verified.
Linking device...
Error! Invalid os: does not exist.
[root@Jolla Downloads]#

Fixable or?

rolfok
2016-05-26, 08:17
@nieldk What language was the old version of prey (not based on nodejs) written in and can I have a look at the source?
I'm primarily interested in python code to get gps location.

nieldk
2016-05-26, 09:22
Get this at the end of installation.

Credentials verified.
Linking device...
Error! Invalid os: does not exist.
[root@Jolla Downloads]#

Fixable or?

With help from Prey, yes.
They need info to add OS - sailfish - to the known platform types

Believe it shows in /etc/mer-release what they need (not sure if mer-release is correct for tablet)

nieldk
2016-05-26, 09:23
@nieldk What language was the old version of prey (not based on nodejs) written in and can I have a look at the source?
I'm primarily interested in python code to get gps location.

Have a look here
https://github.com/prey/prey-bash-client?files=1

rolfok
2016-05-26, 10:48
That seems to have no GPS functions, but thanks anyway.

nieldk
2016-05-26, 12:45
That seems to have no GPS functions, but thanks anyway.

The various modules (GPS and others) are in seperate github.

https://github.com/prey/prey-bash-client-modules?files=1

rolfok
2016-05-26, 13:04
If I understand that correctly, they do just get approximate position from wifi AP using googleapis - no GPS coordinates from a built in gps receiver.

nieldk
2016-05-26, 14:00
If I understand that correctly, they do just get approximate position from wifi AP using googleapis - no GPS coordinates from a built in gps receiver.

Yep.
Defined here
https://github.com/prey/prey-bash-client-modules/blob/master/geo/core/functions

Eminem
2016-05-28, 10:09
With help from Prey, yes.
They need info to add OS - sailfish - to the known platform types

Believe it shows in /etc/mer-release what they need (not sure if mer-release is correct for tablet)

This info?

Mer release 0.2011 (Mer)
BUILD: Jolla-2.0.0.10-tbj-i486

or this?

[nemo@Jolla ~]$ lsb_release -a
LSB Version: :core-3.1-ia32:core-3.1-noarch:core-3.2-ia32:core-3.2-noarch:core-4.0-ia32:core-4.0-noarch:desktop-3.1-ia32:desktop-3.1-noarch:desktop-3.2-ia32:desktop-3.2-noarch:desktop-4.0-ia32:desktop-4.0-noarch
Distributor ID: #Thisfileiscopiedashw-release(analogoustoos-release)
Description: # This file is copied as hw-release (analogous to os-release)
Release: n/a
Codename: analogoustoos-release

or maybe this?

[nemo@Jolla ~]$ lsb_release -ri
Distributor ID: #Thisfileiscopiedashw-release(analogoustoos-release)
Release: n/a

pasko
2016-06-01, 09:05
Hi.

I have a conflict with the packages:

When I run prey -r "get location" I get a message saying that iwlist command is not found.
When I try to install "wireless-tools" the answer is that "iw" is installed already
And if I try to uninstall "iw" then "crda" is about to be uninstalled as well.

Any clues?

Regards.

explit
2016-07-05, 21:22
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







With help from Prey, yes.
They need info to add OS - sailfish - to the known platform types

Believe it shows in /etc/mer-release what they need (not sure if mer-release is correct for tablet)


Hello Niel.
I have the same prob. on Jolla tablet. Any chance, that i can fix it by myself?
THX

explit
2016-07-06, 07:37
Get this at the end of installation.

Credentials verified.
Linking device...
Error! Invalid os: does not exist.
[root@Jolla Downloads]#

Fixable or?

Hi Eminem. I have the same problem on my Jolla Tablet
Have you found some fix?

THX

step5
2016-07-07, 13:52
Hi.

I have a conflict with the packages:

When I run prey -r "get location" I get a message saying that iwlist command is not found.
When I try to install "wireless-tools" the answer is that "iw" is installed already
And if I try to uninstall "iw" then "crda" is about to be uninstalled as well.

Any clues?

Regards.

Same here

have a look @
https://together.jolla.com/question/126893/changelog-201taalojarvi/

iw
[packaging] Obsoletes deprecated wireless-tools. Fixes MER#1300

iwlist/wireless-tools seems to have become obsolete and replaced by iw


maybe checkout https://www.npmjs.com/package/wit
nodejs wrapper for iw command

Eminem
2016-07-07, 14:34
Hi Eminem. I have the same problem on my Jolla Tablet
Have you found some fix?

THX

Nope, gonna ask them to add the Tablet. :)

explit
2016-07-07, 16:26
Nope, gonna ask them to add the Tablet. :)

I asked them alredy, and this is the answer:

Hi, Pawel.

Unfortunately, Prey is not compatible with mobile OS other than Android and iOS, and to be honest we don't think we will have any time soon, NOT because we don't want to or hate other OS or for actual technical reasons, but we are a very small team at the moment (not more than 15 people) and we are unable to develop a new version for a different operative system than the ones we already have. I hope you understand, we would be honored if you thought we were a big company. I am sorry for having to give you this answer!

You may be able to install Prey on some versions that support Android apks, but Prey will still not work.

Cheers,

--
Beatriz H.
Customer Happiness Agent
support@preyproject.com

This was a guy from support, i thing we need ask somebody more technical at prey....

My Jolla Phone JP-1301 with Sailfish 2.0.2.45 runs well with Prey, but the same OS Version on the Tablet don't.....
It must be something very small to change....

nieldk
2016-07-07, 17:39
I asked them alredy, and this is the answer:



This was a guy from support, i thing we need ask somebody more technical at prey....

My Jolla Phone JP-1301 with Sailfish 2.0.2.45 runs well with Prey, but the same OS Version on the Tablet don't.....
It must be something very small to change....

They only need info from, I believe, the file mer-release
I had them add this for Jolla 1, by submitting on their github pages.

explit
2016-07-07, 18:59
They only need info from, I believe, the file mer-release
I had them add this for Jolla 1, by submitting on their github pages.

I submitted them all the info (including mer-release) but i think, to the wrong guy.

Maybe you can be our hero again, Niel?

Thank you!

nieldk
2016-07-07, 20:57
I submitted them all the info (including mer-release) but i think, to the wrong guy.

Maybe you can be our hero again, Niel?

Thank you!

A workaround is to temporarly change /etc/mer-release to something they recognize.
After registration, restore to original.

explit
2016-07-07, 22:08
A workaround is to temporarly change /etc/mer-release to something they recognize.
After registration, restore to original.

Seems, they check not only /etc/mer-release
I replaced /etc/mer-release on My Tablet with /etc/mer-release from my Jolla Phone (where the installation run fine) - but get the same error:
Invalid os.... does not exist.....

explit
2016-07-09, 18:55
The girl from the prey customer support answered, that she would forward my request to the development team. I don't know if the help us and how long it would take, but its at least better as nothing....

explit
2016-08-07, 23:35
Some news here? Somebody activated prey on Jolla C / Tablet / FP2 or other devices ?


I can confirm:
Installation not working on:
Jolla Tablet / SF 2.0.2.48 i486
Fairphone 2 / SF 2.0.2.48 armv7hl

So the problem is NOT the i486 Architecture, its a mer or Sailfish Version, which is not supported....

Error! Invalid os: does not exist.

explit
2016-08-08, 00:09
Found on a prey forum, that the command lsb_release can have something to do with our problem. I made an request on github, no idea, if it is the right place, and if some prey developer will see it there....

nieldk
2016-08-08, 06:09
Found on a prey forum, that the command lsb_release can have something to do with our problem. I made an request on github, no idea, if it is the right place, and if some prey developer will see it there....

That's the right place. This is how I got it working on our J1. Then, they saw and fixed.

explit
2016-08-10, 16:45
https://github.com/prey/prey-node-client/issues/224

I made a new issue on prey github here.

Feel free to edit or change it, if this is needed.
Lets hope, they will react...

rob_kouw
2016-08-14, 15:29
I installed prey last week on a Jolla phone, recently cleared and reinstalled. The installation of Prey worked like a charm.

But today it appeared Prey did not see my Jolla for 4 days. I opened the terminal, and entered "prey". Unknown command. So I did the installation process again (and it worked like a charm again). But strange it is...

explit
2016-08-14, 23:36
I installed prey last week on a Jolla phone, recently cleared and reinstalled. The installation of Prey worked like a charm.

But today it appeared Prey did not see my Jolla for 4 days. I opened the terminal, and entered "prey". Unknown command. So I did the installation process again (and it worked like a charm again). But strange it is...

What SailfishOS Version you are on?
2.0.1.11 worked for me
2.0.2.4x and 2.0.3.1x - not working

nieldk
2016-08-15, 05:22
On 2.0.3.14 here it's working

explit
2016-08-16, 00:11
On 2.0.3.14 here it's working

yes, if it was activated before update on 2.0.2.xx or 2.03.xx
On my Jolla 1 it also working on 2.0.3.14

but if you try to install it on fresh device with 2.0.2 or 2.0.3 it will fail.

rob_kouw
2016-08-17, 21:29
Well, I'm still on Taalojarvi 2.01.11. It is working now.

nieldk
2016-09-29, 07:22
I figured a workaround out. The issue is really not with Prey, but with Jolla lsb_release files are not correct

specifically, we need to change the file

/etc/hw-release

by adding this line to the top of the file

Mer release 02011 Jolla

This will allow to setup the account and activate it on Prey servers

coderus
2016-09-29, 08:38
btw, what the status of missing features? i am interested in implementing em.

nieldk
2016-09-29, 08:44
btw, what the status of missing features? i am interested in implementing em.

Same :/ basically we can get location of device, other than that, we get info on the hardware and so (not so usefull)
Should also return oinfo on connected networks (wlan).

explit
2016-09-29, 09:04
I figured a workaround out. The issue is really not with Prey, but with Jolla lsb_release files are not correct

specifically, we need to change the file

/etc/hw-release

by adding this line to the top of the file

Mer release 02011 Jolla

This will allow to setup the account and activate it on Prey servers



Thank you very much, Niel!
The solution was only one line away....

nieldk
2016-09-29, 09:06
Thank you very much, Niel!
The solution was only one line away....

Yep, but this is something that I need to report to Jolla as a bug I believe ;)

Added a screenshot of a report that is send when device is set as missing

nieldk
2016-12-15, 10:32
I have updated nodejs.
And, Prey have updated their nodejs version.

There are some small things to be aware of, when trying to update Prey to the latest version thru npm with the new version.
Primarily, they now are using Sqlite for some things.

So, in order to get new version of Prey installed, here is a smmall how-to:

First, uninstall prey.

sudo npm remove prey -g --unsafe-perm

Next, install new nodejs from http://repo.merproject.org/obs//home:/nielnielsen/sailfish_latest_armv7hl/armv7hl/nodejs-6.9.2-10.2.1.jolla.armv7hl.rpm
Either download, and use rpm, pkcon install-local or, add my repository.

Update npm to latest version:

sudo npm install npm@latest -g

nan, and node-gyp (needed to compile sqlite) seems to be missing, and not installed by prey, so do that

sudo npm install nan -g --unsafe-perm
sudo npm install node-pre-gyp -g --unsafe-perm

Now, install prey

sudo npm install prey -g --unsafe-perm


Add systemd services, if you want to enable it by default

sudo nano /etc/systemd/system/prey-agent.service

[Unit]
Description=The Prey daemon.
After=network.target

[Service]
ExecStart=/usr/lib/node_modules/prey/bin/prey
WorkingDirectory=/usr/lib/node_modules/prey
Restart=always
RestartSec=15
User=prey
Environment="TERM=dumb" "USER=prey"
KillMode=process
TimeoutStopSec=20
KillSignal=QUIT

[Install]
WantedBy=multi-user.target

Ensure, that prey have permissions to use sudo, when needed (to access sqlite db, iwlist, and su

sudo nano /etc/sudoers.d/50_prey_switcher

prey ALL = NOPASSWD: /bin/su [A-z]*, !/bin/su root*, !/bin/su -*, /usr/sbin/iwlist

start prey (first reload systemd daemons)

sudo systemctl daemon-reload
sudo systemctl start prey-agent


Now, it should be working, and if you want to enable auto on reboot:

sudo systemctl enable prey-agent

rob_kouw
2016-12-15, 14:56
Hi Neil,

I've got so much trust in the stuff you make for us, I'm happy to install things unsafe. :)

Things worked well up to the point of installing prey itself:

[root@Sailfish nemo]# sudo npm install prey -g --unsafe-perm
/usr/bin/prey -> /usr/lib/node_modules/prey/bin/prey

> sqlite3@3.1.8 install /usr/lib/node_modules/prey/node_modules/sqlite3
> node-pre-gyp install --fallback-to-build

node-pre-gyp ERR! Tried to download(403): https://mapbox-node-binary.s3.amazonaws.com/sqlite3/v3.1.8/node-v46-linux-arm.tar.gz
node-pre-gyp ERR! Pre-built binaries not found for sqlite3@3.1.8 and node@4.4.0 (node-v46 ABI) (falling back to source compile with node-gyp)
gyp ERR! build error
gyp ERR! stack Error: not found: make
gyp ERR! stack at getNotFoundError (/usr/lib/node_modules/npm/node_modules/which/which.js:13:12)
gyp ERR! stack at F (/usr/lib/node_modules/npm/node_modules/which/which.js:68:19)
gyp ERR! stack at E (/usr/lib/node_modules/npm/node_modules/which/which.js:80:29)
gyp ERR! stack at /usr/lib/node_modules/npm/node_modules/which/which.js:89:16
gyp ERR! stack at /usr/lib/node_modules/npm/node_modules/which/node_modules/isexe/index.js:44:5
gyp ERR! stack at /usr/lib/node_modules/npm/node_modules/which/node_modules/isexe/access.js:8:5
gyp ERR! stack at FSReqWrap.oncomplete (fs.js:82:15)
gyp ERR! System Linux 3.4.108.20161101.1
gyp ERR! command "/usr/bin/node" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "build" "--fallback-to-build" "--module=/usr/lib/node_modules/prey/node_modules/sqlite3/lib/binding/node-v46-linux-arm/node_sqlite3.node" "--module_name=node_sqlite3" "--module_path=/usr/lib/node_modules/prey/node_modules/sqlite3/lib/binding/node-v46-linux-arm"
gyp ERR! cwd /usr/lib/node_modules/prey/node_modules/sqlite3
gyp ERR! node -v v4.4.0
gyp ERR! node-gyp -v v3.4.0
gyp ERR! not ok
node-pre-gyp ERR! build error
node-pre-gyp ERR! stack Error: Failed to execute '/usr/bin/node /usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js build --fallback-to-build --module=/usr/lib/node_modules/prey/node_modules/sqlite3/lib/binding/node-v46-linux-arm/node_sqlite3.node --module_name=node_sqlite3 --module_path=/usr/lib/node_modules/prey/node_modules/sqlite3/lib/binding/node-v46-linux-arm' (1)
node-pre-gyp ERR! stack at ChildProcess.<anonymous> (/usr/lib/node_modules/node-pre-gyp/lib/util/compile.js:83:29)
node-pre-gyp ERR! stack at emitTwo (events.js:87:13)
node-pre-gyp ERR! stack at ChildProcess.emit (events.js:172:7)
node-pre-gyp ERR! stack at maybeClose (internal/child_process.js:827:16)
node-pre-gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:211:5)
node-pre-gyp ERR! System Linux 3.4.108.20161101.1
node-pre-gyp ERR! command "/usr/bin/node" "/usr/bin/node-pre-gyp" "install" "--fallback-to-build"
node-pre-gyp ERR! cwd /usr/lib/node_modules/prey/node_modules/sqlite3
node-pre-gyp ERR! node -v v4.4.0
node-pre-gyp ERR! node-pre-gyp -v v0.6.32
node-pre-gyp ERR! not ok
Failed to execute '/usr/bin/node /usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js build --fallback-to-build --module=/usr/lib/node_modules/prey/node_modules/sqlite3/lib/binding/node-v46-linux-arm/node_sqlite3.node --module_name=node_sqlite3 --module_path=/usr/lib/node_modules/prey/node_modules/sqlite3/lib/binding/node-v46-linux-arm' (1)
/usr/lib
`-- (empty)

npm ERR! Linux 3.4.108.20161101.1
npm ERR! argv "/usr/bin/node" "/usr/bin/npm" "install" "prey" "-g" "--unsafe-perm"
npm ERR! node v4.4.0
npm ERR! npm v4.0.3
npm ERR! code ELIFECYCLE

npm ERR! sqlite3@3.1.8 install: `node-pre-gyp install --fallback-to-build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the sqlite3@3.1.8 install script 'node-pre-gyp install --fallback-to-build'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the sqlite3 package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node-pre-gyp install --fallback-to-build
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs sqlite3
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls sqlite3
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR! /home/nemo/npm-debug.log

nieldk
2016-12-15, 17:03
Rob: its trying to build the binaries.
you need to install
make, gcc and g++

Eminem
2016-12-18, 17:08
So pkcon install make, pkcon install gcc, pkcon install g++?

nieldk
2016-12-18, 18:43
So pkcon install make, pkcon install gcc, pkcon install g++?

pkcon install


make
gcc
gcc-c++

objectifnul
2016-12-23, 09:52
Perhaps time has come to gather all updated instructions for installation in one, clear and accurate document.

Eminem
2016-12-24, 11:11
Or a installation file that does/have everything in it/gets it and installs it. :)

explit
2016-12-25, 21:20
I'm asking, how to do this on Jolla Tablet...

The new Nodejs Version is only armv7hl

nieldk
2016-12-26, 08:15
I'm asking, how to do this on Jolla Tablet...

The new Nodejs Version is only armv7hl

yes, there is an older version on my merproject, but that is too old i believe.
After holidays i will try to get this to build on i486.
Posibly i will make an rpm package of prey.

rob_kouw
2016-12-27, 16:52
pkcon install


make
gcc
gcc-c++

Took me a while to try again. pkcon install make worked. This is my result for gcc:

[root@Sailfish nemo]# pkcon install gcc
Installing
Waiting in queue
Starting
Refreshing software list
Querying
Resolving dependencies
Fatal error: gcc-4.8.3-1.2.4.armv7hl requires glibc-devel, but this requirement cannot be provided
[root@Sailfish nemo]# pkcon install glibc-devel
Installing
Waiting in queue
Starting
Refreshing software list
Querying
Resolving dependencies
Fatal error: glibc-devel-2.19+6.7-1.8.1.armv7hl requires glibc = 2.19+6.7-1.8.1, but this requirement cannot be provided
[root@Sailfish nemo]#

What to do now?
Thanks, Rob

explit
2016-12-28, 15:45
pkcon install make gcc gcc-c++

min0me
2017-03-19, 11:32
Hi,

I have installed Prey, it shows up in my account correctly.
Afterwards in the control panel it tells me i am unable to reach the device.

Looking at the log

PREY 1.6.6 spreads its wings!
Current time: Sat Mar 18 2017 20:10:08 GMT+0800 (PHT)
Running with PID 3676 as prey over Node.js v4.2.2 on a arm linux system (undefined)

info Sat, 18 Mar 2017 12:10:08 GMT [actions] Starting action: geofencing
info Sat, 18 Mar 2017 12:10:09 GMT [actions] Running: geofencing
info Sat, 18 Mar 2017 12:10:09 GMT Plugin loaded: control-panel
info Sat, 18 Mar 2017 12:10:09 GMT 1 plugins loaded with 0 errors.
info Sat, 18 Mar 2017 12:10:09 GMT Initialized.
info Sat, 18 Mar 2017 12:10:09 GMT [triggers] Watching: connection, network, power
info Sat, 18 Mar 2017 12:10:09 GMT [actions] Starting trigger: connection
info Sat, 18 Mar 2017 12:10:09 GMT [actions] Running: connection
info Sat, 18 Mar 2017 12:10:09 GMT [actions] Starting trigger: network
info Sat, 18 Mar 2017 12:10:09 GMT [actions] Starting trigger: power
error Sat, 18 Mar 2017 12:10:09 GMT Error: Network seems to be down. Check your connection and try again.
info Sat, 18 Mar 2017 12:10:09 GMT [actions] Stopped: geofencing
warn Sat, 18 Mar 2017 12:10:09 GMT [control-panel] Unable to sync settings.
error Sat, 18 Mar 2017 12:10:09 GMT [network] Connection error: Error: getaddrinfo ENOTFOUND solid.preyproject.com solid.preyproject.com:443
info Sat, 18 Mar 2017 12:10:09 GMT [actions] Failed: network -> ENOENT - Command not found: /usr/bin/dbus-monitor
error Sat, 18 Mar 2017 12:10:09 GMT Error: ENOENT - Command not found: /usr/bin/dbus-monitor
info Sat, 18 Mar 2017 12:10:09 GMT [control-panel] Posting response
info Sat, 18 Mar 2017 12:10:09 GMT [actions] Failed: power -> ENOENT - Command not found: /usr/bin/dbus-monitor
error Sat, 18 Mar 2017 12:10:09 GMT Error: ENOENT - Command not found: /usr/bin/dbus-monitor
info Sat, 18 Mar 2017 12:10:09 GMT [control-panel] Posting response
info Sat, 18 Mar 2017 12:10:09 GMT [control-panel] Got error: Network seems to be down. Check your connection and try again.
info Sat, 18 Mar 2017 12:10:09 GMT [control-panel] Got error: Network seems to be down. Check your connection and try again.
error Sat, 18 Mar 2017 12:10:24 GMT [network] Connection error: Error: getaddrinfo ENOTFOUND solid.preyproject.com solid.preyproject.com:443
error Sat, 18 Mar 2017 12:10:40 GMT [network] Connection error: Error: getaddrinfo ENOTFOUND solid.preyproject.com solid.preyproject.com:443
error Sat, 18 Mar 2017 12:10:55 GMT [network] Connection error: Error: getaddrinfo ENOTFOUND solid.preyproject.com solid.preyproject.com:443
error Sat, 18 Mar 2017 12:11:10 GMT [network] Connection error: Error: getaddrinfo ENOTFOUND solid.preyproject.com solid.preyproject.com:443
error Sat, 18 Mar 2017 12:11:25 GMT [network] Connection error: Error: getaddrinfo ENOTFOUND solid.preyproject.com solid.preyproject.com:443
error Sat, 18 Mar 2017 12:11:40 GMT [network] Connection error: Error: getaddrinfo ENOTFOUND solid.preyproject.com solid.preyproject.com:443
error Sat, 18 Mar 2017 12:11:55 GMT [network] Connection error: Error: getaddrinfo ENOTFOUND solid.preyproject.com solid.preyproject.com:443
error Sat, 18 Mar 2017 12:12:10 GMT [network] Connection error: Error: getaddrinfo ENOTFOUND solid.preyproject.com solid.preyproject.com:443
error Sat, 18 Mar 2017 12:12:25 GMT [network] Connection error: Error: getaddrinfo ENOTFOUND solid.preyproject.com solid.preyproject.com:443
error Sat, 18 Mar 2017 12:12:40 GMT [network] Connection error: Error: getaddrinfo ENOTFOUND solid.preyproject.com solid.preyproject.com:443
error Sat, 18 Mar 2017 12:12:55 GMT [network] Connection error: Error: getaddrinfo ENOTFOUND solid.preyproject.com solid.preyproject.com:443
error Sat, 18 Mar 2017 12:13:10 GMT [network] Connection error: Error: getaddrinfo ENOTFOUND solid.preyproject.com solid.preyproject.com:443


this is regardless if i use wlan or wan, If i visit solid.preyproject.com/test everything comes back green

Any thoughts would be appreciated.

nieldk
2017-03-19, 12:47
Did you follow steps from here ?
http://talk.maemo.org/showpost.php?p=1520594&postcount=61

objectifnul
2017-03-20, 07:53
Next, install new nodejs from http://repo.merproject.org/obs//home:/nielnielsen/sailfish_latest_armv7hl/armv7hl/nodejs-6.9.2-10.2.1.jolla.armv7hl.rpm
Either download, and use rpm, pkcon install-local or, add my repository.


Not Found:

The requested URL /obs/home:/nielnielsen/sailfish_latest_armv7hl/armv7hl/nodejs-6.9.2-10.2.1.jolla.armv7hl.rpm was not found on this server.

nieldk
2017-03-20, 11:40
Not Found:

The requested URL /obs/home:/nielnielsen/sailfish_latest_armv7hl/armv7hl/nodejs-6.9.2-10.2.1.jolla.armv7hl.rpm was not found on this server.

The current link is: http://repo.merproject.org/obs//home:/nielnielsen/sailfish_latest_armv7hl/armv7hl/nodejs-6.9.2-10.3.1.jolla.armv7hl.rpm

objectifnul
2018-01-02, 18:14
Not Found

The requested URL /obs/home:/nielnielsen/sailfish_latest_armv7hl/armv7hl/nodejs-6.9.2-10.3.1.jolla.armv7hl.rpm was not found on this server.

=> http://repo.merproject.org/obs//home:/nielnielsen/sailfish_latest_armv7hl/armv7hl/nodejs-6.11.2-10.2.2.jolla.armv7hl.rpm

(not working, by the way: npm command is missing)

jayki
2018-02-13, 14:13
Hi :)
On Sailfish X i get
info Tue, 13 Feb 2018 14:09:27 GMT [reports] Report gathered: specs
error Tue, 13 Feb 2018 14:09:28 GMT [control-panel] Unable to register device: Invalid os: does not exist.
error Tue, 13 Feb 2018 14:09:28 GMT Error: Invalid os: does not exist.
info Tue, 13 Feb 2018 14:09:28 GMT 1 plugins loaded with 1 errors.
critical Tue, 13 Feb 2018 14:09:28 GMT UNCAUGHT EXCEPTION: Invalid os: does not exist.
Gracefully shutting down. Will self-destruct in 5 secs.

I hope someone has a solution. Prey won't work with this an shuts down..

nieldk
2018-02-13, 15:42
Hi :)
On Sailfish X i get
info Tue, 13 Feb 2018 14:09:27 GMT [reports] Report gathered: specs
error Tue, 13 Feb 2018 14:09:28 GMT [control-panel] Unable to register device: Invalid os: does not exist.
error Tue, 13 Feb 2018 14:09:28 GMT Error: Invalid os: does not exist.
info Tue, 13 Feb 2018 14:09:28 GMT 1 plugins loaded with 1 errors.
critical Tue, 13 Feb 2018 14:09:28 GMT UNCAUGHT EXCEPTION: Invalid os: does not exist.
Gracefully shutting down. Will self-destruct in 5 secs.

I hope someone has a solution. Prey won't work with this an shuts down..

See: http://talk.maemo.org/showpost.php?p=1515799&postcount=56

nieldk
2018-02-13, 15:44
Not Found

The requested URL /obs/home:/nielnielsen/sailfish_latest_armv7hl/armv7hl/nodejs-6.9.2-10.3.1.jolla.armv7hl.rpm was not found on this server.

=> http://repo.merproject.org/obs//home:/nielnielsen/sailfish_latest_armv7hl/armv7hl/nodejs-6.11.2-10.2.2.jolla.armv7hl.rpm

(not working, by the way: npm command is missing)

Link is fine, for npm you need to install that ;)
http://talk.maemo.org/showpost.php?p=1520594&postcount=61

jayki
2018-02-13, 16:55
Hi,

I have installed Prey, it shows up in my account correctly.
Afterwards in the control panel it tells me i am unable to reach the device.

error Sat, 18 Mar 2017 12:13:10 GMT [network] Connection error: Error: getaddrinfo ENOTFOUND solid.preyproject.com solid.preyproject.com:443


this is regardless if i use wlan or wan, If i visit solid.preyproject.com/test everything comes back green

Any thoughts would be appreciated.

So after installing prey i come to the same problem.
Running it as root user works, but is not what is intended.
Running as prey user via systemd or manuall will result in no network.
The user prey doesn't have network access as testet with ping as user prey:
bash-4.4$ ping 8.8.8.8
socket: Permission denied
Any idea how to give this user network access?


EDIT:
added user prey to group inet via:
gpasswd -a prey inet
and now user prey has network connection.. Testing again ;)
Edit:
Tested: devie is now conneted in Webinterface.. seems to work..
But location is just plain wrong. I have GPS activated an poormaps open which has right Location, but Prey always thinks im in Kassel, germany..
Adding user prey to group gps didn't fixed this.. sad :(
Prey console with : get location doesn't output anything.. so it can't set the location.. ..

BTW: tested sudo with user prey and it still requests me to type a password for iwlist, but i created the file under sudoers.d as you said. :(