How to install PhotoPrism in Jail?

dimitrow

Dabbler
Joined
Mar 15, 2020
Messages
17
Hello everyone,

68747470733a2f2f646c2e70686f746f707269736d2e6f72672f6173736574732f696d672f707265766965772e6a7067


PhotoPrism is a server-based application for browsing, organizing and sharing photo collection.

As the title suggests, I want to install a PhotoPrism in a jail. Has anyone successfully coped with this task and how did he achieve it?

Thanks in advance!
 

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,456
Based on a quick look at the docs, the only support installation method is using Docker, which won't work in a jail--you'd need to set up a Linux VM instead and go from there.
 

sretalla

Powered by Neutrality
Moderator
Joined
Jan 1, 2016
Messages
9,702
Based on a quick look at the docs, the only support installation method is using Docker, which won't work in a jail--you'd need to set up a Linux VM instead and go from there.
Although that's completely true, the github site contains all the information you would need to try to make it run in a jail... Mariadb 10.5, go, caddy... seems like it might be doable if somebody wants to spend their time working it out... but as mentioned, it would then be an unsupported install and would need re-work every time a change was made by the developers and potentially some blocking changes would happen that they wouldn't consider due to no support for jails... Better to just do docker.
 

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,456
I've always disliked this remark.
Sounds like a personal problem. @sretalla and I have both given sound technical reasons why implementation in a jail would seem to be impractical. If you really want it, nothing's stopping you from trying to make it work, but I really wouldn't expect iX or any of the other plugin packagers (whoever those are) to touch it. I could always be wrong, of course.
 

ninjai

Explorer
Joined
Apr 6, 2015
Messages
98
Sounds like a personal problem? lol. So what I'm getting out of this is if I'm a professional chef and my power is out and I'm not a lineman capable of fixing the power outage, it's my personal problem the power is out?

I was never implying that. All I said is it would be a nice addition, and hopefully one day. I'm not really sure how that caused what I'm perceiving as an aggressive response. I've always believed it's comments like that that give people the impression *nix is for developers and a direct reason many are turned off of *nix in the first place.

In any event, I guess this isn't the place for feedback or conversation around FreeBSD.
 

sretalla

Powered by Neutrality
Moderator
Joined
Jan 1, 2016
Messages
9,702
So what I'm getting out of this is if I'm a professional chef and my power is out and I'm not a lineman capable of fixing the power outage, it's my personal problem the power is out?
No, you have 4 choices... pay a lineman to do it, wait for somebody else to pay a lineman to do it (or that one will elect to do it for free on his own), learn how to do it yourself and do it (a great opportunity if you want that, but potentially a significant investment), or learn to live without power from the grid and get some solar panels (equivalent of docker in this case).

All of those options are valid, we were just hinting towards options 3 and 4.
 

ninjai

Explorer
Joined
Apr 6, 2015
Messages
98
Yes, but my whole point is I come in here saying wow this would be cool if this was implemented, then I get a patronizing comment to do it myself. Not very friendly but I can take a hint. This isn't even my thread, I just thought the topic was interesting.

Per your example, it would be if I came here saying "wow, electricity is neat, that would be pretty cool if someone brought that here one day". Nowhere did I make any kind of demands of any sort, just trying to encourage conversation around a topic. In turn, welcomed with a patronizing attitude. The lack of kindness here is shocking and really hampers healthy conversation.

I'm going to unfollow this thread now, obviously nothing good coming out here.
 

sretalla

Powered by Neutrality
Moderator
Joined
Jan 1, 2016
Messages
9,702
a patronizing comment
If you changed the perception to say "an encouraging comment", the same exact words would be there in the post.
 

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,456
Yes, but my whole point is I come in here saying wow this would be cool if this was implemented
...after someone else had said the same thing a couple of weeks ago (starting this thread), two of us looked into it, and found issues that--IMO at least--make it impractical to run this software in a jail. So when you commented, it added nothing to the discussion, and it didn't give any indication that you'd paid any attention to the issues we'd raised. Yes, that was annoying, that was apparent in my response, and it doesn't much bother me that you didn't like that response.

