Firefly III in a TrueNAS jail

Firefly III in a TrueNAS jail 11.2-U6

zamana

Contributor
Joined
Jun 4, 2017
Messages
163
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

Hall of Famer
Joined
Aug 16, 2011
Messages
15,462
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

Contributor
Joined
Jun 4, 2017
Messages
163
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

Hall of Famer
Joined
Aug 16, 2011
Messages
15,462
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

Contributor
Joined
Jun 4, 2017
Messages
163
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

Hall of Famer
Joined
Aug 16, 2011
Messages
15,462
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

Contributor
Joined
Jun 4, 2017
Messages
163
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

Hall of Famer
Joined
Aug 16, 2011
Messages
15,462
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

Contributor
Joined
Jun 4, 2017
Messages
163
Hi!

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

RSVP

Explorer
Joined
Feb 11, 2016
Messages
73
Hi Zamana
This looked really good from what I saw on Github. I am not sure if it is up to date after the freenas 11.3 update. I like the work , and very much interested in guides not using caddy. My router does all the tsl termination so not keen on anything performing this after that. Do you happen to have any updated info on this? I am surprised it didn't get much more attention.. Thanks for your work.
 

zamana

Contributor
Joined
Jun 4, 2017
Messages
163
Hi!

Thanks for the kindly message.

In fact I stopped using Firefly III a few weeks after had installed. I realized that its features didn't fit my needs, and some replies from the developer to some feature requests from other people showed that he wasn't willing to implement what he considers uninteresting for him.

Anyway, I'm pretty sure that the instructions are identical for FreeNAS 11.3-Ux. The base FreeBSD version was updated, but this doesn't affect the general guidelines. Maybe a new version of PHP at most.

Try to install and let us know what happened.

By the way, I will publish a guide regarding how to install Filerun in FreeBSD/FreeNAS jail, but this time using Caddy as web server (Caddy is sooooo much easy...)

Regards.
 

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,462
My router does all the tsl termination so not keen on anything performing this after that.
Caddy will happily run HTTP-only; you just need to tell it to do so.
 

RSVP

Explorer
Joined
Feb 11, 2016
Messages
73
Hi,
Caddy looks really good. I know that your really behind it all the way. But After several days of trying to run the nextcloud script, I dont see how to overcome this problem. Even when you go no cert. Once you stop forwading to that jail and forward to the reverse proxy, you cant access the gui. So I am not sure how to run conccurent with establish TSL termination at Haproxy with Caddy. I havent learned enough about it to pinpoint what the issue is. But I lean towards resolving with a domain name and not an ip. I wish I could run your scripts and have it work after I turn on haproxy and have backend point to the jail. Maybe yuo have the answer? I don't think I am the only person who has this problem. But I know probably the minority. Appreciate the work.... Both of these projects are ones I am interested in and both of them your involved. So not that keen on firefly?
 

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,462
not that keen on firefly?
My feelings on it, I think, are similar to those of @zamana. It's a slick web app, and it's great that he's managed to come up with a way to import transactions from your bank with a open-source app, but he has his own peculiar ideas about how the software should be used, and they aren't very consistent with how I'd want to use it.
 

RSVP

Explorer
Joined
Feb 11, 2016
Messages
73
If I have time over the weekend will try to to do the non caddy intall, and update this thread. At this point Caddy be its own sub forum. You all should be on their payroll , as your great marketing for it and a lot of good work. Unfortuneatly, It is a no go, deal breaker for me, as I handle these functions in my pfsense and not in a jail on FN. And unfortuneatly do not have the time resources to figure out how to make those two work together as they just don't the way these guides are written. pfsense is just too awesome to forgo.
 

SteelWolf

Dabbler
Joined
Jan 15, 2012
Messages
14
I still have some reservations about Caddy, namely that the 1.04 version we've been using here is supposedly going away along with all the documentation in favor of Caddy 2.0, which is a completely rebuilt application.
 

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,462
Yes, Caddy 2 is apparently on the way, and the Caddyfile syntax will be incompatible with 1.x and earlier for what I'll assume are good reasons (though I don't know that it really matters). And? It doesn't mean that 1.0.4 will stop working right away (or at any particular time). I'd expect (and hope) that 1.0.4 would remain available for quite some time. But once Caddy 2 is packaged or otherwise readily available, I'd start using that and update the Caddyfile--it's really pretty trivial for this application (for Nextcloud, not so much).
 

ngalfas

Dabbler
Joined
Jul 19, 2020
Messages
17
After the jail upgrade from 11.3 -> 12.1 i can get no page to display. Something to do with caddy i suspect.

pkg[17377]: caddy upgraded: 1.0.4 -> 2.2.0

I have to see if caddyfile has to be changed because of caddy v2
 

zamana

Contributor
Joined
Jun 4, 2017
Messages
163
Hi!

I don't have Firefly III installed anymore, so I can't help too much.

My suggestions:

1) to debug what's going on at the server level, try to enable (if not already...) the logs and follow the web server error log file.

2) to debug the UI, try to enable the "Developer Tool" feature of your browser

Another possibility is to replace Caddy for another web server temporarily (or definitely... who knows...) so you can filter the culprit.
 

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,462
I have to see if caddyfile has to be changed because of caddy v2
It will need changes. I thought the new Caddy package was going to be labeled caddy2, to avoid exactly this sort of problem. Apparently not.
 
Top