I would like to try using Huginn - a rails app that acts as a self-hosted “if this than that” app.
So far it seems like there are two options:
I tried the Docker approach and ran into issues where a server reboot caused complete data-loss. Has anyone manually installed huginn on a DigitalOcean droplet?
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
thank you .
Answering my own question…
Here’s what ended up working. This is heavily reliant on the manual install guide, just customized to be easier on a 1GB DigitalOcean droplet.
user-scripts shortcut:
I bundled as much of Huginn’s dependencies into a cloud-config script that you can add when spinning up the droplet, just paste this into the User-Script section of the droplet create form:
users block: Creates a user huginn with sudo access, add your public key if you’d like to SSH in as huginn instead of root.
runcmd block: apt-get updates and upgrades your server, installs as many of the Huginn dependencies as possible in one go. We need Ruby 2.2.3, so we bypass the standard apt-get process and download, compile and install ruby directly from source. Finally bundler and foreman are installed via gem install.
All this is going to take a while, so I end the script with a neat little hack to send me a text message when it’s done! Replace
YOURPHONENUMBERHERE
with your phone #.Finish install
Once you get the text, SSH in as root and wrap up the install with the following commands:
Database
Follow mySQL prompts to set password, then follow the prompts to lock down the install by running
mysql_secure_installation
. Login to mySQL with the password you just set and create the userhuginn
with a unique password.Clone huginn source from github
This differs slightly from the manual install guide, I planned on making some of my own changes to huginn, so I forked it on github and then cloned my fork instead of cloning the master.
Configure Huginn in .env and config/unicorn.rb files
Open the .env config file in default editor
Change, the secret token, set the mysql specs we just defined, set env=production:
I also edited config/unicorn.rb to only run one worker_process, which is recommended when your server has less than 2GB RAM.
then edit the worker_processes to 1
Install Gems to run huginn in production mode
Initialize Database
Compile Assets / Install Init / Logrotate
in the Procfile, comment out the
web:
andjobs:
lines in the development section, and uncomment them in the production section. Then export and setup logrotate:Configure nginx This assumes huginn is the only web app running on the server, copy the nginx config to
/etc/nginx/sites-enabled
directory and remove the default config:If you have a domain pointing to this droplet, specify it on the
server_name
line of the nginx config:Finally test the new nginx config and restart if it passes:
DONE! Now you can go to your domain or IP address and login with credentials:
admin
andpassword
and start using huginn!If someone can figure out how to bundle everything into a cloud-init script that would be amazing.