There are a number of ways you could have "encourage[d] conversation around a topic":
  • You could have pointed to someone else's installation of this software on FreeBSD
  • You could have compared it to other web photo album software--if it stands head and shoulders above its dozens of competitors, maybe it would be worth trying to work through those noted technical issues
  • You could have shown that the apparent technical issues aren't, in fact, as significant as is believed
  • You could at least have acknowledged the issues
Simply repeating what's already been said, adding nothing to it, and ignoring the rest of the conversation, does none of these, and also "hampers healthy conversation."
 
Joined
Dec 11, 2018
Messages
8
Cool, you know what my favorite thing on the internet is? Trying to see if something is possible and the top forum post is a couple of 1000+ post members trashing on a newbie with my question. It's clear that new users are not wanted here, so I'll see myself out with the comment that a linux VM adds a totally nontrivial amount of overhead, and a jail is clearly the right way to implement something like photoprism.
 

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,456
a jail is clearly the right way to implement something like photoprism.
Clearly you know more about it than I or @sretalla, so knock yourself out--we both believe this to be impractical, and I think this thread (rather than what you falsely perceive as "trashing on a newbie with [your] question") explains the technical reasons we believe this to be the case. But it's clear you don't want an actual answer, you just want to be told that your preconceived answer is correct (regardless of how wrong it is).

You know what my favorite thing on the internet is? It's when people like you complain about the correct answers given in a thread, contributing nothing at all, because you don't like the tone in which they were given.
 

Ericloewe

Server Wrangler
Moderator
Joined
Feb 15, 2014
Messages
20,175
Let's be clear: packaging anything as a plugin or automated installer takes time and is likely to be volunteer work.

Drumming up interest in the thing or trying to get the work going are productive ways of encouraging others to work on it, but nobody is under any obligation to work on it.

<Moderator hat>
Telling someone that they can try to work on overcoming the technical challenges is well within the spirit of open-source. It's not an order, and if it's far outside your areas of expertise, nobody is going to think less of you for not accepting the challenge.

We'll try to keep this thread open in case someone wants to contribute code, analysis, a review of the software, etc.
</Moderator hat>
 

morganL

Captain Morgan
Administrator
Moderator
iXsystems
Joined
Mar 10, 2018
Messages
2,691
It's worth noting that there are many Docker container apps like Photoprism. If the developer or skilled volunteer does not want to support FreeBSD, they normally stay as a docker container.

TrueNAS now provides two choices for running these applications....
1) Run a linux VM which then runs docker and the app
2) Use TrueNAS SCALE (beta quality for single node) and run the container within Kubernetes.
 

gt2416

Patron
Joined
Feb 4, 2018
Messages
262

ChrisRJ

Wizard
Joined
Oct 23, 2020
Messages
1,906
Having gone, quite recently, through the decision process, of whether the successor to my old FreeNAS would be some Synology box or another FreeNAS system, here are a few thoughts.

The plethora of plugins for Synology (e.g. to manage photo collections) is truly appealing and was the main factor for me to consider it as an alternative to FreeNAS. But in the end I bit the bullet and decided that the flexibility of FreeNAS was more important to me. In my view the two systems address very different markets. And while some features of FreeNAS blur this, like the DynDNS client, the "typical Synology customer" will likely not be happy with FreeNAS and vice versa.

As to the resource consumption of running a Linux VM on FreeNAS with a Docker container inside, I would think that in many cases this is not truly an issue these days. Some people might consider this as arrogant, but my new FreeNAS runs on 8 years old hardware and the normal utilization is close to zero. And quick test setup should not be too difficult, if someone wants to test on their environment.

