Got a few Services Running on Rockstor (Dropbox, Pi-hole, Plexrequests, etc)

Thanks to everyone for helping me on various topics. Thought I’d give something back with some tinkering.

Got a few things running after trying to implement a few of them as dockers and failing.

Dropbox

Basically followed this guide

curl -Lo dropbox-linux-x86_64.tar.gz https://www.dropbox.com/download?plat=lnx.x86_64
sudo mkdir -p /opt/dropbox
sudo tar xzfv dropbox-linux-x86_64.tar.gz --strip 1 -C /opt/dropbox
/opt/dropbox/dropboxd

Visit link it gives you to link your dropbox account. You now have a dropbox folder in ~/Dropbox/ that you can symlink other folders. (Note rockstor shares are in places like /mnt/books/ and /mnt2/movies/ depending on which user owns them.)

Dropbox service

sudo curl -o /etc/init.d/dropbox https://gist.githubusercontent.com/thisismitch/6293d3f7f5fa37ca6eab/raw/2b326bf77368cbe5d01af21c623cd4dd75528c3d/dropbox
sudo curl -o /etc/systemd/system/dropbox.service https://gist.githubusercontent.com/thisismitch/6293d3f7f5fa37ca6eab/raw/99947e2ef986492fecbe1b7bfbaa303fefc42a62/dropbox.service
sudo chmod +x /etc/systemd/system/dropbox.service /etc/init.d/dropbox
sudo nano /etc/sysconfig/dropbox

Change file to look like this:

DROPBOX_USERS=“your_user_name”

Back to Bash:

sudo systemctl daemon-reload
sudo systemctl start dropbox
sudo systemctl enable dropbox

Dropbox Command Line (bc headless)

cd ~
curl -LO https://www.dropbox.com/download?dl=packages/dropbox.py
chmod +x ~/dropbox.py
ln -s /opt/dropbox ~/.dropbox-dist
~/dropbox.py

Link above shows basic commands like:

~/dropbox.py status
~/dropbox.py exclude add
~/dropbox.py exclude list

And one I found useful:
This contextually shows the directory’s dropbox status and colors files based on sync status (too cool)

~/dropbox.py ls


Exiftool organizing photo share

cd ~
wget http://www.sno.phy.queensu.ca/~phil/exiftool/Image-ExifTool-10.51.tar.gz
tar -xzvf Image-ExifTool-10.51.tar.gz

Move the folder to wherever you like to install things. I prefer /opt/exiftool/ for mine.
Check that exiftool is working ./exiftool SOME_PICTURE and make sure it prints out data.

To make your picture directory self-organizing:

  1. Make sure your files have proper dates in whatever field you like. Some people like using filemodifydate, I like using the exif data directly (EXIF:datetimeorignal). You can set dates by using the

exiftool “-xmp:datetimeorignal=“YYYY:MM:DD”” DIR_WHERE_PICS_ARE
and you can always use the -r command to make anything recursive (be careful!)

  1. Add your existing pictures with good dates to this picture folder. /mnt2/pics/ for me.
    Attempt a sort (try a small number of photos first please). Note: you may need to modify this command to suit your needs like a different exiftool location or wanting to use a different date or directory structure.

/opt/exiftool/exiftool -r “-filename<datetimeoriginal” -d /mnt2/pics/%Y/%m/%d-%H-%M-%S%%-c.%%e /mnt2/pics/
This one is recursive.

  1. If this sort worked well. Add a few test pictures into the root.

crontab -e

Insert the following

0 0 * * * /opt/exiftool/exiftool “-filename<datetimeoriginal” -d /mnt2/pics/%Y/%m/%d-%H-%M-%S%%-c.%%e /mnt2/pics/

