Coder Social home page Coder Social logo

photoprism-freebsd-port's Introduction

The photoprism port for FreeBSD

The port will compile and install photoprism from source on FreeBSD.

Dependencies

This port depends on science/libtensorflow1

You can install it by freebsd ports or build a private copy using poudriere.

If you need pre-built binaries you can use this repo

AVX2 is required for your CPU.

https://github.com/Gaojianli/photoprism-freebsd-port/releases

Install using ports

Download and Install

git clone https://github.com/huo-ju/photoprism-freebsd-port
cd photoprism-freebsd-port
make && make install

Poudriere

If you are using poudriere to build the port, you will need to set the following in poudriere.conf:

  • ALLOW_NETWORKING_PACKAGES="photoprism" as the dep-js target downloads node packages.
  • TMPFS_LIMIT or MFSSIZE should be at least 6 as the build is very large.
  • MAX_MEMORY=16 or more is required for node

Add entries to rc.conf

photoprism_enable="YES"
photoprism_assetspath="/var/db/photoprism/assets"
photoprism_storagepath="/var/db/photoprism/storage"

Set an initial admin password (fresh install)

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

Run the service

service photoprism start

Go to http://your_server_IP_address:2342/ in your browser

photoprism-freebsd-port's People

Contributors

gaojianli avatar gcebollero avatar huo-ju avatar jan666 avatar lapo-luchini avatar psa avatar tinsuke avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

photoprism-freebsd-port's Issues

"File to patch:" with FLAVOR=notf

Hi.
When I do
make FLAVOR=notf
the process stops asking for which file to patch:

===>  Patching for photoprism-notf-g20211130
===>  Applying extra patch /root/photoprism-freebsd-port/files/extra-patch-docker_tensorflow_tensorflow-1.15.2_third_partypo.bzl
File to patch: ^C===>  FAILED Applying extra patch /root/photoprism-freebsd-port/files/extra-patch-docker_tensorflow_tensoow-1.15.2_third_party_repo.bzl
*** Error code 1
*** Signal 2

Thanks!

Issue during "make && make install"

I encountered this error while running the 'make && make install' portion of the process:

image

Not sure how to progress from here.

I appreciate your help.

Thank you!

heif-convert binary is missing

The port does not install the heif-convert binary. It is needed to have support for HEIC files (e. g. iPhones). It skippes silently if the binary is not found.

Added in Pull Request 44

update g20210505 to g20210523 make does not do anything

Hi.

I have my photoprism g20210505 totally compiled and I wanted to update it to g20210523.

In my photoprism-freebsd-port folder, I did a git pull to update the repo. Thus, several packages were updated. Then, I did a make configure to be sure everything was fine. Then, I typed make, but it did not do absolutely anything. It did not download the new g20210523 version or compile it.

I had to git clone https://github.com/huo-ju/photoprism-freebsd-port again to a new folder. But, doing this, it also downloaded again tensorflow 1.15.2 and began again its compilation...

Could be possible just to download and compile the photoprism itself, since the tensorflow version has not changed this time?

Thanks!

Photoprism compilation issues with tensorflow

I have been trying to compile photoprism on FreeBSD using photoprism-freebsd-port for a couple of days without success.
The commands I used follow:

cd /tmp
git clone 'https://github.com/huo-ju/photoprism-freebsd-port.git'
cd photoprism-freebsd-port
LD_LIBRARY_PATH=".:/lib:/usr/libexec:/usr/local/lib"  make  BATCH=yes OPTIONS_SET=AVX

I identified two issues:

  1. The port depends on science/libtensorflow1, however there is no such port in the ports tree. I assume it is meant to build against science/py-tensorflow, so I applied the following patch to the Makefile and the compilation started:
    sed -i '' 's#science/libtensorflow1#science/py-tensorflow#g' Makefile

  2. The compilation of science/py-tensorflow fails with the following build error:

