HTPC Manager

Jeff Lamer

Contributor
Joined
Nov 17, 2015
Messages
121
Thought I'd start a thread for Noobies and the setup of HTPC-manager

To date working = SABnzb,Sickrage and Couchpotato, 192.168.1.3 (same jail) user media (816)

I installed HTPC manager in a separate jail 192.168.1.105
I cannot get HTPC to see the other plugins
Questions
1) do I need to "add" storage for this plugin?
2) configure users or authorization in FreeNAS?

This is the error

2016-01-10 17:59:02 modules.sabnzbd ERROR Unable to contact sabnzbd via https://192.168.1.3:/sabnzbd/api?output=json&apikey=8ae4edXXXXXXXXXXXXXX
FreeNAS018.jpg FreeNAS019.jpg
Jeff
 

pirateghost

Unintelligible Geek
Joined
Feb 29, 2012
Messages
4,219
looks like you are missing your port number. fill in the box that has the shaded 8080 in it with the appropriate port number
 

Jeff Lamer

Contributor
Joined
Nov 17, 2015
Messages
121
looks like you are missing your port number. fill in the box that has the shaded 8080 in it with the appropriate port number
Thanks
Damn...I must have bumped my head today. I saw it greyed and assumed it was set. Working now.
Another question..sorry :)
The hellolol fork looks to better for me as I am using Sickrage...I need to figure out how to install a forked version..Not a clue at this moment. Hopefully work is quiet tomorrow and Google and I get along.
Calling it a nighto_O
 

Rudi Pittman

Contributor
Joined
Dec 22, 2015
Messages
161
Thanks
Damn...I must have bumped my head today. I saw it greyed and assumed it was set. Working now.
Another question..sorry :)
The hellolol fork looks to better for me as I am using Sickrage...I need to figure out how to install a forked version..Not a clue at this moment. Hopefully work is quiet tomorrow and Google and I get along.
Calling it a nighto_O

Spent some time today setting up the hellolol fork...it's not that bad.
1) Create a freebsd jail. I named mine htpc-manager_1 to stay in sync with the others.
2) "sudo jls" then "sudo jexec XX sh" where XX is the number next to the htpc-manager jail you created to get to the command line or use the command line button from the jail menu.
3) pkg install nano py27-sqlite3 python [let it upgrade pkg]

You can then follow the instructions here as if all packages were installed starting at the git clone [ I did "chown -R nobody:nogroup /opt/HTPCManager before ]: http://www.htpcguides.com/install-htpc-manager-ubuntu-linux/

change the line in the tutorial
Code:
cp /opt/HTPCManager/initscripts/initd /etc/init.d/htpcmanager

to
Code:
cp /opt/HTPCManager/initscripts/initd.freebsd /usr/local/etc/rc.d/htpcmanager


Edit the path as the tutorial indicated then add the following two lines to /etc/rc.conf

Code:
htpc_enable="YES"
htpc_manager_data_dir="/opt/HTPCManager"


Stop and restart the jail from the GUI and the new htpc-manager should be available at the ip address assigned to the jail on port 8085. You can also start it manually as the tutorial shows. The hellolol version has a self updater feature so from there you should be good. No storage is needed since you do everything from the web page. Wrote this up from memory so if you run into problems yell.
 
Last edited:

Joshua Parker Ruehlig

Hall of Famer
Joined
Dec 5, 2011
Messages
5,949
Spent some time today setting up the hellolol fork...it's not that bad.
1) Create a freebsd jail. I named mine htpc-manager_1 to stay in sync with the others.
2) "sudo jls" then "sudo jexec XX sh" where XX is the number next to the htpc-manager jail you created to get to the command line or use the command line button from the jail menu.
3) pkg install nano py27-sqlite3 python [let it upgrade pkg]

You can then follow the instructions here as if all packages were installed starting at the git clone [ I did "chown -R nobody:nogroup /opt/HTPCManager before ]: http://www.htpcguides.com/install-htpc-manager-ubuntu-linux/

change the line in the tutorial
Code:
cp /opt/HTPCManager/initscripts/initd /etc/init.d/htpcmanager

to
Code:
cp /opt/HTPCManager/initscripts/initd.freebsd /usr/local/etc/rc.d/htpcmanager


Edit the path as the tutorial indicated then add the following two lines to /etc/rc.conf

Code:
htpc_enable="YES"
htpc_manager_data_dir="/opt/HTPCManager"


Stop and restart the jail from the GUI and the new htpc-manager should be available at the ip address assigned to the jail on port 8085. You can also start it manually as the tutorial shows. The hellolol version has a self updater feature so from there you should be good. No storage is needed since you do everything from the web page. Wrote this up from memory so if you run into problems yell.
you could just run a few commands to change the source that the plugin uses. I can guarantee my the init script I wrote is more reliable with freebsd then the one you used =P
 

Jeff Lamer

Contributor
Joined
Nov 17, 2015
Messages
121
you could just run a few commands to change the source that the plugin uses. I can guarantee my the init script I wrote is more reliable with freebsd then the one you used =P
Hi Joshua,
Could you please expand your comment as I was about to follow this guide tonight. Everything done to date on my server is based on your guides :).
Jeff
 