I personally don’t use -r option in my daily exiftool run because the pictures in folders are already organized and there is not point wasting effort :slight_smile: Another option is to use an inbox folder like /mnt2/pics/inbox/ with the -r option.
Congrats, your pictures are self-organizing (assuming they have good dates in their metadata :wink:


Pi-hole

Version released on July 2016 now compatible with CentOS.
Very simple to install and get running. Can confirm it works with no real issues.

curl -sSL https://install.pi-hole.net | bash

Also you will want to point your router’s DNS to your Rockstor server. So in my case 192.168.1.121. You can manually configure each client computer’s DNS but this seems more tedious.

Beware some of the default lists for pi-hole are a little tedious and block referral links etc and most notably don’t block youtube ads well. But I figure it still saves me a ton of bandwidth. Sometimes upwards of 50% of the day’s queries are blocked. Also Pi-hole works for mobile devices on your wifi. A nice bonus!


Pip based tools I find cool / useful on my headless server

sudo yum install python-pip

uTorrent Command Line Control
uTorrent is awesome but it’s webui isn’t. It lacks simple features like being able to shift a torrent up to the top of the pile of downloading torrents. BTC allows this and much more via searching for torrents and piping them into other BTC commands.
BTC Github Page

sudo pip install -U https://github.com/bittorrent/btc/tarball/master

Instant music
This tool downloads music files from youtube videos in a friendly way.

sudo pip install instantmusic


Ideas / Ask for Improvements

  • pi-hole rockon - in the works below
  • Dropbox rockon
  • Plexrequests docker working - @Fredrik finished.
  • Installing beets through pip and having it correct music metadata in background
  • Trying Snort IDS, Squid, Squid Guard
  • Scripting video transcodes in background
  • Log file aggregation tool
  • Scripting connecting my phone and syncing my music to it / pulling pictures off of it
  • Scripting exiftool organization of my photos share - see above @coleberhorst finished.

If you have any suggestions, they are welcome! Or you can kind of see my interests from above, if you have anything you feel matches them, I am more than happy to tinker :slight_smile:

1 Like

Hello,
I made a pull request to get plex request added.


Feel free to try it and comment.

1 Like

I will add that the new pi-hole is absolutely awesome. Does indeed run very well on a rasb pi, and is definately something you might want to include on your Rockstor server.

Might be a good candidate to put in a rockstor though? Perhaps when I have my home box back up and running I’ll delve into making it so.

Do you have your current attempts somewhere for us all to see? (aka not a local gitlab rock-on :wink: ) Easier to get help that way

I’m working on getting that into rockon also but it’s a bit more tricky as it depends on port 80 :frowning:
But think I will have it done during next week and pull request done.
Also it seems to be a 2 image thing as one have the main app and another have the cron schedule.

Tested your plexrequests rockon. Works wonderfully! I uninstalled my version and removed it from my how-to. I added a comment to the pull request confirming it works as well.

As far as the pi-hole goes, I will dig through my git repo for my best version of the json file and post it.

I have pi-hole ready for testing also. It still needs some work i think but could be good to have someone else giving input also. Don’t really like the dependency to port 80 but perhaps a rockstor developer can say if it’s ok.
Will wait until the plex requests are merged before uploading to me github fork.

For pi-hole you can just checkout a new branch in your fork of rockon-registry like this and can even push just that branch back to the master.

cd YOUR_ROCKON_REGISTRY_DIR
git checkout -b pi-hole

I added a method to use exiftool to automatically sort photos that have proper datetimeoriginals in their exif data.

I created the branch and uploaded the .json
Didn’t think i would actually start making multiple pull requests :slight_smile:

This .json is a bit of WIP and needs some testing. But will start and do it’s job for me.

How would one go about installing this (pi-hole), if I wanted to test it?

Add-blocking this way seems so straight forward :slight_smile:

Well you need to first add the file into director using SSH.

Login with SSH.
Got to directory “/opt/rockstor/rockons-metastore/”

  • If the directory does not exist… create it

Download the file into this directory using curl or how ever you want to do it.
curl -o pi-hole.json https://raw.githubusercontent.com/Fredrik81/rockon-registry/fd82b417dec2fac24ad3172f0d7c1c2f53a96ddb/pi-hole.json

Then go into rockstor web-interface and in the rockons menu click "update"
Then the new rockon should appear.

You can also do all this with other methods like SCP/WinSCP. You pick :slight_smile:

Remember to: When/If the rockon get’s added to the official registry you should remove this file so the official one will be used.

Thanks for this Rockon… I’ll test it as soon as I can as I’m interested in it.
In the meantime, I commented on a few copy-paste omissions in the json file. :wink:
I’m also a little puzzled by the container’s wording on the IPv6 option’s explanation so I’m not sure the corresponding choice for the default is the most appropriate.

Thanks again for your files!

The defaults will not work anyway… as i said sort if a quick and dirty WIP test :slight_smile:
Thanks for commenting on it i will make the adjustments to it. The IPv6 seems to best left turned off in most scenarios from what i can tell it mostly have to do if your network is IPv6 but most users and companies are still on IPv4.

Well, I got it installed, and it seems to be working.

There are bugs though. I for instance cant acces the web interface:

And some of the settings while setting it up were a little bit confusing.

But I did add the Rockstor server as my primary DNS, and I’m able to visit pages, so the DNS part seems to work.
It also seems to be filtering ads, and pages load very quick.

But it would be nice to have access to the Web interface :slight_smile:

Try this:
http://[serverip]/Admin

Gives the same error.

Could it be because I used port 83 instead of 80?

Could be. I used port 80 and it’s working for me.
Don’t really like the dependency of this port :slight_smile:

OK.

I’m uninstalling and will try again with port 80.

Sadly doesnt seem to work:

I cant get the thing to whitelist me :slight_smile:

Strange. As you can see from my screenshot it’s working just fine.
Did you specify the same IP adress for the server during the config part.
Can you perhaps paste the config summary page of the rockon here as screenshot (just leave out the password)