Can you help me install Huginn

Christopher Ward

Contributor
Joined
May 14, 2015
Messages
104
Can anyone help me with the installation of Huginn? The instructions are not valid for FreeNAS.

I don't mind donating a few $$ to anyone who can help me get it setup.

 

Jailer

Not strong, but bad
Joined
Sep 12, 2014
Messages
4,977
Your best bet is likely going to be to set up a Linux VM and install the docker image.
 

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,504
A look at the docs suggests it should be do-able on any Unix-y OS, but I haven't seen any FreeBSD-specific documentation. Have you tried it? Follow their instructions, but substitute pkg install for apt install. If pkg can't find the package name, a quick Google search will likely find the correct substitute.

But the easiest answer is likely as Jailer said--set up a Linux VM with your distro of choice, and install the Docker image.
 

sretalla

Powered by Neutrality
Moderator
Joined
Jan 1, 2016
Messages
9,700
Here's what I did:

Make a new jail:
echo '{"pkgs":["git","ca_root_nss","python2","mysql80-server","ruby","rbv","rbenv","ruby26-gems","rubygem-rake","rubygem-bundler","rubygem-foreman","gmake"]}' > /tmp/pkg.json
iocage create -n "huginn" -p /tmp/pkg.json -r 11.3-RELEASE defaultrouter="<GATEWAY>" dhcp="on" vnet="on" allow_raw_sockets="1" boot="on"
rm /tmp/pkg.json

git clone the repository in the jail (we'll do all this at the jail console, so console first):
iocage console huginn
cd /usr/local
git clone git://github.com/cantino/huginn.git


Install the rubygems tools as suggested in the install document:



Make sure to copy the .env.example to .env and change it to match your configuration (at least updating the APP_SECRET_TOKEN variable).
cd huginn
cp .env.example .env
ee .env
Make your edits (esc and enter to save)

Install the gem rake and bundler tools:
gem install rake bundler

Edit the Gemfile to remove the Javascript agent component mini-racer (this has a dependency on the libv8 module which can't compile onFreeBSD, so unless that get solved, no Javascript agents).
ee Gemfile

put # at the beginning of the line gem 'mini_racer', '~> 0.2.4' # JavaScriptAgent


Run the dependency bundle:
bundle


Start the mySQL server
sysrc mysql_enable=YES
service mysql-server start

Run the following to set up the DB and sample items
bundle exec rake db:create
bundle exec rake db:migrate
bundle exec rake db:seed

Run the following to start the Huginn server
bundle exec foreman start &

visit http://localhost:3000/ and login with the username of admin and the password of password (replace localhost with your jail's IP).

Setup some Agents!

This doesn't daemonize the huginn service, so you will need to repeat the foreman start at each start of the jail... if somebody wants to contribute with the rc.d script for that it would mean you could automate the start together with the start of the jail and log to a file rather than console.

Note: By default, email messages are intercepted in the development Rails environment, which is what you just setup. You can view them at http://localhost:3000/letter_opener. If you'd like to send real email via SMTP when playing with Huginn locally, set SEND_EMAIL_IN_DEVELOPMENT to true in your .env file.


Periodically run these commands to merge in the newest version of Huginn:
iocage console huginn
cd /usr/local/huginn
git fetch upstream
git checkout master && git merge upstream/master


EDIT: updated the pkg list with rubygem-foreman
 
Last edited:

sretalla

Powered by Neutrality
Moderator
Joined
Jan 1, 2016
Messages
9,700
Thanks to a suggestion from @Patrick M. Hausen in another thread, I think I'll try to run it using supervisord.

Will update after some testing.
 
Joined
Jul 10, 2016
Messages
521
I haven't seem Patrick's note, but I was trying out your instructions the other day. While foreman is installed as a dependency via the Gemfile, the recommendation is to install it globally so I would add rubygem-foreman to the pkg list. The nice thing is that foreman provides an option to convert ("export") the Procfile.CF to other init-formats, including the supervisord conf files. No rc.d option, unfortunately. :(

Source: http://ddollar.github.io/foreman/
 
Top