ERROR: /usr/ports/science/py-tensorflow/work-py38/tensorflow-1.15.5/tensorflow/python/BUILD:329:1: C++ compilation of rule '//tensorflow/python:bfloat16_lib' failed (Exit 1)
tensorflow/python/lib/core/bfloat16.cc:633:8: error: no matching function for call to object of type '(lambda at tensorflow/python/lib/core/bfloat16.cc:607:25)'
  if (!register_ufunc("equal", CompareUFunc<Bfloat16EqFunctor>,
       ^~~~~~~~~~~~~~
tensorflow/python/lib/core/bfloat16.cc:607:25: note: candidate function not viable: no overload of 'CompareUFunc' matching 'PyUFuncGenericFunction' (aka 'void (*)(char **, const long *, const long *, void *)') for 2nd argument
  auto register_ufunc = [&](const char* name, PyUFuncGenericFunction fn,
                        ^
tensorflow/python/lib/core/bfloat16.cc:637:8: error: no matching function for call to object of type '(lambda at tensorflow/python/lib/core/bfloat16.cc:607:25)'
  if (!register_ufunc("not_equal", CompareUFunc<Bfloat16NeFunctor>,
       ^~~~~~~~~~~~~~
tensorflow/python/lib/core/bfloat16.cc:607:25: note: candidate function not viable: no overload of 'CompareUFunc' matching 'PyUFuncGenericFunction' (aka 'void (*)(char **, const long *, const long *, void *)') for 2nd argument
  auto register_ufunc = [&](const char* name, PyUFuncGenericFunction fn,
                        ^
tensorflow/python/lib/core/bfloat16.cc:641:8: error: no matching function for call to object of type '(lambda at tensorflow/python/lib/core/bfloat16.cc:607:25)'
  if (!register_ufunc("less", CompareUFunc<Bfloat16LtFunctor>, compare_types)) {
       ^~~~~~~~~~~~~~
tensorflow/python/lib/core/bfloat16.cc:607:25: note: candidate function not viable: no overload of 'CompareUFunc' matching 'PyUFuncGenericFunction' (aka 'void (*)(char **, const long *, const long *, void *)') for 2nd argument
  auto register_ufunc = [&](const char* name, PyUFuncGenericFunction fn,
                        ^
tensorflow/python/lib/core/bfloat16.cc:644:8: error: no matching function for call to object of type '(lambda at tensorflow/python/lib/core/bfloat16.cc:607:25)'
  if (!register_ufunc("greater", CompareUFunc<Bfloat16GtFunctor>,
       ^~~~~~~~~~~~~~
tensorflow/python/lib/core/bfloat16.cc:607:25: note: candidate function not viable: no overload of 'CompareUFunc' matching 'PyUFuncGenericFunction' (aka 'void (*)(char **, const long *, const long *, void *)') for 2nd argument
  auto register_ufunc = [&](const char* name, PyUFuncGenericFunction fn,
                        ^
tensorflow/python/lib/core/bfloat16.cc:648:8: error: no matching function for call to object of type '(lambda at tensorflow/python/lib/core/bfloat16.cc:607:25)'
  if (!register_ufunc("less_equal", CompareUFunc<Bfloat16LeFunctor>,
       ^~~~~~~~~~~~~~
tensorflow/python/lib/core/bfloat16.cc:607:25: note: candidate function not viable: no overload of 'CompareUFunc' matching 'PyUFuncGenericFunction' (aka 'void (*)(char **, const long *, const long *, void *)') for 2nd argument
  auto register_ufunc = [&](const char* name, PyUFuncGenericFunction fn,
                        ^
tensorflow/python/lib/core/bfloat16.cc:652:8: error: no matching function for call to object of type '(lambda at tensorflow/python/lib/core/bfloat16.cc:607:25)'
  if (!register_ufunc("greater_equal", CompareUFunc<Bfloat16GeFunctor>,
       ^~~~~~~~~~~~~~
tensorflow/python/lib/core/bfloat16.cc:607:25: note: candidate function not viable: no overload of 'CompareUFunc' matching 'PyUFuncGenericFunction' (aka 'void (*)(char **, const long *, const long *, void *)') for 2nd argument
  auto register_ufunc = [&](const char* name, PyUFuncGenericFunction fn,
                        ^
6 errors generated.

I tried checking out the ports tree to a version from December 2021 and Photoprism to a commit before the switch to external tensorflow but I got other linker issues (see below). The commits I tried were:

The linker errors with the code before splitting out tensorflow:

ERROR: /tmp/lansnap-build/photoprism-freebsd-port/work/photoprism-93b26f197908dd825dfa302d17793185cc3eab8c/docker/tensorflow/tensorflow-1.15.2/tensorflow/BUILD:563:1: Linking of rule '//tensorflow:libtensorflow_framework.so.1.15.2' failed (Exit 1)
ld: error: duplicate symbol: adler32
>>> defined at adler32.c
>>>            adler32.pic.o:(adler32) in archive bazel-out/host/bin/external/zlib/libzlib.pic.a
>>> defined at adler32.c
>>>            adler32.pic.o:(.text.adler32+0x0) in archive bazel-out/host/bin/external/zlib_archive/libzlib.pic.a

ld: error: duplicate symbol: adler32_combine
>>> defined at adler32.c
>>>            adler32.pic.o:(adler32_combine) in archive bazel-out/host/bin/external/zlib/libzlib.pic.a
>>> defined at adler32.c
>>>            adler32.pic.o:(.text.adler32_combine+0x0) in archive bazel-out/host/bin/external/zlib_archive/libzlib.pic.a

... (repeated for multiple other functions)

My question is: Am I compiling Photoprism correctly, and if yes - why is tensorflow failing to compile?

I am using FreeBSD 13.0-RELEASE.

problems in compiling under freebsd - file missing

I have the following issue - can you please provide the file

root@calcit:/home/chrissie/photoprism-freebsd-port # make install
===> Patching for photoprism-g20210523
===> Applying extra patch /usr/home/chrissie/photoprism-freebsd-port/files/extra-patch-docker_tensorflow_tensorflow-1.15.2_third_party_repo.bz
cat: /usr/home/chrissie/photoprism-freebsd-port/files/extra-patch-docker_tensorflow_tensorflow-1.15.2_third_party_repo.bz: No such file or directory
===> FAILED Applying extra patch /usr/home/chrissie/photoprism-freebsd-port/files/extra-patch-docker_tensorflow_tensorflow-1.15.2_third_party_repo.bz
*** Error code 1

built failed with poudriere

Tried to create a pkg with poudriere to use it in a dedicated jail (and most dependencies are available within poudriere as well).

However it fails, see log excerpt

===>   Returning to build of photoprism-g20210111
===========================================================================
=======================<phase: lib-depends    >============================
===========================================================================
=======================<phase: configure      >============================
===>  Configuring for photoprism-g20210111
===========================================================================
=======================<phase: build          >============================
===>  Building for photoprism-g20210111
cd /wrkdirs/usr/ports/www/photoprism/work/photoprism-6b0d94ff42fadccfe88c4d68744b9d3afea36e2f/docker/tensorflow && gmake download
gmake[1]: Entering directory '/wrkdirs/usr/ports/www/photoprism/work/photoprism-6b0d94ff42fadccfe88c4d68744b9d3afea36e2f/docker/tensorflow'
wget https://github.com/tensorflow/tensorflow/archive/v1.15.2.tar.gz
gmake[1]: wget: No such file or directory
gmake[1]: *** [Makefile:10: download] Error 127
gmake[1]: Leaving directory '/wrkdirs/usr/ports/www/photoprism/work/photoprism-6b0d94ff42fadccfe88c4d68744b9d3afea36e2f/docker/tensorflow'
*** Error code 2

Stop.
make: stopped in /usr/ports/www/photoprism
=>> Cleaning up wrkdir
===>  Cleaning for photoprism-g20210111
build of www/photoprism | photoprism-g20210111 ended at Wed Jan 27 10:17:10 CET 2021
build time: 00:00:30
!!! build failure encountered !!!

What should I try to solve this?

Full log.txt enclosed as well.

undefined reference to 'program_invocation_name'

Hey, trying to get this set up on a FreeNAS jail using the 11.4 release. I was able to work through/around the other open issues while building and now I'm blocked by yet another tensorflow build issue:

ERROR: /root/photoprism-freebsd-port/work/photoprism-ac5a9d5ee435ae9233f25740128049dbb329a9d2/docker/tensorflow/tensorflow-1.15.2/tensorflow/cc/BUILD:496:1: Linking of rule '//tensorflow/cc:ops/array_ops_gen_cc' failed (Exit 1)
bazel-out/host/bin/_solib_freebsd/_U_S_Stensorflow_Scc_Cops_Sarray_Uops_Ugen_Ucc___Utensorflow/libtensorflow_framework.so.1: undefined reference to `program_invocation_name'
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Target //tensorflow:libtensorflow.so failed to build

Has anyone seen this one?

Photoprism version date is set to compilation date

Hi.

Every time I compile a Photoprism port, the date which appears at the footer, together with the git commit hash, is the compilation date, not the original one of the git tag.

For example, for the g20220118 and tag name 76c94a1f38896d6bb79c4bbe7266a55edbc43862, instead of appearing the original tag date, which is 20220118, it appears as the date I compiled it: 20220119.

image

It happens with all your Photoprism ports I have compiled.

I wanted to ask if this behavior comes to your port side or it is in photoprism code itself instead. It is just a matter of coherence, to avoid confusion about which tag it is really, without entering to check the hash with the git repository.

Thanks!

photoprism-freebsd-port doesn't build in poudriere: it expects 'gmake' and 'wget' during extract

===>  Extracting for photoprism-g20210111
=> SHA256 Checksum OK for photoprism-photoprism-g20210111-6b0d94ff42fadccfe88c4d68744b9d3afea36e2f_GH0.tar.gz.
===>   photoprism-g20210111 depends on executable: gmake - found
cd /wrkdirs/usr/ports/www/photoprism/work/photoprism-6b0d94ff42fadccfe88c4d68744b9d3afea36e2f/docker/tensorflow && gmake download
gmake[1]: Entering directory '/wrkdirs/usr/ports/www/photoprism/work/photoprism-6b0d94ff42fadccfe88c4d68744b9d3afea36e2f/docker/tensorflow'
wget https://github.com/tensorflow/tensorflow/archive/v1.15.2.tar.gz
gmake[1]: wget: No such file or directory
gmake[1]: *** [Makefile:9: download] Error 127
gmake[1]: Leaving directory '/wrkdirs/usr/ports/www/photoprism/work/photoprism-6b0d94ff42fadccfe88c4d68744b9d3afea36e2f/docker/tensorflow'
*** Error code 2

I added EXTRACT_DEPENDS= gmake:devel/gmake that's why it found gmake, but gmake shouldn't be expected during extract.

Photo prism does not build cleanly on FreeBSD 12.2-RELEASE-p6

I am trying to compile PhotoPrism in a TrueNAS jail, which is running FreeBSD 12.2-RELEASE-p6

The error messages are:

defined at deflate.c
deflate.pic.o:(.text.deflateParams+0x0) in archive bazel-out/host/bin/external/zlib_archive/libzlib.pic.a

ld: error: too many errors emitted, stopping now (use -error-limit=0 to see allerrors)
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Target //tensorflow:libtensorflow.so failed to build
Use --verbose_failures to see the command lines of failed build steps.
INFO: Elapsed time: 9.924s, Critical Path: 7.26s
INFO: 6 processes: 6 local.
FAILED: Build did NOT complete successfully
*** Error code 1

update to latest version

Thank you for this port. With this and the notes found in this thread (https://www.truenas.com/community/threads/how-to-install-photoprism-in-jail.88862/page-5) I was able to get photoprism to compile and work in freebsd.

However, the version in the port still sometimes rotates an HEIF photo when converting to jpeg. It looks like this was fixed in the 5/20/21 version of photoprism. Is it possible to update the port to the the 5/20/21 or latter version?

Thanks again for the great work.

Document setting admin password

Unless there's a default password set somewhere that I can't find (I see "photoprism" in docker-compose.yml, but it doesn't work), the admin password doesn't seem to be set--and there needs to be a password there for admin to log in. A simple photoprism passwd, as mentioned in the photoprism docs, doesn't work, as it's unable to locate its assets directory. To set the password, after installing sudo if needed, the user can run sudo -u photoprism /usr/local/bin/photoprism --assets-path=/var/photoprism/assets --storage-path=/var/photoprism/storage --originals-path=/var/photoprism/storage/originals --import-path=/var/photoprism/storage/import passwd, substituting /var/photoprism/assets and /var/photoprism/storage with their assets and storage paths, respectively.

Edit: or su -m photoprism -c '/usr/local/bin/photoprism ...', which doesn't require sudo to be installed.

Error when changing rc command_arg to use a options.yml file

Hi,
First, thanks for your work on this ports.

I'm using it with some modification into /usr/local/etc/rc.d/photoprism, i found this is more easy to pass a options.yml that override all defaults i need.

So i change the photoprism command_args with something simpler :
photoprism --defaults-yaml=/usr/local/etc/photoprism/options.yml --trace start

And options.yml

HttpPort: 2342
HttpHost: 127.0.0.1
debug: true

AssetsPath: /data/photoprism/assets
ConfigPath: /usr/local/etc/photoprism
StoragePath: /data/photoprism/storage
OriginalsPath: /data/photoprism/storage/originals
ImportPath: /data/photoprism/storage/imports

AdminPassword: xxx

But i have an error of template at running, i link to the discussion with photoprism here, that also contain more detail about the BastilleFile i used to run photoprism in jail.

It seems static file missing.

Thanks for your help !

Develop version of makefile

Hi !

Do you think that could be possible to create a develop branch to test build of the latest version of photoprism ?

There are 6 month between release on photoprism ...

Thanks !

darktable or rawtherapee won't convert anyting, trying to write to /.config or /.cache

I have a lot of raws that photoprism alone couldn't handle so I installed rawtherapee and darktable via pkg into my FreeBSD 12.2 Jail (on TrueNAS Core). They're then magically called from the photoprism service installed by that port, but both cli tools apparently try to access /.config in the root (not /root) folder and fail. I modified the created photoprism user by adding a home directory and shell, also adding photoprism_chdir="/home/photoprism" in /usr/local/etc/rc.d/photoprism, but still they try /.config. Creating /.config and /.cache under / and giving the photoprism user permissions does work, but I think there should be a better solution, even in a jail.

Error message: "index: failed converting DSCxxxxx.ARW to jpeg (path lookup '/.config/darktable' fails with: 'No such file or directory'\n)"

Unsure if it's a photoprism or port problem, but I don't think photoprism calls those tools explicitly from '/' and someone with more FreeBSD knowledge then me could point out the original problem?

photoprism has an environment variable to set the paths for rawtherapee or darktable, so another workaround would be a wrapper script. But in the case of darktable the --core --configdir option has to come after other parameters I think.

Thanks for the port, it's great!

latest prebuilt binary are missing several tabs in Settings

Thank you for the port and the prebuilt binaries. The latest binary (11-2022) seems to be missing three tabs in Settings: Advanced, Services, and Account. Reverting back to the 6-2022 binary would bring these tabs back. Thanks for looking into this.

Needed environment variables

Hi.

I saw that doing a

photoprism config

There were some errors such as

ERRO[2021-05-23T19:18:20Z] config: failed creating /var/db/.photoprism/storage/serial: open /var/db/.photoprism/storage/serial: no such file or directory

The beginning of such path was the path you were already.

Also, I could not perform a photoprism purge or photoprism cleanup due to similar errors.

Then, I noticed that setting the following environmental variables, was making everything fine:

setenv PHOTOPRISM_ASSETS_PATH "/var/db/photoprism/assets"
setenv PHOTOPRISM_STORAGE_PATH "/var/db/photoprism/storage"
setenv PHOTOPRISM_ORIGINALS_PATH "/var/db/photoprism/storage/originals"

I think they are needed to be set in this freebsd-port.

Thanks

GO error when compiling

Hello, I wonder if anyone else has the same problem... The compiler quits with an error:
`===> photoprism-g20220901 USES=go has invalid arguments: 1.19.
*** Error code 1

Stop.`
My Go version is 1.19.2
Thanks!

Make Config Failure

Hello! So I tried installing Photoprism into TrueNAS core and it didn't exactly work. Now since TrueNAS core is based on FreeBSD, most people directed me here to install it. I've tried to do this in a clone jail shell and just normal shell in the ui, but it simply didn't work.

The git clone worked most of the time, but I couldn't execute make config or make && make install. It just simply didn't work and gave me an error. I don't know what I've done wrong.

I've attached a screenshot to the error I get down below.
Screenshot 2022-08-08 193208

Registering installation step failing

Hi,

First of all thanks for the port, greatly appreciated!

I am encountering a make issue at the end of the process on my freebsd 13.1:

===> Registering installation for photoprism-g20220901
pkg-static: Unable to access file /usr/ports/www/photoprism-freebsd-port/work/stage/var/db/photoprism/assets/facenet/saved_model.pb:No such file or directory
pkg-static: Unable to access file /usr/ports/www/photoprism-freebsd-port/work/stage/var/db/photoprism/assets/facenet/version.txt:No such file or directory
pkg-static: Unable to access file /usr/ports/www/photoprism-freebsd-port/work/stage/var/db/photoprism/assets/nasnet/labels.txt:No such file or directory
pkg-static: Unable to access file /usr/ports/www/photoprism-freebsd-port/work/stage/var/db/photoprism/assets/nasnet/saved_model.pb:No such file or directory
pkg-static: Unable to access file /usr/ports/www/photoprism-freebsd-port/work/stage/var/db/photoprism/assets/nasnet/variables/variables.data-00000-of-00001:No such file or directory
pkg-static: Unable to access file /usr/ports/www/photoprism-freebsd-port/work/stage/var/db/photoprism/assets/nasnet/variables/variables.index:No such file or directory
pkg-static: Unable to access file /usr/ports/www/photoprism-freebsd-port/work/stage/var/db/photoprism/assets/nasnet/version.txt:No such file or directory
pkg-static: Unable to access file /usr/ports/www/photoprism-freebsd-port/work/stage/var/db/photoprism/assets/nsfw/labels.txt:No such file or directory
pkg-static: Unable to access file /usr/ports/www/photoprism-freebsd-port/work/stage/var/db/photoprism/assets/nsfw/saved_model.pb:No such file or directory
pkg-static: Unable to access file /usr/ports/www/photoprism-freebsd-port/work/stage/var/db/photoprism/assets/nsfw/variables/variables.data-00000-of-00001:No such file or directory
pkg-static: Unable to access file /usr/ports/www/photoprism-freebsd-port/work/stage/var/db/photoprism/assets/nsfw/variables/variables.index:No such file or directory
pkg-static: Unable to access file /usr/ports/www/photoprism-freebsd-port/work/stage/var/db/photoprism/assets/nsfw/version.txt:No such file or directory
pkg-static: Unable to access file /usr/ports/www/photoprism-freebsd-port/work/stage/var/db/photoprism/assets/facenet/:No such file or directory
pkg-static: Unable to access file /usr/ports/www/photoprism-freebsd-port/work/stage/var/db/photoprism/assets/nasnet/variables/:No such file or directory
pkg-static: Unable to access file /usr/ports/www/photoprism-freebsd-port/work/stage/var/db/photoprism/assets/nasnet/:No such file or directory
pkg-static: Unable to access file /usr/ports/www/photoprism-freebsd-port/work/stage/var/db/photoprism/assets/nsfw/variables/:No such file or directory
pkg-static: Unable to access file /usr/ports/www/photoprism-freebsd-port/work/stage/var/db/photoprism/assets/nsfw/:No such file or directory
*** Error code 1

Stop.
make: stopped in /usr/ports/www/photoprism-freebsd-port

Any clue what I am missing?

Fabien

photoprism cli "invalid assets path, check configuration and permissions"

firstly, @huo-ju Thanks for this project!

This is more of a question to help point me in right direction I think.

I am set up and it's all working, and now I want to automatically index new images I add (via a different process) daily/hourly. I can do this via the web UI (Library > Index > Start (scan)) manually.

Documentation suggests that it should be possible to use the cli and run photoprism index, and from there I was going to add this to cron.

However I get this error:

invalid assets path, check configuration and permissions

I am running as root, and get the same if I run it this way:

su -m photoprism -c "photoprism index"

In fact I get the same error when I run other cli command such as photoprism stop.

I can run photoprism status and result is operational.

photoprism config shows that there is indeed no value for the asset-path attribute, which is presumably what is causing the error.

I can stop and start the photoprism service using:

service photoprism start|stop

which works fine.

Is there a trick I am missing regarding using the cli tools under freebsd, all the official documentation seems to focus around docker builds.

Thanks in advance if you can offer any insight to get this going (scheduled re-indexing can't be such an unusual feature?!)

multimedia/ffmpeg updated to version 6, not compatible with Photoprism

multimedia/ffmpeg was updated to the new default version 6. This version is not yet compatible with Photoprism.

I tried to fix that by changing the version to RUN_DEPENDS= ffmpeg:multimedia/ffmpeg4 but the problem is that multimedia/ffmpeg4 does not install /usr/local/bin/ffmpeg but /usr/local/ffmpeg4/bin/ffmpeg. I "fixed" that for my setup by creating a link from /usr/local/bin/ffmpeg to /usr/local/ffmpeg4/bin/ffmpeg.

I guess there is a proper way to fix that but I don't know how.

tensorflow compiling fails on FreeBSD 11.4-RELEASE

When compiling photoprism-port in a FreeBSD 11.4-RELEASE-p5 jail (CPU without AV*-features), it fails in tensorflow-compiling-phase:

...
ERROR: /root/photoprism-freebsd-port/work/photoprism-6b0d94ff42fadccfe88c4d68744b9d3afea36e2f/docker/tensorflow/tensorflow-1.15.2/tensorflow/core/BUILD:2285:1: C++ compilation of rule '//tensorflow/c
ore:autotuning_proto_cc_impl' failed (Exit 1)
In file included from bazel-out/host/bin/tensorflow/core/protobuf/autotuning.pb.cc:4:                                                                                                                  
bazel-out/host/bin/tensorflow/core/protobuf/autotuning.pb.h:234:34: error: expected member name or ';' after declaration specifiers
  ::PROTOBUF_NAMESPACE_ID::int32 major() const;                                                    
  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^                                                                 
/usr/include/sys/types.h:372:20: note: expanded from macro 'major'                                                                                                                                     
#define major(x)        ((int)(((u_int)(x) >> 8)&0xff)) /* major number */                                                                                                                             
                          ^                                                                        
In file included from bazel-out/host/bin/tensorflow/core/protobuf/autotuning.pb.cc:4:
bazel-out/host/bin/tensorflow/core/protobuf/autotuning.pb.h:234:34: error: expected ')'
/usr/include/sys/types.h:372:20: note: expanded from macro 'major'
#define major(x)        ((int)(((u_int)(x) >> 8)&0xff)) /* major number */
                          ^
bazel-out/host/bin/tensorflow/core/protobuf/autotuning.pb.h:234:34: note: to match this '('
/usr/include/sys/types.h:372:19: note: expanded from macro 'major'
#define major(x)        ((int)(((u_int)(x) >> 8)&0xff)) /* major number */
                         ^
In file included from bazel-out/host/bin/tensorflow/core/protobuf/autotuning.pb.cc:4:
bazel-out/host/bin/tensorflow/core/protobuf/autotuning.pb.h:234:34: error: expected ')'
  ::PROTOBUF_NAMESPACE_ID::int32 major() const;
                                 ^
/usr/include/sys/types.h:372:37: note: expanded from macro 'major'
#define major(x)        ((int)(((u_int)(x) >> 8)&0xff)) /* major number */
                                           ^
bazel-out/host/bin/tensorflow/core/protobuf/autotuning.pb.h:234:34: note: to match this '('
/usr/include/sys/types.h:372:25: note: expanded from macro 'major'
#define major(x)        ((int)(((u_int)(x) >> 8)&0xff)) /* major number */
                               ^
In file included from bazel-out/host/bin/tensorflow/core/protobuf/autotuning.pb.cc:4:
bazel-out/host/bin/tensorflow/core/protobuf/autotuning.pb.h:234:34: error: C++ requires a type specifier for all declarations
  ::PROTOBUF_NAMESPACE_ID::int32 major() const;
                                 ^
/usr/include/sys/types.h:372:27: note: expanded from macro 'major'
#define major(x)        ((int)(((u_int)(x) >> 8)&0xff)) /* major number */
                                 ^
In file included from bazel-out/host/bin/tensorflow/core/protobuf/autotuning.pb.cc:4:
bazel-out/host/bin/tensorflow/core/protobuf/autotuning.pb.h:234:34: error: expected ')'
/usr/include/sys/types.h:372:42: note: expanded from macro 'major'
#define major(x)        ((int)(((u_int)(x) >> 8)&0xff)) /* major number */
                                                ^
bazel-out/host/bin/tensorflow/core/protobuf/autotuning.pb.h:234:34: note: to match this '('
/usr/include/sys/types.h:372:24: note: expanded from macro 'major'
#define major(x)        ((int)(((u_int)(x) >> 8)&0xff)) /* major number */
                              ^
...
In file included from bazel-out/host/bin/tensorflow/core/protobuf/autotuning.pb.cc:4:
bazel-out/host/bin/tensorflow/core/protobuf/autotuning.pb.h:380:34: error: non-member function cannot have '&' qualifier
/usr/include/sys/types.h:373:28: note: expanded from macro 'minor'
#define minor(x)        ((int)((x)&0xffff00ff))         /* minor number */
                                  ^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
Target //tensorflow:libtensorflow.so failed to build
Use --verbose_failures to see the command lines of failed build steps.
INFO: Elapsed time: 4207.232s, Critical Path: 185.05s
INFO: 781 processes: 781 local.
FAILED: Build did NOT complete successfully
*** Error code 1

Stop.
make[1]: stopped in /root/photoprism-freebsd-port
*** Error code 1

Stop.
make: stopped in /root/photoprism-freebsd-port

Seems similar to this PR at first glance ... and there is a patching approach

Cannot build: USES=go has invalid arguments: 1.19

Hi, have cloned the repo and and on trying my first trying using make -j8 I am getting

make -j8
===> photoprism-g20221118 USES=go has invalid arguments: 1.19.
*** Error code 1

Stop.
make: stopped in /root/photoprism-freebsd-port

Have tried googling, with no luck. Reinstalled go119, same.
Any pointers would be much appreciated

======
uname -a
FreeBSD photoprism 13.1-RELEASE-p2 FreeBSD 13.1-RELEASE-p2 n245412-484f039b1d0 TRUENAS amd64

pkg info go
go-1.19,2
Name : go
Version : 1.19,2
Installed on : Tue Aug 9 15:04:39 2022 BST
Origin : lang/go
Architecture : FreeBSD:13:*
Prefix : /usr/local
Categories : lang
Licenses :
Maintainer : [email protected]
WWW : https://golang.org
Comment : Meta-port for the default version of the Go programming language
Annotations :
repo_type : binary
repository : FreeBSD
Flat size : 13.0B

libheif problem

After compiling the latest version, I got a message:
photoprism-g20230506: "/usr/ports/graphics/libheif>=1.14.2" non-existent -- dependency list incomplete
Since this version, transcoding is not working, too
libx264: failed transcoding and the filename. Am I missing something?
Thanks

Malformed conditional at "make config"

When trying to install in a TrueNas Jail(Version 12.1-Release-p13 as well as Version 12.2-Release-p2) I get the error
make: "/usr/share/mk/bsd.port.mk" line 32: Cannot open /usr/ports/Mk/bsd.port.mk make: "/photoprism-freebsd-port/Makefile" line 44: Malformed conditional (${OPSYS} == FreeBSD && ${OSVERSION} > 1100000 && ${OSVERSION} < 1200000)

after the 'make config' command.

p5-Image-ExifTool package is needed as dependency

Hi.

I have just discover that p5-Image-ExifTool package is needed as a dependency in the port, so exiftool command can be invoked by PhotoPrism and EXIF data is retrieved from videos.

The whole discussion is here.

You need to have exiftool installed. I was assuming you run our Docker image which comes with exiftool pre-installed.

PhotoPrism supports Exif natively, without Exiftool. Videos however don't use Exif but other standards.

Only after installing this package and re-import or re-index the library, video details were taken by PhotoPrism and shown correctly in the UI.

Could you please add it?

Thanks!

Assets folder permissions (and location)

The log doesn't seem to be working, so I launched the application using sudo -u photoprism and I see this error:

ERRO[2021-01-25T12:51:55+01:00] index: open /var/photoprism/assets/nasnet/labels.txt: permission denied

I guess this might be needed?

chgrp -R photoprism /var/photoprism/assets

Also, I'd suggest to move the assets folder in a different location, "straight under /var " is not the best place in FreeBSD hierarchy.

Upgrade guidelines

Hi!

Less of an issue report than a Q. First, thanks for the port, I am running it now a TrueNAS installation.

I am wondering: Are there any upgrade recommendations, guidelines from your end? Does a git pull & make install suffice?

Thx!

Service started but cannot get into the application: No login screen

This relates to an upgrade from the previous version that was working as expected.
Compiled successfully and re-installed photoprism-g20220302.
I am using MariaDB as a backend.

I started the service and when I went to the photoprism URL I got just this

image

When I look at /var/log/messages there is an error about assets.json

Mar 22 10:03:41 photoprism photoprism[28815]: time="2022-03-22T10:03:41Z" level=info msg="PhotoPrism® needs your support!"
Mar 22 10:03:41 photoprism photoprism[28815]: time="2022-03-22T10:03:41Z" level=info msg="Visit https://docs.photoprism.app/funding/ to learn more."
Mar 22 10:03:47 photoprism photoprism[28815]: time="2022-03-22T10:03:47Z" level=info msg="config: read-only mode enabled"
Mar 22 10:03:47 photoprism photoprism[28815]: time="2022-03-22T10:03:47Z" level=info msg="http: enabling gzip compression"
Mar 22 10:03:47 photoprism photoprism[28815]: time="2022-03-22T10:03:47Z" level=info msg="webdav: server disabled"
Mar 22 10:03:47 photoprism photoprism[28815]: time="2022-03-22T10:03:47Z" level=info msg="http: starting web server at 0.0.0.0:2342"
Mar 22 10:03:49 photoprism photoprism[28815]: time="2022-03-22T10:03:49Z" level=error msg="frontend: cannot read assets.json"
Mar 22 10:03:50 photoprism photoprism[28815]: time="2022-03-22T10:03:50Z" level=error msg="frontend: cannot read assets.json"

Environment variables in rc.conf are set as expected given this setup was working fine until upgraded.

Any ideas how to fix this ?

Node fails to install maplibre-gl

npm ERR! code 127
npm ERR! path /tmp/root/photoprism-freebsd-port/work/photoprism-e58fee0fb361715a1814cfd9d4577d3b9ad345e2/frontend/node_modules/maplibre-gl
npm ERR! command failed
npm ERR! command sh -c -- node ./postinstall.js
npm ERR! node ./postinstall.js: --: not found

npm ERR! A complete log of this run can be found in:
npm ERR! /root/.npm/_logs/2022-12-04T10_30_46_471Z-debug-0.log
*** Error code 127

Install FLAVOR=notf onto previous 211118 Release keeping tensorflow

Hi.
I figured to compile 211130 Release with FLAVOR=notf. But, afterwards, when I tried to install it, it conflicted with previous 211118 release:

root@Emby2:~/photoprism-freebsd-port_211118 # make FLAVOR=notf install
===>  Installing for photoprism-notf-g20211130
===>  Checking if photoprism-notf is already installed
===>   Registering installation for photoprism-notf-g20211130
[Emby2] Installing photoprism-notf-g20211130...
pkg-static: photoprism-notf-g20211130 conflicts with photoprism-g20211018 (installs files into the same place).  Problematic file: /usr/local/bin/photoprism
*** Error code 1

Stop.
make[1]: stopped in /root/photoprism-freebsd-port_211118
*** Error code 1

Stop.

Then, I deinstalled the previous release:

root@Emby2:~/photoprism-freebsd-port_211118 # make deinstall photoprism
===>  Deinstalling for photoprism
===>   Deinstalling photoprism-g20211018
Checking integrity... done (0 conflicting)
Deinstallation has been requested for the following 1 packages (of 0 packages in the universe):

Installed packages to be REMOVED:
        photoprism: g20211018

Number of packages to be removed: 1

The operation will free 398 MiB.
[Emby2] [1/1] Deinstalling photoprism-g20211018...
[Emby2] [1/1] Deleting files for photoprism-g20211018: 100%
make: don't know how to make photoprism. Stop

make: stopped in /root/photoprism-freebsd-port_211118

But, when I reinstalled the new 211130 release, tensorflow is not present:

root@Emby2:/ # 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
ld-elf.so.1: Shared object "libtensorflow.so.1" not found, required by "photoprism"

How can we solve this situation, where the new release shall be installed, the previous one removed, but tensorflow shall remain untouched?

Thanks!

Permissions

Hi, I'm having some issues with permissions, first of all either the storage or assets folder that is created had the wrong permissions set which prevented the service from starting, it was assigned to root:photoprism iirc. Secondly, and that is giving me more trouble right now, I can't upload any images as it seems the database is read-only. Not sure how I can solve that manually, would need detailed instructions for that as I know nothing about databases.

Also can't seem to set the storage, assets and import folder permanently, have to resort to setenv for this. Is there a solution?

Thanks for all the effort!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.