How to install PhotoPrism in Jail?

Daisuke

Contributor
Joined
Jun 23, 2011
Messages
1,041
The py-tensorflow port is marked as "BROKEN"
Where did you see the broken info? I'm learning, thanks. Edit: Saw your replies into ticket, it would be great if you can get tensorflow working. Looking at this bug report, people are complaining about interactive questions. make has the option to respond to interactive options with default values, so this should not be a problem? I say this, based on previous Linux experiences, we are in a different OS.
 
Last edited:

gt2416

Patron
Joined
Feb 4, 2018
Messages
262
I managed to install Photoprism using the pre built package and some dependencies. (No need to wait hours for it to build, yay)

In the jail do make sure your on the latest pkg branch in /etc/pkg/FreeBSD.conf

pkg update pkg install ffmpeg openjdk p5-Image-ExifTool py38-tensorflow

fetch https://github.com/psa/photoprism-freebsd-port/releases/download/2021-05-23/photoprism-g20210523-FreeBSD-12.2-noAVX.txz pkg add photoprism-g20210523-FreeBSD-12.2-noAVX.txz

Its installed, to configure add these lines to /etc/rc.conf

Code:
photoprism_enable="YES"
photoprism_assetspath="/var/db/photoprism/assets"
photoprism_storagepath="/var/db/photoprism/storage"
#photoprism_logfilename="/var/log/prism.log"
photoprism_originalspath="/var/db/photoprism/storage/originals"
photoprism_importpath="/var/db/photoprism/storage/import"


Then set the initial password with this command

Code:
photoprism --assets-path=/var/db/photoprism/assets --storage-path=/var/db/photoprism/storage --originals-path=/var/db/photoprism/storage/originals --import-path=/var/db/photoprism/storage/import passwd


And run photoprism with this command:

Code:
photoprism --assets-path=/var/db/photoprism/assets --storage-path=/var/db/photoprism/storage --originals-path=/var/db/photoprism/storage/originals --import-path=/var/db/photoprism/storage/import --log-filename /var/log/prism.log start


Done.

For some reason starting photoprism with service photoprism start does not work, the rc file looks like it imports all the flags properly so idk. Till someone can help with that we need to use the command above to start it.
Photoprism seems like an ALMOST perfect google photos replacement, its got a really nice UI and Object detection which is really good and hard to find in other self hosted projects BUT its missing a huge feature for me which makes it unusable, no multi user support.
I've been toying with piwigo and its UI is ok, not object detection but has multi user support so, guess ill stick with it. Also Piwigo has some weird bugs when running behind caddy, had to use apache for it which takes a lot longer to setup.
Anyone else have thoughts on google photo self hosted replacements ?
 

Patrick M. Hausen

Hall of Famer
Joined
Nov 25, 2013
Messages
7,776
Anyone else have thoughts on google photo self hosted replacements?
I never used google photo but I am very frustrated with the development of Apple's photo apps. iPhoto was just perfect for me. It had this concept of "events". Import photos and it will group them by date into events. You can merge or split them as you like - very conveniently. And you can of course name them and sort them into folders, e.g. per year. One photo is always in precisely one event.

Anyone know an app that does that? Now with Fotos instead of iPhoto all is just one continuous timeline, face detection, automatic whatever - I don't want any of that. I sort my photos as I see fit. Period. I am seeking an app that emulates a shelf full of boxes full of slides as much as possible. You label the box "Summer vacation 2018" and that's that. That's an event in iPhoto.

Just using albums in Fotos instead of events doesn't work. There is no way to tell if a particular photo is in more than one or in no album at all.

Do you think I would like Piwigo?

Thanks!
Patrick
 

gt2416

Patron
Joined
Feb 4, 2018
Messages
262
Do you think I would like Piwigo?

It doesn't have many smart features but since you said you like to sort your Photos by yourself I think you may like it. You can use tags as in place of events to group / sort photos. Its more traditional like iPhotos with simple albums and tags and would solve that issue where you don't know if a photo is in multiple albums.

I personally don't need any smart features either but my mom, my god she has like 17k photos from 3 years and 90% of them are garbage stuff from work. Without some smart features, going through her photos is basically just a pile of work information (or gruesome pictures of patients wounds and stuff, yuuck) and no way does she have time to sort anything manually.
 

bigjay517

Dabbler
Joined
Jan 14, 2015
Messages
14
I managed to install Photoprism using the pre built package and some dependencies. (No need to wait hours for it to build, yay)

In the jail do make sure your on the latest pkg branch in /etc/pkg/FreeBSD.conf

pkg update pkg install ffmpeg openjdk p5-Image-ExifTool py38-tensorflow