And finally, some of the discussions reminded me of my early days on BBSes and Usenet forums in the early 1990s :cool: . So thanks for the time travel (no irony here!).

Probably nothing really new here, but I was in the mood for it ;-)
 

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,456
You could try Lychee, it requires a few dependencies and a web server.
A few more than the "web-server with PHP 7.3 or later and a MySQL-Database" stated in the README, though... It does look like a nice gallery app, and they don't seem nearly as tied to the Docker image as PhotoPrism. Having a bit of trouble getting it running, though. I'm wanting to use Caddy for the webserver, mainly for its simplicity in configuration, but I'm getting blank pages. Here's what I've put together so far; I'm sure I'm missing something pretty obvious, but blanking on what it could be. These steps begin with the jail created (12.2-RELEASE, though I doubt the release matters that much), and in the jail console.
Code:
#
# Install packages
#

pkg install caddy php74 mariadb103-server php74-pdo_mysql php74-mysqli nano git php74-composer php74-exif php74-gd php74-fileinfo php74-dom php74-simplexml php74-bcmath php74-ctype php74-pecl-imagick php74-json php74-openssl php74-mbstring php74-pdo php74-tokenizer php74-xml php74-zip redis php74-pecl-redis

#
# Enable services
#

sysrc php_fpm_enable=YES
sysrc caddy_enable=YES
sysrc mysql_enable=YES
sysrc redis_enable=YES
service mysql-server start

#
# Create database
#

mysql
create database lychee;
grant all on lychee.* to lychee_user@localhost identified by 'lychee_password';
flush privileges;
quit

#
# Create Caddyfile
#

nano /usr/local/etc/caddy/Caddyfile

Complete file should read as below

*:80 {
        encode gzip
        log {
                output file /var/log/lychee_access.log
                format single_field common_log
        }
        root * /usr/local/www/Lychee/public
        file_server
        php_fastcgi 127.0.0.1:9000
}

#
# Install Lychee
#

mkdir -p /usr/local/www
cd /usr/local/www
git clone https://github.com/LycheeOrg/Lychee
cd Lychee
composer install --no-dev
cp .env.example .env

#
# Configuration
#

nano .env

Change the following settings, leave the rest alone

DB_CONNECTION=mysql
DB_HOST=localhost
DB_PORT=
DB_DATABASE=lychee
DB_USERNAME=lychee_user
DB_PASSWORD=lychee_password
DB_LOG_SQL=false

php artisan key:generate

#
# Start services
#

service redis start
service php-fpm start
service caddy start
 

gt2416

Patron
Joined
Feb 4, 2018
Messages
262
"Few Requirements" was definitely understated haha
I remember I tried Caddy first and got a blank page as well @danb35.
I think that has something to do with the php rewrites. According to the docs the apache file is very basic, all the php rewrites are handled by .htaccess file, maybe caddy is not respecting this ?
My apache file on my working jail is:

<VirtualHost *:80>
DocumentRoot "/usr/local/www/apache24/data/lychee/"
ServerName 192.165.49.72

<Directory /usr/local/www/apache24/data/lychee/>
Options +FollowSymlinks
AllowOverride All

<IfModule mod_dav.c>
Dav off
</IfModule>

</Directory>
</VirtualHost>

And in this file /usr/local/etc/apache24/httpd.conf I modified the <Directory> section to this(:

<Directory /usr/local/www/apache24/data/lychee>
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
</Directory>

This is important, Without this I was getting 404 errors. I don't know how this translates to Caddy
I will try to make a more in depth tutorial, right now I'm just trying to recreate the steps I did to get it to work.

These are the packages I installed:
pkg install nano git php74-exif php74-gd php74-json php74-mbstring php74-mysqli php74-pdo php74-pdo_mysql php74-pecl-imagick-im7 php74-session apache24 mod_php74 php74-composer php74-simplexml php74-fileinfo php74-dom php74-tokenizer php74-zip redis php74-pecl-redis
 
Last edited:
Top