Register for the iXsystems Community to get an ad-free experience and exclusive discounts in our eBay Store.
Resource icon

Firefly III in a FreeNAS jail 11.2-U6

zamana

Newbie
Joined
Jun 4, 2017
Messages
80
zamana submitted a new resource:

Firefly III in a FreeNAS jail - Guide to install and configure Firefly III in a FreeNAS jail

I was able to Install Firefly III in a FreeBSD environment (it is a FreeNAS jail, actually, but it doesn't matter) by following the general instructions in the Firefly III documentation.

Unfortunately I didn't take notes of the whole process, step by step, as I actually do it, but I guess that this general guidelines will lead you in the right path.
Read more about this resource...
 

danb35

FreeNAS Wizard
Joined
Aug 16, 2011
Messages
10,582
Well, they're a start. That was inappropriate--it looks like an interesting project, and the gist got me a lot farther, more quickly, than I would have on my own. Thanks for the pointer, and for the head start on getting this running.

A few things I've run into so far need fixing: The sudo -u www method for running composer doesn't work; it just gives a permission denied error (this might be avoided if ownership of /usr/local/www were changed to www:www beforehand; I haven't checked yet). The service commands are backward; they should look like service mysql-server start. And a bunch of typos in the fastcgi_param line in nginx.conf--the corrected file should read:
Code:
load_module /usr/local/libexec/nginx/ngx_mail_module.so;
load_module /usr/local/libexec/nginx/ngx_stream_module.so;

user  www;

worker_processes  2;

events  {
        worker_connections  1024;
}

http {
        include            mime.types;
        default_type       application/octet-stream;
        sendfile           on;
        keepalive_timeout  65;

        server  {
                listen       80;
                server_name  firefly.local;
                root         /usr/local/www/firefly-iii/public;
                index        index.php;

                location / {
                        try_files $uri $uri/ /index.php?$query_string;
                        autoindex on;
                        sendfile off;
                }

                location ~ \.php$ {
                        fastcgi_pass   127.0.0.1:9000;
                        fastcgi_split_path_info ^(.+\.php)(/.+)$;
                        fastcgi_index  index.php;
                        include        fastcgi_params;
                        fastcgi_param  SCRIPT_FILENAME $document_root$fastcgi_script_name;
                }
        }
}


But even so, I'm getting this when I browse to the jail:
1570998671349.png

More to follow.

Edit: these commands need to be run before browsing to the jail:
Code:
php artisan migrate:refresh --seed
php artisan firefly-iii:upgrade-database
php artisan passport:install

After running them and browsing to the jail's IP address, I now get this:
1571016774765.png

Looks like a successful installation.
 
Last edited:

zamana

Newbie
Joined
Jun 4, 2017
Messages
80
Hello danb35.

I did really appreciate your feedback and all the mistakes you pointed out. All of them are fixed in the guide right now.

1) The command "chown -R www:www /usr/local/www" was added;

2) The "service" command syntax was fixed (and the name of the mysql-server service too);

3) Nginx: all those "*" must had come from the markdown editor I used; fixed now;

4) Database initialisation (php artisan...): added to the guide.

I took the freedom to link to your profile in the guide as a form to acknowledge your contribution. I hope you don't mind.

Thanks.
Regards.
 

danb35

FreeNAS Wizard
Joined
Aug 16, 2011
Messages
10,582
Thanks for the updates, and no, I don't mind at all (though it isn't at all necessary). But this has me thinking of writing up my own guide for this system, using a somewhat different strategy (using Caddy for the web server, MariaDB for the database, and likely other differences)--options are often a good thing. I'm fond of Caddy for its relatively simple configuration syntax, and for its integration of Let's Encrypt, and Firefly III seems to run well behind it.
 

zamana

Newbie
Joined
Jun 4, 2017
Messages
80
That would be nice!

If you actually write your own guide, get in contact with the Firefly's developer. He is a nice guy, very accessible, and certainly will welcome your work.
 

danb35

FreeNAS Wizard
Joined
Aug 16, 2011
Messages
10,582
Here's the guide I just wrote: https://forum.freenas-community.org/t/firefly-iii-personal-finance-manager-in-a-jail/45

When I mention Caddy's simple configuration syntax, take a look at the Caddyfile examples there--ignoring whitespace, the Caddyfile for a HTTP-only installation is only ten lines long. If I weren't using the Let's Encrypt staging server in my examples, the basic HTTPS Caddyfile wouldn't be any longer, and would automatically set secure ciphers and protocols, redirect HTTP->HTTPS, and obtain and renew certs (what I have there now does all of that too, but it's a few lines longer just to tell Caddy to use the Let's Encrypt staging server). I'm coming to like it a lot; it's quickly becoming my go-to choice of web server for jails (as you'll see in a couple of my resources).
 

zamana

Newbie
Joined
Jun 4, 2017
Messages
80
Very nice guide (and much better written than mine... ;-)). Congratulations!

Regarding Caddy, I didn't know it, but I like this "minimalist" approach. Just as a side example, before migrating my server to FreeBSD/NAS, I used to use Alpine Linux for my LXC containers. Alpine is a very lightweight Linux "distro" for this kind of applications. It has the smallest footprint I ever saw.

Regards.
 
Last edited:

danb35

FreeNAS Wizard
Joined
Aug 16, 2011
Messages
10,582
I switched my Nextcloud script to use Caddy a few months back; I'm also using Caddy as a reverse proxy--both of these are documented in other resources. The Caddyfile for Nextcloud is a good bit more involved, but still much shorter than Apache's httpd.conf file was to do the same thing (and I don't need to do anything at all to handle the certs, renewal, etc.). I'd heard of Alpine Linux, but haven't worked with it as yet--most of my Linux is either CentOS or Ubuntu.
 

zamana

Newbie
Joined
Jun 4, 2017
Messages
80
Hi!

Your guide is now linked from the Firefly III official documentation.
 
Top