Rudi Pittman

Contributor
Joined
Dec 22, 2015
Messages
161
you could just run a few commands to change the source that the plugin uses. I can guarantee my the init script I wrote is more reliable with freebsd then the one you used =P

I tried going into the existing htpc_manager and changing the source but the server did not come up...I changed both the share folder and the tar.gz the update checker uses. I did what worked for me and passed it on since no one else had volunteered a method. I would be concerned about whether the update checker would continue to perform correctly since the master it uses would also have to change.


I'm always interested in learning a new method...I installed aria2 and it's two webui's (yaaw and aria webui) into a jail and would eventually like to pass it on as it makes a convenient file downloader that can be accessed from my phone for both regular files and torrents of linux iso's...android rom's etc.
 

Joshua Parker Ruehlig

Hall of Famer
Joined
Dec 5, 2011
Messages
5,949

Joshua Parker Ruehlig

Hall of Famer
Joined
Dec 5, 2011
Messages
5,949

Jeff Lamer

Contributor
Joined
Nov 17, 2015
Messages
121

Joshua Parker Ruehlig

Hall of Famer
Joined
Dec 5, 2011
Messages
5,949
Ok, I pushed an updated PBI to the FreeNAS repo that uses the Hellowlol fork.
I don't think a straight upgrade from the previous version will work, but you should be able to copy over your /var/db/htpc-manager to a freshly installed instance of the plugin.
 

Rudi Pittman

Contributor
Joined
Dec 22, 2015
Messages
161
Ok, I pushed an updated PBI to the FreeNAS repo that uses the Hellowlol fork.
I don't think a straight upgrade from the previous version will work, but you should be able to copy over your /var/db/htpc-manager to a freshly installed instance of the plugin.


Can you share what files need to be backed up to save the config when switching from a custom jail to your plugin? I saw your comment about /var/db but wasn't sure if that was the only area needed. Additionally all my info is stored under /opt/HTPCManager so unsure if the corresponding folder would be the userdata?
 
Last edited:

Joshua Parker Ruehlig

Hall of Famer
Joined
Dec 5, 2011
Messages
5,949
Can you share what files need to be backed up to save the config when switching from a custom jail to your plugin? I saw your comment about /var/db but wasn't sure if that was the only area needed.
/var/db/htpc-manager is the only folder you'd need to save from my plugin. I'm not sure how your custom install is setup, but everything (config/database/etc..) would go there.
 

Rudi Pittman

Contributor
Joined
Dec 22, 2015
Messages
161
/var/db/htpc-manager is the only folder you'd need to save from my plugin. I'm not sure how your custom install is setup, but everything (config/database/etc..) would go there.

I REALLY don't want to have to re-do all the config's and associated api keys so hopefully you'll be patient with me. ;)

My /opt/HTPCManager dir has:

.git Htpc.py VERSION.txt interfaces requirements.txt
.gitignore LICENSE htpc libs userdata
HTPC-Manager.bat README.md initscripts modules

userdata has:
database.db htpcmanager.log htpcmanager.log.old images scripts

Is a fresh start a foregone conclusion?
 

Joshua Parker Ruehlig

Hall of Famer
Joined
Dec 5, 2011
Messages
5,949
I REALLY don't want to have to re-do all the config's and associated api keys so hopefully you'll be patient with me. ;)

My /opt/HTPCManager dir has:

.git Htpc.py VERSION.txt interfaces requirements.txt
.gitignore LICENSE htpc libs userdata
HTPC-Manager.bat README.md initscripts modules

userdata has:
database.db htpcmanager.log htpcmanager.log.old images scripts

Is a fresh start a foregone conclusion?
I think the userdata folder is the one you'd need to save. do you have a link to the init script are you using to start it?
 

Rudi Pittman

Contributor
Joined
Dec 22, 2015
Messages
161
I think the userdata folder is the one you'd need to save. do you have a link to the init script are you using to start it?

