![]() |
[WIP] Prey - antitheft system
1 Attachment(s)
I have decided to create a seperate thread for Prey on Sailfish, as I believe this is close enough to be working, allthough with some small efforts still needed to be changed in configuration files manually.
My version of prey is on my openrepos for you to test. It should install needed extra packages as needed (openssl-1.0.1f, perl modules and Imagemagick) I am still working on a few features missing. * Streaming video from cam (I believe we need a more recent gstreamer for this) * Alert (needs to find where bg image is stored) * Lock (remember to enable Jollas lock) What is working: * Get geo location * Get network information * Get active connections * Get nearby hotspots * Traceroute * Get running programs * Currently logged in user * NEW Screenshot (has a red colour) * NEW Alarm There is some manual configuration to do after installing the rpm: Edit: Code:
/usr/share/prey/config Get it from https://panel.preyproject.com/profile Code:
api_key='' Code:
mail_to='mailbox@domain.com' Code:
smtp_server='smtp.gmail.com:587' Code:
$ echo -n "password" | openssl enc -base64 When you run (as root) /usr/share/prey/prey.sh first time, it should register the device, and give some terminal output that will show you wheter the connection/registration is successfull. The device will be identified at prey as being 'linux' you cn edit this name to fx 'Jolla'. To query status of prey, you can use systemctl status prey.timer and systemctl status prey.service Changelog: 2805-2014 Version update requires cron (fcron) bugfixes (missing laptop-detect 0703-2014 Changed script to sound alarm, added systemd service and timer files, enables service and starts timer by rpm installation 0603-2014 Added fbcat as a requirement and added a (buggy) screenshot capability (picture has a red teint). |
Re: [WIP] Prey - antitheft system
1 Attachment(s)
Here are the source of the Prey build on my openrepos
They are all from official sources, untouched and can be build using attached spec files with rpmbuild. My QT programming is just beginning, so, do feel free to use this for creating a nice GUI to configure and monitor Prey :) /NielDK Prey (0.6.2) Source: https://s3.amazonaws.com/prey-releas....6.2-linux.zip And the dependencies of Prey: Imagemagick (6.8.8-7) Source: ftp://ftp.imagemagick.org/pub/ImageM...6.8.8-7.tar.gz OpenSSL (1.0.1f) Source; http://www.openssl.org/source/openssl-1.0.1f.tar.gz Perl modules: IO::Socket::SSL (1.967) Source: http://search.cpan.org/CPAN/authors/...L-1.967.tar.gz Net::SSLeay (1.58) Source: http://search.cpan.org/CPAN/authors/...ay-1.58.tar.gz |
Re: [WIP] Prey - antitheft system
Do you intend to add a control panel to perform the configuration?
|
Re: [WIP] Prey - antitheft system
Nice to see openrepos version coming too. Do you have sources hosted in some git repo?
|
Re: [WIP] Prey - antitheft system
:) no, on my laptop, but I will post here later .
Would be nice to see a friendly UI for start/stop/status/config etc. |
Re: [WIP] Prey - antitheft system
Quote:
|
Re: [WIP] Prey - antitheft system
Thanks a lot for you effort! I am looking forward to giving this a try. I just got one question regarding the whole setup: I want to install the Prey server software on my own VPS, but I somehow can't seem to find the source code. Would you be so kind to post a link to it in your first post?
|
Re: [WIP] Prey - antitheft system
Quote:
https://github.com/prey/prey-standalone-control-panel |
Re: [WIP] Prey - antitheft system
Thank you nieldk! Great work!
At the first post into the CODE section correct : # Start timer, as root systemctl start myscript.timer # Enable timer to start at boot systemctl enable myscript.timer in # Start timer, as root systemctl start prey.service # Enable timer to start at boot systemctl enable prey.timer |
Re: [WIP] Prey - antitheft system
Quote:
Thanks for this, It is corrected in first post. |
Re: [WIP] Prey - antitheft system
Could be possible to add the "Installation Guide" into the Description section of the app in Harbour ?
|
Re: [WIP] Prey - antitheft system
Quote:
|
Re: [WIP] Prey - antitheft system
A little update :)
I found a screencaptur program, that does work. It has an issue with the screenshot being tinted red. It is quite easy to install, and use. You will need to edit: /usr/share/prey/modules/session/platform/linux/functions to this Code:
get_screenshot() { EDIT: I have created an rpm file on my openrepos. EDIT: Updated version of prey on openrepos, to include fbcat to enable this - still buggy - feature. I believe its useful, even if the screenshot has a reddish teing to it. |
Re: [WIP] Prey - antitheft system
Why don't you use dbus to take a screenshot?
Code:
dbus-send --session --type=method_call --dest=org.nemomobile.lipstick /org/nemomobile/lipstick/screenshot org.nemomobile.lipstick.saveScreenshot string:/home/nemo/Pictures/screenshot_tmp.png |
Re: [WIP] Prey - antitheft system
Quote:
I did try it |
Re: [WIP] Prey - antitheft system
Quote:
However I didn't manage to configure everything correctly for ruby on rails and prey control panel. If anybody did, it would be great to share the howto :) |
Re: [WIP] Prey - antitheft system
Quote:
Code:
|
Re: [WIP] Prey - antitheft system
New update out:
Alarm sounds is now working (using gst-launch-0.10 with ffmpeg plugin) Also, prey.service and prey.timer files are created automatically, and enabled/started by the rpm script. |
Re: [WIP] Prey - antitheft system
After the update to 1.0.4.20 all the configs of Prey has gone...
No more files into : /etc/systemd/system and no prey's script into : /usr/share/prey/ I hope in the future that the jolla team will improve the OS update in a better way... Every new OS it's, at the moment, a new beginning! :-) |
Re: [WIP] Prey - antitheft system
Well, PREY is not your normal "userland application", it is more a feature of the OS, so no wonder it is run over when core OS is updated :D
That will happen in the future again, too, unless Prey is made into integral part of the OS... :D |
Re: [WIP] Prey - antitheft system
Quote:
But yes, you will need to re-install prey and related packages again after upgrade. Even though my repo is 'down' until further, you are still able to download packages manually and install locally using zypper. |
Re: [WIP] Prey - antitheft system
And after downloading and installing said packages you can try the ui I made:
openrepos.net/content/solbrit/preyui It's a basic settings ui for those afraid of config file editing in dark, scary terminal windows. - It requires pyotherside. - At the moment registration takes a while (because prey.sh pauses for x seconds). Ideally a progressbar should be put in there. - The status output is raw console output and could be cleaned up and displayed differently to be easier to read. I'll get around to that. EDIT - rpm is moved to OpenRepos |
Re: [WIP] Prey - antitheft system
is it? i have a custom file in /etc/systemd/system - see http://talk.maemo.org/showthread.php?t=92736
and it still works after i updated my phone this morning. |
Re: [WIP] Prey - antitheft system
Update does not remove any packages. My quess is that you accidentally removed it, or the package had some depencies that were conflicting on system update.
And, yes, integrated version is beeing tested internally, so it is coming at some point. |
Re: [WIP] Prey - antitheft system
Good day Nieldk!
I hope that you re-up your repo soon. I have too many dependecies failed for reinstalling prey using zypper (libcrypto.so.1.0.0 missing.. ) |
Re: [WIP] Prey - antitheft system
Quote:
openssl-1.0.1f-1.armv7hl.rpm (https://openrepos.net/sites/default/files/packages/500/openssl-1.0.1f-1.armv7hl.rpm) net-ssleay-1.58-2.armv7hl.rpm (https://openrepos.net/sites/default/...-2.armv7hl.rpm) io-socket-ssl-1.967-2.armv7hl.rpm (https://openrepos.net/sites/default/...-2.armv7hl.rpm) fbcat-0.3-0.armv7hl.rpm (https://openrepos.net/sites/default/...-0.armv7hl.rpm) imagemagick-6.8.8-7.armv7hl.rpm (https://openrepos.net/sites/default/...-7.armv7hl.rpm) prey-0.6.2-6.armv7hl.rpm (https://openrepos.net/sites/default/files/packages/not%20yet%20assigned/prey-0.6.2-6.armv7hl.rpm) |
Re: [WIP] Prey - antitheft system
Updated the ui:
v0.1-2 - Added start/stop button for prey.service - Moved settings and registration buttons to pulldown menu - No buttons except status work without setting correct root password first openrepos.net/content/solbrit/preyui |
Re: [WIP] Prey - antitheft system
Quote:
Very good work, and many thanks for making this a more complete solution :) Love You :) |
Re: [WIP] Prey - antitheft system
Hmm, I somehow lost track of prey.timer when updating the ui. I'm adding it to the start/stop button to enable/disable .timer and .service simultaneously. This should make more sense seeing as how disabling .service only won't keep it from running when called by timer, right? Correct me if I'm wrong...
|
Re: [WIP] Prey - antitheft system
I did some changed to the code of prey. You can found them here: https://github.com/holgern/prey-bash-client
Now Changing of excution intervall is possible! between 10min, 15min, 20min, 30min, 40min, 50min and 1 h. This is done by 7 different timer files. prey-10min.timer, ... and prey-hourly.timer. If the device is set to missing, then the excution is set to one of these time :10min, 15min, 20min, 30min, 40min, 50min. This can be done by setting Frequency of reports/actions in the prey control website. After setting the device status to ok, the interval changes back to hourly. I fixed a small bug with the screenshot, as it was not working for me. |
Re: [WIP] Prey - antitheft system
Quote:
|
Re: [WIP] Prey - antitheft system
Quote:
With timer active prey.service should run once every hour, meaning checking your device on https://panel.preyproject.com/devices should never show Offline for >1 hour, right? In my case only running prey.service manually will update the info on url though, suggesting the timer doesn't actually call prey.service, or have I understood it all wrong? :confused: |
Re: [WIP] Prey - antitheft system
Quote:
However, this may be missed, for example, the device goes to sleep. It will then call again on the next hour, depending if the device is not sleeping/have Internet access etc. Calling the prey.service (or even the prey.sh script) manually, yes, that will trigger a login, notifying prey servers that the device has activated and responding to the device with actions to take. So, the prey.timer calls prey.service, just as you could do manually. |
Re: [WIP] Prey - antitheft system
Quote:
|
Re: [WIP] Prey - antitheft system
Quote:
|
Re: [WIP] Prey - antitheft system
Enabling a timer is not enough. I changed the code, so that after a timer is enabled, he is also started. Otherwise, the timer would work only after a reboot.
So Quote:
Quote:
|
Re: [WIP] Prey - antitheft system
Quote:
I didnt start the timer, since the config file was needing update with the owners API key, before this would work anyways. |
Re: [WIP] Prey - antitheft system
nieldk: would it be possible to compile all the prey stuff against openssl-1.0.1f-1.2.1 as installed in 1.0.4.20 by default?
|
Re: [WIP] Prey - antitheft system
Quote:
Yes, no problem. What needs to be recompiled actually only is perl modules IO::Socket::SSL and Net::SSLeay And those you can easy do by using cpan cpan install IO::Socket::SSL cpan install Net::SSLeay allthough, you will need to install development tools to do that. But, I will compile all during the next days. |
Re: [WIP] Prey - antitheft system
Here goes, the final update of the UI:
v0.1-4 - Registration output in real time (and possible registration abort) - Timer state updated and always displayed on main page - Various fixes (Python mostly) and graphical nick nacks https://openrepos.net/content/solbrit/preyui "Final" is ofcourse an optimistic expectation that'll keep me going until the first critical bug is reported :D |
All times are GMT. The time now is 02:47. |
vBulletin® Version 3.8.8