fetch https://github.com/psa/photoprism-freebsd-port/releases/download/2021-05-23/photoprism-g20210523-FreeBSD-12.2-noAVX.txz pkg add photoprism-g20210523-FreeBSD-12.2-noAVX.txz

Its installed, to configure add these lines to /etc/rc.conf

Code:
photoprism_enable="YES"
photoprism_assetspath="/var/db/photoprism/assets"
photoprism_storagepath="/var/db/photoprism/storage"
#photoprism_logfilename="/var/log/prism.log"
photoprism_originalspath="/var/db/photoprism/storage/originals"
photoprism_importpath="/var/db/photoprism/storage/import"


Then set the initial password with this command

Code:
photoprism --assets-path=/var/db/photoprism/assets --storage-path=/var/db/photoprism/storage --originals-path=/var/db/photoprism/storage/originals --import-path=/var/db/photoprism/storage/import passwd


And run photoprism with this command:

Code:
photoprism --assets-path=/var/db/photoprism/assets --storage-path=/var/db/photoprism/storage --originals-path=/var/db/photoprism/storage/originals --import-path=/var/db/photoprism/storage/import --log-filename /var/log/prism.log start


Done.

For some reason starting photoprism with service photoprism start does not work, the rc file looks like it imports all the flags properly so idk. Till someone can help with that we need to use the command above to start it.
Photoprism seems like an ALMOST perfect google photos replacement, its got a really nice UI and Object detection which is really good and hard to find in other self hosted projects BUT its missing a huge feature for me which makes it unusable, no multi user support.
I've been toying with piwigo and its UI is ok, not object detection but has multi user support so, guess ill stick with it. Also Piwigo has some weird bugs when running behind caddy, had to use apache for it which takes a lot longer to setup.
Anyone else have thoughts on google photo self hosted replacements ?

Did you create a photoprism user and group? I had the same problem then realized that the rc.d/photoprism was trying to start with a user named 'photoprism'.
 
Last edited:

gt2416

Patron
Joined
Feb 4, 2018
Messages
262
Did you create a photoprism user and group? I had the same problem then realized that the rc.d/photoprism was trying to start with a user named 'photo \prism'.
Thanks !
I missed that when I was looking at the RC script. I changed the user to root and it works fine. (Root cause I’m just testing it )
 
Joined
Aug 25, 2021
Messages
1
Thanks !
I missed that when I was looking at the RC script. I changed the user to root and it works fine. (Root cause I’m just testing it )
Not clear for me how we should change the user? I need to change/add another variable inside the photoprism file?
 

gt2416

Patron
Joined
Feb 4, 2018
Messages
262
Not clear for me how we should change the user? I need to change/add another variable inside the photoprism file?

Well you have two options,
1) Add "photoprism" user, Use this command inside the jail:
pw useradd -n photoprism -u 1103 -d /nonexistent -s /usr/sbin/nologin
OR
2) Add your own media user in the jail, editing the command I posted above with your user and uid, then edit this file
/usr/local/etc/rc.d/photoprism
Find this line
command_args="-f -T photoprism -p ${pidfile} -u photoprism /usr/local/bin/photoprism.....
and edit the username which I highlighted.

After doing either of those set permissions with your user and uid accordingly:
Code:
chown -R username:username photoprism_assetspath="/var/db/photoprism/assets"
chown -R username:username photoprism_storagepath="/var/db/photoprism/storage"
chown -R username:username photoprism_logfilename="/var/log/prism.log"
chown -R username:username photoprism_originalspath="/var/db/photoprism/storage/originals"
chown -R username:username photoprism_importpath="/var/db/photoprism/storage/import"


Then you can start it with service photoprism start
 
Last edited:

agmotol

Cadet
Joined
Mar 12, 2021
Messages
6
Why am I having an error?
Code:
root@test:~ # cd photoprism-freebsd-port
root@test:~/photoprism-freebsd-port # make config
make: "/usr/share/mk/bsd.port.mk" line 32: Cannot open /usr/ports/Mk/bsd.port.mk
make: "/root/photoprism-freebsd-port/Makefile" line 61: Malformed conditional (${OPSYS} == FreeBSD && ${OSVERSION} > 1100000 && ${OSVERSION} < 1200000)
make: "/usr/share/mk/bsd.port.mk" line 32: Cannot open /usr/ports/Mk/bsd.port.mk
make: Fatal errors encountered -- cannot continue
make: stopped in /root/photoprism-freebsd-port
 

Jack828