The one used is as follows(/usr/local/htpcmanager is mentioned but doesn't exist.):

Code:
#!/bin/sh
#
# PROVIDE: htpc-manager
# REQUIRE: LOGIN
# KEYWORD: shutdown
#
# Add the following lines to /etc/rc.conf.local or /etc/rc.conf
# to enable this service:
#
# htpc_enable (bool):  Set to NO by default.
#  Set it to YES to enable it.
# htpc_manager_user:  The user account htpc-manager daemon runs as what
#  you want it to be. It uses 'media' user by
#  default. Do not sets it as empty or it will run
#  as root.
# htpc_manager_data_dir:  Directory where htpc-manager configuration
#  data is stored.
#  Default: /usr/local/htpc-manager

. /etc/rc.subr
name="htpc"
rcvar="${name}_enable"
load_rc_config ${name}

: ${htpc_manager_enable:="NO"}
: ${htpc_manager_user:="root"}
: ${htpc_manager_group:="wheel"}
: ${htpc_manager_data_dir:="/usr/local/HTPC-Manager"}

pidfile="/var/run/htpc-manager.pid"
command="/usr/local/bin/python"
command_args="${htpc_manager_data_dir}/Htpc.py --daemon --pid ${pidfile}"

start_precmd="htpc-manager_prestart"
htpc-manager_prestart() {
  if [ ! -d ${pidfile%/*} ]; then
  install -d -o ${htpc_manager_user} -g ${htpc_manager_group} ${pidfile%/*}
  fi

  if [ ! -d ${htpc_manager_data_dir} ]; then
  install -d -o ${htpc_manager_user} -g ${htpc_manager_group} ${htpc_manager_data_dir}
  fi
}

run_rc_command "$1"


The /etc/rc.conf sets these:

htpc_enable="YES"
htpc_manager_data_dir="/opt/HTPCManager"
 

Joshua Parker Ruehlig

Hall of Famer
Joined
Dec 5, 2011
Messages
5,949
The one used is as follows(/usr/local/htpcmanager is mentioned but doesn't exist.):

Code:
#!/bin/sh
#
# PROVIDE: htpc-manager
# REQUIRE: LOGIN
# KEYWORD: shutdown
#
# Add the following lines to /etc/rc.conf.local or /etc/rc.conf
# to enable this service:
#
# htpc_enable (bool):  Set to NO by default.
#  Set it to YES to enable it.
# htpc_manager_user:  The user account htpc-manager daemon runs as what
#  you want it to be. It uses 'media' user by
#  default. Do not sets it as empty or it will run
#  as root.
# htpc_manager_data_dir:  Directory where htpc-manager configuration
#  data is stored.
#  Default: /usr/local/htpc-manager

. /etc/rc.subr
name="htpc"
rcvar="${name}_enable"
load_rc_config ${name}

: ${htpc_manager_enable:="NO"}
: ${htpc_manager_user:="root"}
: ${htpc_manager_group:="wheel"}
: ${htpc_manager_data_dir:="/usr/local/HTPC-Manager"}

pidfile="/var/run/htpc-manager.pid"
command="/usr/local/bin/python"
command_args="${htpc_manager_data_dir}/Htpc.py --daemon --pid ${pidfile}"

start_precmd="htpc-manager_prestart"
htpc-manager_prestart() {
  if [ ! -d ${pidfile%/*} ]; then
  install -d -o ${htpc_manager_user} -g ${htpc_manager_group} ${pidfile%/*}
  fi

  if [ ! -d ${htpc_manager_data_dir} ]; then
  install -d -o ${htpc_manager_user} -g ${htpc_manager_group} ${htpc_manager_data_dir}
  fi
}

run_rc_command "$1"


The /etc/rc.conf sets these:

htpc_enable="YES"
htpc_manager_data_dir="/opt/HTPCManager"
that script doesn't actaully pass the data-directory setting to htpc-manager so I can't tell. there's probably a status screen somewhere in htpc-manager that shows what the data-directory is.

whoever wrote that made mistakes. it looks like they took what I have on my github then modified it, but made several mistakes.
 

Joshua Parker Ruehlig

Hall of Famer
Joined
Dec 5, 2011
Messages
5,949
The script and instruction document in question came from the hellolol git. The data dir is overrided in /etc/rc.conf as shown and set to "/opt/HTPCManager" which still leaves me wondering what to copy....I could copy the entire dir but still unsure where to put the pieces.

https://github.com/Hellowlol/HTPC-M...PC-Manager-FreeNAS-Plugin-to-Hellowlol's-Fork
those instructions are for switching over from the freenas plugin to that repo. where is the script you posted from? I couldn't find it on that page.
 
Top