[Request] Rockon Utorrent

Hi Guys

I have just started to use Rockstor, and it’s really great so far the only thing am missing is the Utorrent rockon. I know there was a poll and Transmission was selected and also I have seen deluge there, so was wondering if you guys could add Utorrent as well!!.

Thanks

@Mahmoud87 Welcome to the Rockstor community. Glad you like it so far.

As for Utorrent, each Rock-on is defined by a single file (on the Rockstor side) which identifies a particular docker image to use (from Docker Hub), it’s required configuration, and user prompts that supply elements of this configuration. If you can find a respected docker image for Utorrent you may just be able to modify either the Transmission or Deluge json files found in the official Rockon-registry on GitHub and alter all of their details accordingly. You can also check your json formatting by using an online system such as http://jsonlint.com/ which can check for common mistakes in the formatting of such files.

There are pretty accessible instructions on making your own Rock-on as well as how to test it on your Rockstor install in the README.md file in the same Rockon-registry on GitHub. Once you have a working json file for Utorrent you could submit it for inclusion into this registry, again the README.md covers how to do this. Then it will appear as an option for install to all other Rockstor users. Try looking at the other files available in the linked repo to get a feel for what is involved.

Hope that helps.

1 Like

Appreciate your reply Phil, am really unfamiliar with the docker images or git, and I have read pretty much all the references you have provided I was able to a docker for uTorrent, also I was able to edit from Transmission.json and create one that should be suitable for uTorrent, but really I don’t know how to proceed from there. I am not sure how to test it before submitting it on the Rockon-registry.Thanks again.

Hey Phil, I had at mate a work who helped me to upload the .json file to rockstor. First the directory /opt/rockstore/rockons-metastore/ didn’t exist so I had to create it and gave it the appropriate permissions. I have added the .json file to the location and tried to update the rockons from web ui but kept getting this error.