Dabbler
Joined
Nov 11, 2020
Messages
16
Why am I having an error?
Code:
root@test:~ # cd photoprism-freebsd-port
root@test:~/photoprism-freebsd-port # make config
make: "/usr/share/mk/bsd.port.mk" line 32: Cannot open /usr/ports/Mk/bsd.port.mk
make: "/root/photoprism-freebsd-port/Makefile" line 61: Malformed conditional (${OPSYS} == FreeBSD && ${OSVERSION} > 1100000 && ${OSVERSION} < 1200000)
make: "/usr/share/mk/bsd.port.mk" line 32: Cannot open /usr/ports/Mk/bsd.port.mk
make: Fatal errors encountered -- cannot continue
make: stopped in /root/photoprism-freebsd-port

Hey. There is information throughout this thread about changing which ports you're using so you can compile.

However, I got set up very quickly and easily using this post's guide https://www.truenas.com/community/threads/how-to-install-photoprism-in-jail.88862/post-652311

I would recommend you follow it to save compiling :)
 

Samuel Tai

Never underestimate your own stupidity
Moderator
Joined
Apr 24, 2020
Messages
5,399
According to TensorFlow, you need to run pip install tensorflow or pip install tensorflow-cpu if you don't have a GPU. Note, the Python pip installer may be named pip3 or pip38.
 

MelaGo

Dabbler
Joined
May 9, 2015
Messages
12
So there's a new version available
How do you easily upgrade?
When using the pkg add of the new release, I just get

Code:
the most recent version of photoprism-g20210523 is already installed
 

agmotol

Cadet
Joined
Mar 12, 2021
Messages
6
According to TensorFlow, you need to run pip install tensorflow or pip install tensorflow-cpu if you don't have a GPU. Note, the Python pip installer may be named pip3 or pip38.
I installed pkg python38, but pip not found. I installed pkg py38-pip, but I have error when use command pip install tensorflow:
ERROR: Could not find a version that satisfies the requirement tensorflow
ERROR: No matching distribution found for tensorflow
 

gt2416

Patron
Joined
Feb 4, 2018
Messages
262
So there's a new version available
How do you easily upgrade?
When using the pkg add of the new release, I just get

Code:
the most recent version of photoprism-g20210523 is already installed
Sadly the only way is to wait for the new FreeBSD compiled version to be posted. As of right now I still cant compile it myself so yea..

There was an update 5 days ago,
 

botham2021

Cadet
Joined
Nov 28, 2021
Messages
7
I managed to install Photoprism using the pre built package and some dependencies. (No need to wait hours for it to build, yay)

In the jail do make sure your on the latest pkg branch in /etc/pkg/FreeBSD.conf

pkg update pkg install ffmpeg openjdk p5-Image-ExifTool py38-tensorflow

Thanks for the step by step details.

Like others, I can't install py38-tensorflow either. I've confirmed /etc/pkg/FreeBSD.conf is pointing to the latest, and I've done an pkg update. It fails with the 'not found'. Did you have need some other step to get py38-tensorflow somehow?

I was still able to bring up photoprism without it. It's importing pics happily.
 

Patrick M. Hausen

Hall of Famer
Joined
Nov 25, 2013
Messages
7,776
Any results for e.g. pkg search tensor?
 

botham2021

Cadet
Joined
Nov 28, 2021
Messages
7
Any results for e.g. pkg search tensor?

This is my .conf:
Code:
root@photoprism:~ # grep latest /etc/pkg/FreeBSD.conf
  url: "pkg+http://pkg.FreeBSD.org/${ABI}/latest",

No sign of anything like tensorflow. Do you see it in your environment?  I'm happy to provide any other diagnostic info to sort this out. 

root@photoprism:~ # pkg search tensor
R-cran-tensor-1.5              Tensor product of arrays
ambit-tensor-0.5.1             C++ library for tensor product calculations
xtensor-0.24.0                 Multi-dimensional arrays with broadcasting and lazy computing
xtensor-blas-0.20.0            BLAS extension to xtensor
xtensor-io-0.13.0              Xtensor plugin to read/write images, audio files, numpy npz and HDF5
xtensor-python-0.26.0          Python bindings for xtensor
root@photoprism:~ # pkg search tensor | grep flow
root@photoprism:~ # pkg search flow | grep tensor
 

Patrick M. Hausen

Hall of Famer
Joined
Nov 25, 2013
Messages
7,776
What does freebsd-version<ENTER> in your jail say?
 

botham2021

Cadet
Joined
Nov 28, 2021
Messages
7
It's a new Truenas Core install, about 2 weeks old. I grabbed the latest available on the download site.

Code:
root@photoprism:~ # freebsd-version
12.2-RELEASE-p11
 
Last edited:
Top