maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   SailfishOS (https://talk.maemo.org/forumdisplay.php?f=52)
-   -   [WIP] Prey - antitheft system (https://talk.maemo.org/showthread.php?t=92829)

iltsu 2014-06-04 15:21

Re: [WIP] Prey - antitheft system
 
Prey runs perfectly, but can't install fcron.

Warehouse and pkcon install / install-local gives error Installation aborted by user, even I didn't abort it manually. Any suggestions?

nieldk 2014-06-04 15:35

Re: [WIP] Prey - antitheft system
 
Quote:

Originally Posted by iltsu (Post 1428200)
Prey runs perfectly, but can't install fcron.

Warehouse and pkcon install / install-local gives error Installation aborted by user, even I didn't abort it manually. Any suggestions?

$ wget https://openrepos.net/sites/default/...-3.armv7hl.rpm -no-check-certificate
$ devel-su
# zypper in fcron-3.0.6-3.armv7hl.rpm

juiceme 2014-06-04 21:18

Re: [WIP] Prey - antitheft system
 
Quote:

Originally Posted by nieldk (Post 1428202)
$ wget https://openrepos.net/sites/default/...-3.armv7hl.rpm -no-check-certificate
$ devel-su
# zypper in fcron-3.0.6-3.armv7hl.rpm

OK, now this is a bit offtopic since it concerns not prey but fcron.
I am going to ask anyway since it is important in an indirect way though... :D

So, how can I make cron (fcron in this case) keep real time on Jolla?
I have installed fcron-3.0.6-3 but I noted that it behaves in not so nice way; if my Jolla is sleeping (like, display off) and a crontab event should trigger it just doesn't wake up. The event is missed completely, not even deferred to when the device wakes up I believe.

nieldk 2014-06-05 05:50

Re: [WIP] Prey - antitheft system
 
@juice Yes, that observation is true. fcron is an attempt to see if it would work better than systemd timers (which also have this issue).
Also, (f)cron would enable prey to change the run schedule.
But.... the device (OS) seems to not adhere to running tasks needs.
Even WLAN seems to still suffer from this sleep issue.
Sadly, I have still to figure out how to fix this.

juiceme 2014-06-05 06:59

Re: [WIP] Prey - antitheft system
 
Quote:

Originally Posted by nieldk (Post 1428293)
@juice Yes, that observation is true. fcron is an attempt to see if it would work better than systemd timers (which also have this issue).
Also, (f)cron would enable prey to change the run schedule.
But.... the device (OS) seems to not adhere to running tasks needs.
Even WLAN seems to still suffer from this sleep issue.
Sadly, I have still to figure out how to fix this.

There has to be a neat way to do this, or else the alarm clock would not work either.

I remember there was some talk of this before, was it so that there are some special libs you need to link your code against to make it not to go to sleep when the device goes to low power mode?

rainisto 2014-06-05 07:08

Re: [WIP] Prey - antitheft system
 
Quote:

Originally Posted by juiceme (Post 1428300)
There has to be a neat way to do this, or else the alarm clock would not work either.

I remember there was some talk of this before, was it so that there are some special libs you need to link your code against to make it not to go to sleep when the device goes to low power mode?

https://github.com/nemomobile/libiphb allows you periodically wake up from suspended state.
Unfortunately its not that well documented, so you need to look into tests dir and read the sources. And its written in C.

Easier C++ API has luckily been introduced that also allows periodic waking from suspend, so you can for example wake up every 15 or 30 mins:

https://github.com/nemomobile/nemo-k...y_periodic.cpp

ade 2014-06-05 08:17

Re: [WIP] Prey - antitheft system
 
Quote:

Originally Posted by nieldk (Post 1428293)
@juice Yes, that observation is true. fcron is an attempt to see if it would work better than systemd timers (which also have this issue).
Also, (f)cron would enable prey to change the run schedule.
But.... the device (OS) seems to not adhere to running tasks needs.
Even WLAN seems to still suffer from this sleep issue.
Sadly, I have still to figure out how to fix this.

There already is a modified meego cron for sailfish which has libiphb included: https://gitorious.org/cron-for-harma...on-3.0pl1.orig

Which makes me wonder why people put packages in repos that are not tested/working as expected in the first place.

nieldk 2014-06-05 12:37

Re: [WIP] Prey - antitheft system
 
Quote:

Originally Posted by ade (Post 1428316)
There already is a modified meego cron for sailfish which has libiphb included: https://gitorious.org/cron-for-harma...on-3.0pl1.orig

Which makes me wonder why people put packages in repos that are not tested/working as expected in the first place.

that one has apparently issues aswell.

As for "not test/working as expected"
Well, disable my repo, and do your sh.. yourself.

ade 2014-06-05 13:23

Re: [WIP] Prey - antitheft system
 
Quote:

Originally Posted by nieldk (Post 1428346)
that one has apparently issues aswell.

Than you might have compiled the wrong code, as it works fine for me.
Quote:


Well, disable my repo, and do your sh.. yourself.
Well, I do compile a lot myself. I even upload to repos. And it is great that persons like you upload packages so people don't have to compile themselves. But I do run stuff myself for a while to see if it works as expected before uploading.

I would not have mind to look into the issue for you, but given your agressive attitude, I think it is better not to. Nevertheless I hope you can fix the issue for people that did install your fcron.

nieldk 2014-06-05 14:26

Re: [WIP] Prey - antitheft system
 
I know you contribute a great deal, as for my attitude, Apology - but I am a bit tired of certain (not you) ppl and their attitudes also.
As for testing. I do test, and when I feel it could have a certain amount of interrest, I publish, here, or in openrepos.
fcron is an example, it works, but have problems with device goong to sleep.
As so do most of apps and services already present in a released device OS!
Therefore my opinion is, that this issue could be considered minor, considering the benefits of prey and enabling a usefull feature to track a stolen device, or ?

iltsu 2014-06-06 18:25

Re: [WIP] Prey - antitheft system
 
[root@Jolla nemo]# crontab -l
21:25:12 listing root's fcrontab
# m h dom mon dow command
*/10 * * * * /usr/share/prey/prey.sh > /var/log/prey.log 2>&1

any ideas why a heck that doesn't run prey automatically?

juiceme 2014-06-06 19:46

Re: [WIP] Prey - antitheft system
 
Quote:

Originally Posted by iltsu (Post 1428543)
[root@Jolla nemo]# crontab -l
21:25:12 listing root's fcrontab
# m h dom mon dow command
*/10 * * * * /usr/share/prey/prey.sh > /var/log/prey.log 2>&1

any ideas why a heck that doesn't run prey automatically?

Read back the previous page :D

az2111 2014-06-10 16:24

Re: [WIP] Prey - antitheft system
 
Hey, i got a screenshot from jolla to prey but it is black. Is it black because screen was black when it was taken?

Thanks in advance.
Best regards az2111

pizzulicchio 2014-07-17 21:36

Re: [WIP] Prey - antitheft system
 
i have just reinstalled Prey after a full reset of my jolla phone.
Now i'm on 1.0.8.19

I have started the script for the first time but this is the unhappy output:
[root@Jolla ~]# /usr/share/prey/prey.sh

## PREY 0.6.3 spreads its wings!
## Linux Jolla 3.4.91.20140612.1 #1 SMP PREEMPT Mon Jun 16 17:24:16 UTC 2014 armv7l armv7l armv7l GNU/Linux
## Thu Jul 17 23:33:47 CEST 2014

-- Looking for connection...
-- Got network connection!
-- Checking URL...

== Verifying status...

No such schema 'org.gnome.system.proxy.http'

!! Got invalid response! This probably means there is a connection issue.
-- Please check your firewall settings, allowing Curl to connect to https://31668.control.preyproject.co...ces/0uj51r.xml through port 80.
-- If you use a proxy server please check the try_proxy setting in the config file.
-- The response we got was:


curl: (51) SSL: no alternative certificate subject name matches target host name '31668.control.preyproject.com'


!! Got invalid response! This probably means there is a connection issue.
-- Please check your firewall settings, allowing Curl to connect to https://control.preyproject.com through port 80.
-- If you use a proxy server please check the try_proxy setting in the config file.
-- The response we got was:


curl: (51) SSL: no alternative certificate subject name matches target host name '31668.control.preyproject.com'

-- Cleaning up!


No status update from Prey website....
is it a temporary problem?

have tested with my home wifi connection and mobile operator too.... same result...

pizzulicchio 2014-07-21 10:05

Re: [WIP] Prey - antitheft system
 
no ideas ?

nieldk 2014-07-21 16:18

Re: [WIP] Prey - antitheft system
 
Quote:

Originally Posted by pizzulicchio (Post 1433494)
no ideas ?

could you please try to uninstall v6.3, and then install and set up v6.2.
Then, if that works, install v6.3

pizzulicchio 2014-07-22 14:37

Re: [WIP] Prey - antitheft system
 
Wow! it works.
Installed 6.2, done the first registration, updated to 6.3 and now it's all fully working.

Thank you

rob_kouw 2014-08-10 08:38

Re: [WIP] Prey - antitheft system
 
Yes, I got it working! I installed v6.2 and did the first registration. That worked, the Linux Desktop showed up in my preyproject account. Then I checked the service running on my Jolla, and something seemed to be wrong. I updated to v6.3-2 and then 'systemctl status prey.service' works OK. Thanks!

sandy_locke 2014-11-23 13:15

Re: [WIP] Prey - antitheft system
 
Sorry if it seems out of place, but can I install a prey instance on my own server without relying on third-parties? If no, is there an anti-theft solution that allow me to do this?

nieldk 2014-11-23 13:44

Re: [WIP] Prey - antitheft system
 
Quote:

Originally Posted by sandy_locke (Post 1448911)
Sorry if it seems out of place, but can I install a prey instance on my own server without relying on third-parties? If no, is there an anti-theft solution that allow me to do this?

I don't think this question is out of place at all!
Actually, running the standalone version on own server opens more options.

install standalone version on your server, have a look here:
https://github.com/prey/prey-standal...ster/README.md

sandy_locke 2014-11-24 10:38

Re: [WIP] Prey - antitheft system
 
Quote:

Originally Posted by nieldk (Post 1448918)
I don't think this question is out of place at all!

Actually, running the standalone version on own server opens more options.



install standalone version on your server, have a look here:

https://github.com/prey/prey-standal...ster/README.md


Thank you ! So basically the phone will only ping to my server and my server only to handle all Prey features ? I assume that you have to install the standalone version + the control panel for it to work correctly, am I right ?

nieldk 2014-11-24 11:38

Re: [WIP] Prey - antitheft system
 
Quote:

Originally Posted by sandy_locke (Post 1449064)
Thank you ! So basically the phone will only ping to my server and my server only to handle all Prey features ? I assume that you have to install the standalone version + the control panel for it to work correctly, am I right ?

I will do some testing on this.
But yes, install those on your server, and make the changes in prey config file on phone, so that it pings your server.
Given the very positive reply to my fundraiser, I will definately look more into a more complete solution to enable all features, and possibly think of what else could be handy.
I also would like to figure out a way to secure the phone - the services - so that it hopefully can be more 'tricky' for a thief to disable prey.

sandy_locke 2014-11-27 17:50

Re: [WIP] Prey - antitheft system
 
@nieldk : at last, you made those anti-theft systems really interesting for Jolla users. Thanks !

CepiPerez 2015-01-19 16:43

Re: [WIP] Prey - antitheft system
 
Too bad I've missed this app when I had my jolla.
Can you tell me how does it works? How does it checks if the phone is missing?

nodevel 2015-01-19 17:01

Re: [WIP] Prey - antitheft system
 
Quote:

Originally Posted by CepiPerez (Post 1457277)
Too bad I've missed this app when I had my jolla.

Oh, you lost it? :( Sorry to hear that.
I thought you were about to get one around this time. Was it that one?

Quote:

Originally Posted by CepiPerez (Post 1457277)
Can you tell me how does it works? How does it checks if the phone is missing?

See http://preyproject.com/ for more info.

By the way, rainisto has mentioned that Jolla plans to officially integrate it into SailfishOS.

nieldk 2015-01-19 17:13

Re: [WIP] Prey - antitheft system
 
I have just build nodejs. https://build.merproject.org/package...nielsen/nodejs
So, You can now install the newest version (1.3.6) with npm as instructed here:
https://github.com/prey/prey-node-cl...ster/README.md
It still not 100% good, but you can track the device, get reports and more.

CepiPerez 2015-01-19 19:35

Re: [WIP] Prey - antitheft system
 
Thanks for the info.
It was stolen, like my n9 and my old notebook. Yes, I have bad luck in excess.

I know what it does, but I'm wondering if what happen if I sent a signal to phone when it's disconnected from internet.
Does it get the signal when it's connected or I need to send signals til I get it?

I was planing to make an anti-thief app that checks in a web page if it's a stolen phone when active connection, and starts the magic by itself.
Of course, it was before I know there's already an app for this.

J4ZZ 2015-01-19 20:14

Re: [WIP] Prey - antitheft system
 
Quote:

Originally Posted by nieldk (Post 1457283)
I have just build nodejs. https://build.merproject.org/package...nielsen/nodejs
So, You can now install the newest version (1.3.6) with npm as instructed here:
https://github.com/prey/prey-node-cl...ster/README.md
It still not 100% good, but you can track the device, get reports and more.

There is no /usr/share/prey/config when using npm for installing 1.3.6.
Am I missing something? Also no services were installed...

Edit: found /etc/prey/prey.conf but there is no option to set email and smpt server... :(

Any help would be nice... :)

tia

nieldk 2015-01-19 20:31

Re: [WIP] Prey - antitheft system
 
1 Attachment(s)
Quote:

Originally Posted by J4ZZ (Post 1457309)
There is no /usr/share/prey/config when using npm for installing 1.3.6.
Am I missing something?

tia

Yes ;) The new prey uses a commandline configuration script (node)

Code:

[nemo@Jolla ~]$ prey config account

  Usage: cli.js config account [command]

  setup          Starts interactive command-line account setup.
  authorize      Validates auth credentials, and stores API key if authorized.
  verify        Verifies API & Device keys, optionally saving them to config.
  signup        Signs up for a new Prey account.

You can also play with

Code:

[nemo@Jolla ~]$ prey prey console
So, basically,
prey config account setup will ask you for your account credentials, and set up the configuration

J4ZZ 2015-01-19 20:33

Re: [WIP] Prey - antitheft system
 
Brilliant, thanks a lot.

How about the prey service, do I need to make one myself?

nieldk 2015-01-19 20:40

Re: [WIP] Prey - antitheft system
 
Quote:

Originally Posted by J4ZZ (Post 1457315)
Brilliant, thanks a lot.

How about the prey service, do I need to make one myself?

It will add /etc/systemd/system/prey-agent.service

which should contain

Code:

[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

and should be enabled by restart (systemctl enable prey-agent.service if not)

nieldk 2015-01-19 20:59

Re: [WIP] Prey - antitheft system
 
Quote:

Originally Posted by CepiPerez (Post 1457304)
Thanks for the info.
It was stolen, like my n9 and my old notebook. Yes, I have bad luck in excess.

I know what it does, but I'm wondering if what happen if I sent a signal to phone when it's disconnected from internet.
Does it get the signal when it's connected or I need to send signals til I get it?

I was planing to make an anti-thief app that checks in a web page if it's a stolen phone when active connection, and starts the magic by itself.
Of course, it was before I know there's already an app for this.

the phone checks every 15 seconds (and there is a 20 second timeout value), that is a total of 35 seconds pull from the phone to the server.
That is, in theory on Jolla. It may take longer.
But, the phone will push for actions when registering, and one action is to check if it is marked stolen, in which case a report will be send to the server.
You can see location (if locked), info on Hardware, Wifi/Net connection and available wlans.

rob_kouw 2015-03-01 15:46

Re: [WIP] Prey - antitheft system
 
Hi nieldk,

I'm a bit puzzled here. I installed prey in August 2014. On the preyproject website I can see the Jolla with all MAC addresses etc. Prey claims the version 0.6.3 is outdated. Also, there are no logs of recent contact.

I looked into the Jolly through SSH and found the folder /usr/share/prey nearly empty. Only a file config.rpmsave is to be found there.

I tried to reinstall through Warehouse, but get errors about perl-Net-SSLeay not being installed. That won't install as perl is missing. And I cannot find how to install perl right now.

Can you help me on this?

Thanks, Rob

nieldk 2015-03-01 16:31

Re: [WIP] Prey - antitheft system
 
Quote:

Originally Posted by rob_kouw (Post 1462451)
Hi nieldk,

I'm a bit puzzled here. I installed prey in August 2014. On the preyproject website I can see the Jolla with all MAC addresses etc. Prey claims the version 0.6.3 is outdated. Also, there are no logs of recent contact.

I looked into the Jolly through SSH and found the folder /usr/share/prey nearly empty. Only a file config.rpmsave is to be found there.

I tried to reinstall through Warehouse, but get errors about perl-Net-SSLeay not being installed. That won't install as perl is missing. And I cannot find how to install perl right now.

Can you help me on this?

Thanks, Rob

I suggest to do (as root) in terminal:

# pkcon install perl

Then you can install perl-Net-SSLeay. And perl-IO::Socket:SSL from my openrepos

Then, reinstall prey. (You should also install preu-UI by solbrit to more easy configure prey.

rob_kouw 2015-03-01 16:42

Re: [WIP] Prey - antitheft system
 
I think I found the culprit: version 1j of OpenSSL. I uninstalled it and installed your version 1h instead.

Code:

[root@Jolla Downloads]# pkcon get-depends openssl
More than one package matches:
1. openssl-1.0.1j-1.5.1.armv7hl [installed]
2. openssl-1.0.1h-1.armv7hl [openrepos-NielDK]
3. openssl-1.0.1j-1.5.1.source [jolla]
Please choose the correct package: pkcon install openssl-1.0.1h-1.armv7hl
Please enter a number from 1 to 3: 2
Getting dependencies
Waiting in queue
Starting
Querying
Resolving dependencies
Installed      bash-1:3.2.57-1.5.1.armv7hl                    The GNU Bourne Again shell
Installed      glibc-2.15-1.3.1.armv7hl                        Embedded GLIBC (EGLIBC) is a variant of the GNU C Library (GLIBC)
Installed      libgcc-4.6.4-1.1.4.armv7hl                      GCC version 4.6 shared support library
Available      openssl-1.0.1h-1.armv7hl                        Secure Sockets Layer and cryptography libraries and tools
Installed      perl-2:5.16.1-1.1.14.armv7hl                    Practical Extraction and Report Language
[root@Jolla Downloads]#


nieldk 2015-03-01 16:50

Re: [WIP] Prey - antitheft system
 
Quote:

Originally Posted by rob_kouw (Post 1462459)
I think I found the culprit: version 1j of OpenSSL. I uninstalled it and installed your version 1h instead.

Code:

[root@Jolla Downloads]# pkcon get-depends openssl
More than one package matches:
1. openssl-1.0.1j-1.5.1.armv7hl [installed]
2. openssl-1.0.1h-1.armv7hl [openrepos-NielDK]
3. openssl-1.0.1j-1.5.1.source [jolla]
Please choose the correct package: pkcon install openssl-1.0.1h-1.armv7hl
Please enter a number from 1 to 3: 2
Getting dependencies
Waiting in queue
Starting
Querying
Resolving dependencies
Installed      bash-1:3.2.57-1.5.1.armv7hl                    The GNU Bourne Again shell
Installed      glibc-2.15-1.3.1.armv7hl                        Embedded GLIBC (EGLIBC) is a variant of the GNU C Library (GLIBC)
Installed      libgcc-4.6.4-1.1.4.armv7hl                      GCC version 4.6 shared support library
Available      openssl-1.0.1h-1.armv7hl                        Secure Sockets Layer and cryptography libraries and tools
Installed      perl-2:5.16.1-1.1.14.armv7hl                    Practical Extraction and Report Language
[root@Jolla Downloads]#


I see.
I will try to create a new build.

Bear in mind, iam also working on a more recent version.
Prey switched now to using nodejs.

I have it partly working. But at the moment it needs a change of mer-release or prey server wont recognize jolla.

rob_kouw 2015-03-01 16:51

Re: [WIP] Prey - antitheft system
 
Now what? preyUI crashes on me. Starting the service with the above code (or similar) results in:
Code:

[root@Jolla system]# systemctl enable prey.service
The unit files have no [Install] section. They are not meant to be enabled
using systemctl.
Possible reasons for having this kind of units are:
1) A unit may be statically enabled by being symlinked from another unit's
  .wants/ or .requires/ directory.
2) A unit's purpose may be to act as a helper for some other unit which has
  a requirement dependency on it.
3) A unit may be started when needed via activation (socket, path, timer,
  D-Bus, udev, scripted systemctl call, ...).


nieldk 2015-03-01 17:05

Re: [WIP] Prey - antitheft system
 
Quote:

Originally Posted by rob_kouw (Post 1462462)
Now what? preyUI crashes on me. Starting the service with the above code (or similar) results in:
Code:

[root@Jolla system]# systemctl enable prey.service
The unit files have no [Install] section. They are not meant to be enabled
using systemctl.
Possible reasons for having this kind of units are:
1) A unit may be statically enabled by being symlinked from another unit's
  .wants/ or .requires/ directory.
2) A unit's purpose may be to act as a helper for some other unit which has
  a requirement dependency on it.
3) A unit may be started when needed via activation (socket, path, timer,
  D-Bus, udev, scripted systemctl call, ...).


Please try

systemctl enable prey.timer

rob_kouw 2015-03-01 17:14

Re: [WIP] Prey - antitheft system
 
In preyUI I have to enter my root password. Normally I enable Remote connection - and root password - only when I want to SSH into the Jolla.
Do I have to have Remote connection enabled all the time?
Thanks!
EDIT: probably not, only when I wish to stop the timer from preyUI.

nieldk 2015-03-01 17:24

Re: [WIP] Prey - antitheft system
 
Quote:

Originally Posted by rob_kouw (Post 1462466)
In preyUI I have to enter my root password. Normally I enable Remote connection - and root password - only when I want to SSH into the Jolla.
Do I have to have Remote connection enabled all the time?
Thanks!
EDIT: probably not, only when I wish to stop the timer from preyUI.

Remote connection .... hmmm..... never tried with this disabled.
But, good point indeed. Should not be needed.


All times are GMT. The time now is 17:39.

vBulletin® Version 3.8.8