“Traceback (most recent call last):
File “/opt/rockstor/src/rockstor/storageadmin/views/rockon.py”, line 105, in post
self._create_update_meta(r, rockons[r])
File “/opt/rockstor/eggs/Django-1.6.11-py2.7.egg/django/db/transaction.py”, line 371, in inner
return func(*args, **kwargs)
File “/opt/rockstor/src/rockstor/storageadmin/views/rockon.py”, line 137, in _create_update_meta
ro_defaults = {‘description’: r_d[‘description’],
KeyError: ‘description’

@Mahmoud87 Well done getting this far; I imagine you are almost there and just need to correct a thing or two within the file, ie what ever is causing the “KeyError: ‘description’” part of the error you received. Did you copy and past the contents of the file you installed in your Rockstor into the http://jsonlint.com/ web page to check it for formatting first (via the Validate JSON button)? Also once that is done and if that doesn’t point you in the right direction you can always paste the output here in the forum so that others can help with what might be causing this error.

When pasting code or format sensitive content to the forum it helps to preserve the formatting by surrounding what ever you past with triple inverted backslashes:
ie:
```
pasted output
```

That way it will stay as is which helps with working out what’s what.

Yes this is normal, as it goes the ‘local repo’ feature is relatively new and in time should see some polish but for the time being there are still wrinkles such as having to create the directory.

Something that may help is the nano text editor (installed in Rockstor by default) which is fairly friendly (on screen instructions for edit keys) so you can make changes to the already uploaded file by way of testing those changes in place. This can be run either via a ssh console into Rockstor or using the new System - System Shell terminal access menu item. Not that with this Web-UI shell access by default you will have to login first as the admin user then ‘su root’ (switch user to ‘root’) to upgrade to the root user. Then you will be able to edit this file, but be careful as you are also able to do anything else as well, good or bad.

Hope that helps and it looks like you are close now.

Hi mate, yes I have modified from the Transmission .json file and made sure it was pointing to the right image which was dbarton/utorrent, also I have validated the file at “jsonlint.com” and it said its valid then copied and pasted in a .txt and changed the extension to the .json file. I might try the nano editor for sure, am using winscp at the moment and it has it’s own editor so am getting by. Here is the .json file

{
“utorrent”: {
“volume_add_support”: true,
“ui”: {
“slug”: “”
},
“version”: “1.0”,
“containers”: {
“utorrent”: {
“image”: “dbarton/utorrent”,
“launch_order”: 1,
“ports”: {
“8080”: {
“description”: “Port used to share the file being downloaded. You may need to open it (protocol: tcp and udp) on your firewall. Suggested default: 8080.”,
“host_default”: 8080,
“label”: “Sharing port”
},
“8000”: {
“description”: “utorrent WebUI port. Suggested default: 8000”,
“host_default”: 8000,
“label”: “WebUI port”,
“protocol”: “tcp”,
“ui”: true
}
},
“volumes”: {
"/var/lib/utorrent-daemon": {
“description”: “Choose a Share where utorrent will save all of it’s config and data files including your downloads. Eg: create a Share called utorrent-data.”,
“label”: “Data Storage”
}
},
“environment”: {
“UTUSER”: {
“description”: “Choose a login username for uTorrent WebUI.”,
“label”: “WebUI username”,
“index”: 1
},
“UTPASSWD”: {
“description”: “Choose a login password for the utorrent WebUI.”,
“label”: “WebUI password”,
“default”: “admin”,
“index”: 2
}
}
}
}
}
}

@Mahmoud87 OK, just had a quick look at your file as is and I see a few issues.

The Transmission Rock-on uses a docker image that exports both config and data in the one share (I think) however from https://hub.docker.com/r/dbarton/utorrent/ it looks like your chosen docker image uses 2 volumes, one for settings and another for media. I suggest you look at other Rock-on json files and see how to map 2 volumes and the emerging convention seems to be that settings are labeled as Config. So you would have a ‘Config’ and a ‘Media’ volume entry for this json.

Another difference is that where as the Transmission docker image provides a facility to pre-configure username and password of the Transmission login user your docker image provides configuration option for the UID and GID of the user under which utorrent will be run. This is a good thing to see as then users of the Rock-on can know what user to assign ownership of the relevant shares to. Also the UTUSER and UTPASSWD environment variables you set are not mentioned on that page but instead we have:-

"If you want to run utorrent with different ID’s you’ve to set the UTORRENT_UID and/or UTORRENT_GID environment variables …"
So that’s another thing to sort along with the associated labels. You could look at the plex.json file for how similar variables are labeled / presented. I.e.

                    "PUID": {
		        "description": "Enter a valid UID to run Plex with. It must have full permissions to all Shares mapped in the previous step.",
                        "label": "UID",
                        "index": 2

Except with your container the PUID would have to be “UTORRENT_UID” as that is what your chosen docker image reacts to, along with another entry for the UTORRENT_GID environment variable. Don’t know how they set their Web-UI login user as that’s not mentioned in that page, maybe on first login there is an option to do the same.

Finally you have entries in your json for port 8080 and 8000 but the above page mentions 8081 in the example docker command but then directly below that mentions port 8080 in the following:

http://my-docker-host:8080/gui

So some inconsistencies in source instructions there. Later it also mentions port 6881 and that is also specified in the build but nothing is said of it so you could always add that as another port option. A quick look at other utorrent images shows they also require this 6881 port. Also there is further inconsistency with the directory of the volumes to map, the docker-compose instructions give /datadir and /media yet the example config for docker-compose gives /settings and /media I suspect they cut and past the docker command line from a sickbeard image. So try using the values found in the docker-compose directions; or pick an image without so many inconsistencies within it’s instructions.

The “/gui” entry in the above url would suggest you also need a slug entry of “gui” again plex has one of these, it is placed after the “WebUI port” entry to access the interface of the defined Rock-on.

I’m not familiar with this software but in their docker run command they have --name sickbeard, which is strange as I would have expected utorrent (I suspect this is another anomaly on their part). Anyway given one may be a fork of the other maybe our existing sickbeard.json would also server as an example of a similar Rock-on definition file, that one maps 3 volumes but you will only require 2, it also, like the Plex json and your chosen docker image, allows to setting the user and group id.

So you could try basing your file on the sickbeard.json file as it’s closer to the requirements of your chosen docker image, ie multiple volumes, single port, and uid and gid settings. But you would have to add the required slug entry by the looks of it. Also note the differences in the paths used for the externally mapped volumes, ie dbarton/utorrent uses /settings and /media where as our existing sickbeard json uses /download, /config, and /tv. So you will need to change those accordingly and their associated lebels and descriptions.

Give the README.md file another read as now you’ve played around a little and seen more of the requirements of your particular image you should be on the home run.

Hope that helps to point you in the right direction and is of some use. You might re-consider your choice of image given the many errors on it’s page and the fact that it appears not to be maintained, but it’s still useful to get this one going anyway.

Hi Phil, cheers for the great tips, I took your suggestions and used a different docker image of utorrent, also checked Plex and sickbeared .json files, now guess what I was able to successfully install utorrent rock-on on my rockstor. I have also mapped one more volume instead of just 2, polished it with nice informative names. The only issue now when I open the UI it says “This site can’t be reached”. I have tried both ports 8080 and 6881 and both give the same error.
I have used this Docker

Here is the .json file I was able to install.

{
	"utorrent": {
		"containers": {
			"utorrent": {
				"image": "ekho/utorrent",
				"launch_order": 1,
				"ports": {
					"6881": {
						"description": "Port for utorrent Web interface. Suggested default: 6881.",
						"host_default": 6881,
						"label": "WebUI port",
						"procotol": "tcp",
						"ui": true
					}
				},
				"volumes": {
					"/data": {
						"description": "Directory for your downloaded media.",
						"label": "Downloaded Data"
					},
					"/utorrent": {
						"description": "Holds all the utorrent settings files and databases.",
						"label": "uTorrent Settings"
					},
					"/torrents": {
						"description": "Holds all the torrent settings files.",
						"label": "Torrents"
					}
				},
				"environment": {
					"RockStor_UID": {
						"description": "Enter a valid UID to run uTorrent as. It must have full permissions to all Shares mapped in the previous step.",
						"label": "RockStor_UID",
						"index": 1
					},
					"RockStor_GID": {
						"description": "Enter a valid GID to use along with the above UID. It(or the above UID) must have full permissions to all Shares mapped in the previous step.",
						"label": "RockStor_GID",
						"index": 2
					}
				}
			}
		},
		"description": "BitTorrent client",
		"ui": {
			"slug": "gui"
		},
		"volume_add_support": true,
		"website": "https://hub.docker.com/r/ekho/utorrent/",
		"version": "alpha"
	}
}

Again, Thank you Phil so much to get me this far :smiley:

What I know is the webui for utorrent is just a remote connection to the utorrent server and you have to activate it from the utorrent application, so basically I have utorrent client running have all my torrents and from external source I use my ip:port to connect to the utorrent server from any browser and this is how am running it now but not on Rockstor, so I really don’t know how the rockon will work if there is no server to connect to.

@Mahmoud87

This is great news, definitely making progress. Just a little more to go then.

OK, from your new docker image info page ekho/utorrent we see that this image has no facility to control what user or group the utorrent server is run as; ie there is no environment variable option to set these. So it’s not an option that needs to be in your json file as the docker image will do nothing with it. We can confirm this by a quick look at the images dockerfile itself (as your json file defines your Rock-on, the dockerfile defines the docker image). So setting these environment variables does no harm but also has not effect so they can simply be removed, ie the whole “environment” section of the json is not needed with this image, ie:

"environment": {
					"RockStor_UID": {
						"description": "Enter a valid UID to run uTorrent as. It must have full permissions to all Shares mapped in the previous step.",
						"label": "RockStor_UID",
						"index": 1
					},
					"RockStor_GID": {
						"description": "Enter a valid GID to use along with the above UID. It(or the above UID) must have full permissions to all Shares mapped in the previous step.",
						"label": "RockStor_GID",
						"index": 2
					}
				}

Has no effect because the environment variables it setups up (RockStor_UID & RockStor_GID) are simply not used in this new image so this whole section can just be removed.

An example of an existing Rock-on json that has no “environment” section is symform.json

Another minor issue is your addition of the /torrents volume. It is not defined within this docker image so probably best leave this out for the default Rock-on definition. But your other volume definitions look dandy. We can test those once the Web-UI bit is sorted.

Anyway all that aside it looks like the image port for the Web-UI is 8080, confirmed by the images info page presenting the following url for example Web-UI access:-

http://docker-host:8080/gui

Of course the actual port you use will depend on what the internal port of 8080 is externally mapped to, ie which port is configured on Rockstor to map to the internal port of 8080. That is what port is chosen to externally (on Rockstor) map to the internal 8080 port of the docker image, this external port is chosen during the Rock-on install.

So apart from the redundant mapping of the /torrents volume which may not even exist within this docker image, and the unused “environment” section we have just the matter of adding both ports, not just the Web-UI port entry.

You have already added the “WebUI port” port but it needs to be changed back to 8080 both as the internal (docker image) and external (what the docker system maps it to externally by default) settings. I.e. change both your 6881’s to 8080. But you have to also add another section to map the 6881 port but don’t include the ““ui”: true” line for that port entry as it’s not for ui access as you have already defined a port entry for that. Also the ““procotol”: “tcp”” lines are restrictive and optional, I’d leave it ‘as is’ for your ui port but leave it out for your 6881 port entry as we don’t yet know if it needs tcp udp or both and if it’s not there then both are allowed. You could label this 6881 port at the “uTorrent port” with an appropriate description.

Hope that helps and remember to double check the file contents for json validity after edits at http://jsonlint.com/ or the like. Let us know how you get on after these edits.

I am kinda lost now.

I made sure that the default port which is 8080 is the web ui port during the Rock-on installation.

I have removed the /torrents volume I have added as well as removing the environment section, validated the .json file and installed it once again to Rockstor but still same results. Clearly am doing something wrong :grinning:

Here is the new .json file

{
	"utorrent": {
		"containers": {
			"utorrent": {
				"image": "ekho/utorrent",
				"launch_order": 1,
				"ports": {
					"8080": {
						"description": "Port for utorrent Web interface. Suggested default: 8080.",
						"host_default": 8080,
						"label": "WebUI port",
						"procotol": "tcp",
						"ui": true
							}
					},
					"6881": {
					"description": "Port for incoming data. You may need to open it(protocol: udp) on your firewall. Suggested default: 6881. Should NOT be changed",
					"host_default": 6881,
					"label": "uTorrent port"
				},
				"volumes": {
					"/data": {
						"description": "Directory for your downloaded media.",
						"label": "Downloaded Data"
					},
					"/utorrent": {
						"description": "Holds all the utorrent settings files and databases.",
						"label": "uTorrent Settings"
					}

				}

			}

		},
		"description": "BitTorrent client",
		"ui": {
			"slug": "gui"
		},
		"volume_add_support": true,
		"website": "https://hub.docker.com/r/ekho/utorrent/",
		"version": "alpha"
	}
}

Phil I don’t know how many times I wanna say thank you, I started this with 0 Knowledge literally 0, and by your help now I managed to get it all working 100% seriously mate thank you so much for all your help you rock. UTORRENT ROCK-ON now is up and running.

What I have done, I went back to the dbarton docker and since I know now how to modify and validate the .json file I manged to get it installed, used the steps you provided in your recent comment, read his docker image very carefully added the correct volumes and ports then BAM :heart_eyes: :muscle: the Rock-on was installed then tried to open the UI and another BAM :joy: it took me to the sign in page. I had some lil troubles finding the default username and password but at the end got it all working. Thanks Phil and really appreciate your patience and help.

1 Like

Excellent, well done for persevering; quite a few things to pick-up on at first but at least now you are up and running and able to do the same with other, as yet unavailable, Rock-ons / docker images if you fancy.

A further suggestion is to put what you found to be the default user and pass into a “more_info”: section/line at the same level as your “description”: entry in your current working json, that way once installed there will be a little i icon next to the spanner which will, when clicked on, bring up an “Additional information about …” type dialog. That way the same information will be available for others from the Web-UI. You could also add a few words to advise that this default password be changed and how to go about doing it. Examples of Rock-on definition files that use this facility are rocketchat.json and plex.json. Note that they both use html formatting strings within their text component (the bit between the " characters) ei the strings between the “<>” characters to add additional formatting, ie header level and new paragraph etc. You could keep these as they are in the examples and just change the text to whatever you found to be useful in your setup. Apologies for not assuming knowledge of such things on your part but this way anyone can read this and hopefully do the same for the Rock-ons they would also like to see added.

If you could post the resulting and working json here it would be available and ready for others to use if they wish in the same way as you are not doing.

One last request; if the “more_info” addition goes well and tests as working you could consider adding your hard won uTorrent Rock-on to the list of available Rock-ons by submitting it to the official rockon-registry on GitHub then it would appear as an optional Rock-on for all existing and future Rockstor users, plus future installs of the same on fresh Rockstor installs would then just be a few clicks away. Plus others can then more easily chip in with their own improvements to this Rock-on via their own GitHub pull requests. The instructions to achieve this are at the beginning of the README.md in the same repository. That way attribution is automated and you would become an official contributor.

Hope that helps and good luck with the more_info section; it’s bound to help as if nothing else at least the required login information is tied in with the Rock-on itself for future reference.

All done mate interestingly enough I was thinking the same thing and started playing around and looking at the “more info” of the other. json files.

I have added the 6881 port as well in the .json in case someone wants to use the .json file on a different docker image that supports the port. I have also done some searching and confirmed it’s a udp port so all should be fine. I have tested it for the last time and it worked perfectly well. You can check it out now on the Rock-on Registry GitHub uTorrent.json. Again Thank you Phil appreciate your help mate :slight_smile:

OK that great. Nice having a link to it now.

So only the submission to the official rockon-registry left. This is a slightly convoluted process but a necessary one. Only @suman has write access as all additions are curated, that is why you received the “… File uploads require push access to this repository.”

I see from your edit just now (as I began this reply) that you have already made yourself a GitHub account and successfully forked (copied) the rockon-registry into it. From there I also see that you have successfully uploaded your uTorrent.json file to your own GitHub account as indicated by your link.

So the only thing left is for you to submit a ‘pull request’ to the official rockon-registry (the one @suman curates) that your forked, so that he can ‘pull’ the changes you made in your fork (copy) into the master repository. As then all Rockstor installs will have access to it.

But there is one last formality. In order to isolate this file as the change you wish to present, you must first make a new branch in your GitHub repository that is taken from your master branch. Normally you would only make the changes you want to submit on this branch but as your have already made the changes you might as well simply branch from what you have already done.

You will see a “Branch: master” button on your GitHub page, click this and you should see an empty box in which to type. This will create a new branch under the name you type. In this case a good name would be:

uTorrent

This will by default copy your master into a ‘version’ that would keep isolated the changes you are about to make, but given you have already made them to your master branch, no worries. But it is good practice to keep these changes isolated. That way if you were to contribute another Rock-on you would in turn make another branch named appropriately and make only the changes necessary for this additional rock-on in that branch. Once your changes have been accepted / pulled / merged upstream it is good practice to delete your branch as it is then redundant. But this is your call and we can cross that bridge when the time comes. Just make sure to not make any changes to the uTorrent branch that are not related to the uTorrent file.

Anyway, once you have the named branch you can make sure it is selected, by the same drop down, and press the Pull request link / button. GitHub knows your version was forked from what is now upstream to you (suman’s official repo) and will create a pull request form that has your uTorrent related changes attached to it. Fill in this form with a description of your intentions and how you have tested what you are presenting, you could also put in a link to this forum thread if you thought it necessary. Your pull request should then appear on the following pull request page on the official rockon-registry.

This is a lot of messing around but is required to manage multiple changes made by multiple people. And once you have gone through it it’s fairly straight forward (sort of).

See how you get on and once done we can more easily collaborate on further polish changes if need be. The ‘pull request’ terminology is a little confusing and is made up by GitHub as they are thinking that @suman is being requested by you to pull the noted changes from your repo. GitLab / Git would I think more accurately call this a merge request, ie merge your changes as presented into @suman’s master copy.

Hope that helps and see how you go.

By the way the 6881 port is supported by the dbarton/utorrent image as indicated on their Dockerfile tab page:

EXPOSE 8080 6881

Also note that due to the curated nature of the official repository it may be that your particular json is not merged, for what ever reason. Don’t be put off by this as you now have your version to pull in at any time as does everyone else now, we will just have to see. Also there may be more changes that are easier to discuss within the pull request itself, as there it’s possible to highlight lines etc in notes.

Well done, this is a lot of ground to have covered. I hope your json gets accepted, also note that if it does others may also make changes of their own, by their own pull requests on your changes. Hence the need for a certain amount of organisation / structure.

All done and the Rock-on has been submitted to the official Rockon-registry hopefully it will get accepted.

Checked it and it’s appearing there :+1:

I don’t mind at all, am so glad to be a part of the community.

1 Like

when can we see this on the avable rock-ons on the dash-board?

what does it take to get listed on the dashboard?

Hi @dsullivan it’s ready mate and I have been using it for almost 2 weeks now, I put it on GitHub and waiting it to be in the official Rock-ons it’s up to @suman_chakravartula now he is the one to make the decision of sharing it publicly or not. :slight_smile:

@phillxnet’s posts in this thread describe how to get a new rock-on officially listed (via the rockon-registry github). However, if you’re keen on trying @Mahmoud87’s ahead of time, you can place his configuration file in the /opt/rockstor/rockons-metastore directory (create this if it doesn’t exist).

1 Like

@sfranzen Thanks for clarifying here.

Just a little note though, I think the following link represents a bug fix variant of what @Mahmoud87 first submitted. It’s the final version awaiting inclusion in the Rockstor-repo pull request, ie has a few minor fixes since it’s initial commit.
Mahmoud87 final Utorrent Rock-on and is part of the following pull request:

where the final changes were applied.

Hope that helps.

2 Likes