Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Needed environment variables #14

Open
dml33 opened this issue May 23, 2021 · 2 comments
Open

Needed environment variables #14

dml33 opened this issue May 23, 2021 · 2 comments

Comments

@dml33
Copy link

dml33 commented May 23, 2021

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

@huo-ju
Copy link
Owner

huo-ju commented May 23, 2021

After install the port, you should see the following message about environmental variables.

photoprism_assetspath="%%PHOTOPRISM_DATA_DIR%%/assets"

@dml33 dml33 changed the title Needed environmental variables Needed environment variables May 24, 2021
@dml33
Copy link
Author

dml33 commented May 24, 2021

Hi.

Those two variables in /etc/rc.conf are used to launch the photoprism server properly at startup.

photoprism_assetspath
photoprism_storagepath

But, afterwards, if you just want to run the photoprism command for any purpose (manually index your files, get the configuration, purge, cleanup, backup, etc...), an error is given, since those folders are not found.

For example:

photoprism config
....
ERRO[2021-05-24T04:54:17Z] config: failed creating /.photoprism/storage/serial:                open /.photoprism/storage/serial: no such file or directory
...

Another example:

root@Emby2:/ # photoprism purge
ERRO[2021-05-24T05:01:14Z] assets path not found, run 'photoprism config' to check configuration options
root@Emby2:/ # photoprism cleanup
ERRO[2021-05-24T05:02:37Z] assets path not found, run 'photoprism config' to check configuration options

But, if they are given as parameters to photoprism command every time, it works fine:

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 config

Another option is to set those environment variables and no extra parameters must be given to photoprism command to work properly:

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"

https://docs.photoprism.org/getting-started/config-options/

Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants