LibrePhotos / librephotos

A self-hosted open source photo management service. This is the repository of the backend.
MIT License
6.84k stars 298 forks source link

Cannot use librephotos on an external usb drive on Raspberry pi. #494

Closed yotama9 closed 1 month ago

yotama9 commented 2 years ago

What Operating system and version is LibrePhotos running on:

Freshly installed Ubuntu server 22.04

What architecture is LibrePhotos running on:

ARM

How is LibrePhotos installed:

Docker

How is you picture library mounted on the host (or in the virtual machine):

This is a usb drive connected directly to the machine.

Description of issue:

I've tried this several times. With trying to configure the .env file before or after the initial setup and with/without including usernamd and password configuration in the .env file

edsonsbj commented 2 years ago

Em qual sistema operacional e versão o LibrePhotos está sendo executado:

Servidor Ubuntu recém-instalado 22.04

Em qual arquitetura o LibrePhotos está sendo executado:

BRAÇO

Como o LibrePhotos é instalado:

Janela de encaixe

Como sua biblioteca de imagens está montada no host (ou na máquina virtual):

Esta é uma unidade usb conectada diretamente à máquina.

Descrição do problema:

  • Em uma máquina raspberry pi 4 recém-instalada, com librephotos instalado via docker. A configuração padrão funciona perfeitamente (não alterando nada no .envarquivo.
  • A unidade externa é montada /media/BIGusando esta linha no meu /etc/fstab arquivo UUID=ad5d7eba-2deb-4142-84b0-d5d658838e77 /media/BIG ext4 defaults 0 0
  • Depois de atualizar o arquivo env, parei o librephotos usando suso docker-compose downesudo docker-compose up -d
  • Agora, quando tento fazer login, recebo um erro:

Sem conexão com o servidor back-end, tente novamente em alguns minutos.

  • As linhas no meu .envarquivo lêem
    # Location of your photos.
    myPhotos=/media/BIG/librephotos/pictures
    # Internal data of LibrePhotos
    data=/media/BIG/librephotos/data
  • e minha estrutura foder é:
    ubuntu@ubuntu:/media/BIG/librephotos$ ls -la
    total 20
    drwxr-xr-x 5 root root 4096 May  5 14:51 .
    drwxr-xr-x 5 root root 4096 May  4 18:00 ..
    drwxr-xr-x 8  998  999 4096 May  4 19:11 data
    drwxr-xr-x 2  998  999 4096 Apr 30 18:27 photos
    drwxr-xr-x 2 root root 4096 May  5 14:51 pictures

Eu tentei isso várias vezes. Ao tentar configurar o .envarquivo antes ou depois da configuração inicial e com/sem incluir a configuração de nome de usuário e senha no .envarquivo

The same problem happened to me. The solution was to change the data folder to another place like /home or change the permissions of your hd to the owner and root group and

yotama9 commented 2 years ago

Hi, your message was cut in the middle, can you please add what I should do in addition?

I tried to make the owner of the /media/BIG/librephotos folder either ubuntu:ubuntu or root:root (using chown -R) and change the running permission to 750 (using chmod -R 750). If I transfer the data folder to the sd card (32GB) will I have enough room for the DB? I intend to also host a nextcloud server on that machine if that matter.

Thanks for your help

edsonsbj commented 2 years ago

Olá, sua mensagem foi cortada no meio, você pode adicionar o que devo fazer além disso?

Tentei tornar o proprietário da /media/BIG/librephotos pasta ubuntu:ubuntuou root:root(usando chown -R) e alterei a permissão de execução para 750(usando chmod -R 750). Se eu transferir a datapasta para o cartão SD (32GB) terei espaço suficiente para o DB? Pretendo também hospedar um servidor nextcloud nessa máquina, se for o caso.

Obrigado pela ajuda

I will give you 2 options

  1. If possible, instead of a 32Gb SD card, add a 64GB or larger one, which would allow Nextcloud and the data folder on the SD and the files on the external HD

  2. format your external hd in ext4 and mount it normally and then you pass the folders and see if it works

SOME TIPS

Install Nextcloud first first put your photos inside nextcloud and then install Librephotos and point the images folder to the path /path/to/Nextcloud/data/files

yotama9 commented 2 years ago

Hi, my external drive is formated in ext4. What do you mean by "mount it normally"?

I'll look into sd cards prices. It might be that the simplest solution will be to buy a large capacity one and use this drive for backup.

edsonsbj commented 2 years ago

Oi, meu disco externo está formatado em ext4. O que você quer dizer com "montar normalmente"?

Vou olhar para os preços dos cartões SD. Pode ser que a solução mais simples seja comprar um de grande capacidade e usar esse drive para backup.

Here's my fstab example

/dev/disk/by-id/wwn-0x5000c500b67a3636-part1 /mnt/Backup auto nosuid,nodev,nofail,noauto,x-gvfs-show 0 0

Example of My Folder Permissions

edson@edson-OptiPlex-3070:/mnt/Backup/librephotos$ ls -la total 20 drwxrwxrwx 5 edson edson 4096 mai 6 09:02 . drwxrwxrwx 9 edson edson 4096 mai 5 10:54 .. drwxr-xr-x 6 root root 4096 mai 6 09:03 data drwxrwxrwx 6 edson edson 4096 mai 4 00:29 data1 drwxrwxrwx 4 edson edson 4096 mai 5 12:53 pictures

In the above case the folder I'm using as a /data folder and /data1.

As mentioned above you can put the data folder inside the ssd that is the system my database after scanning 40,000 images got a total of 8GB.

edsonsbj commented 2 years ago

Oi, meu disco externo está formatado em ext4. O que você quer dizer com "montar normalmente"?

Vou olhar para os preços dos cartões SD. Pode ser que a solução mais simples seja comprar um de grande capacidade e usar esse drive para backup.

hi did you manage to solve the problem

yotama9 commented 2 years ago

Hi, sorry. I was on vacation in the past two weeks. I'm back home now, and I'm giving this another go.

netfun2000 commented 2 years ago

It's worked from,PI 4B,Docker, 2 usb hdds plugin. boot from usb hdd.

use default lang(en), when i click 'photos' all pic display,but use chinese, it display : 加载中... (loading...) when add or delete pic.

yotama9 commented 2 years ago

Oi, meu disco externo está formatado em ext4. O que você quer dizer com "montar normalmente"? Vou olhar para os preços dos cartões SD. Pode ser que a solução mais simples seja comprar um de grande capacidade e usar esse drive para backup.

hi did you manage to solve the problem

Hi, I've tried this now. Librephotos was installed via docker and nextcloud was installed via snap. Both live on the same r-pi machine and seem to work in more or less default settings (only exception is the use of external drive for both apps). However, the librephotos app cannot see the nextcloud folders. I'm not sure why.

When I go in the librephotos page to the library section, I see a nextcloud login box and I put the relevatn info - 127.0.0.1 for the ip address, and my username and password. Sometimes I can click the "not set" button and sometimes not after I clicked it, I selected the photos folder, but no photo was imported.

edsonsbj commented 2 years ago

Oi, meu disco externo está formatado em ext4. O que você quer dizer com "montar normalmente"? Vou olhar para os preços dos cartões SD. Pode ser que a solução mais simples seja comprar uma grande capacidade e usar esse drive para backup.

ola voce conseguiu resolver o problema

Olá, tentei isso agora. Librephotos foi instalado via docker e nextcloud foi instalado via snap. Ambos vivem na mesma máquina r-pi e parecem funcionar em configurações mais ou menos padrão (única exceção é o uso de unidade externa para ambos os aplicativos). No entanto, o aplicativo librephotos não pode ver as pastas nextcloud. Não tenho certeza por quê.

Quando vou na página librephotos para a seção da biblioteca, vejo uma caixa de login nextcloud e coloco as informações relevantes - 127.0.0.1 para o endereço IP e meu nome de usuário e senha. Às vezes eu posso clicar no botão "não definido" e às vezes não depois de clicar nele, selecionei a pasta de fotos, mas nenhuma foto foi importada.

A similar error occurred where unable to point nextcloud via webdav through librephotos settings,

First alternative

In your .env file, point the photos folder to the nextcloud directory. Usually /var/snap/nextcloud/data, unless you put the files on an external hard drive.

Second alternative

Put the photos in a certain folder where librephotos can access them and add them to external storage in nextcloud settings.

yotama9 commented 2 years ago

Hmm... I'm not sure that any of this will work for me. I want the server to be used also by my family, and not only me. So I need to set a separate photo folder for each user. This means that I cannot use the .env file configuration. About the second option, again, if I understand you correctly, you suggest that the librephotos/photos directory will be shared with nextcloud. But, again, I'm in a situation where one folder is used for several users.

Or maybe I missunderstood your idea.

BTW, my .env file shows this:

# Location of your photos.
myPhotos=/media/BIG/librephotos/pictures

# Internal data of LibrePhotos
data=./librephotos/data

But in librephotos, when I look at the folder to scan, I see only the /data folder. How do I add additional folders to it (if possible)?

edsonsbj commented 2 years ago

Hmm... Eu não tenho certeza se isso vai funcionar para mim. Quero que o servidor seja usado também pela minha família, e não só por mim. Então eu preciso definir uma pasta de fotos separada para cada usuário. Isso significa que não posso usar a configuração do arquivo .env. Sobre a segunda opção, novamente, se entendi corretamente, você sugere que o diretório librephotos/photos seja compartilhado com nextcloud. Mas, novamente, estou em uma situação em que uma pasta é usada para vários usuários.

Ou talvez eu tenha entendido mal a sua ideia.

BTW, meu arquivo .env mostra isso:

# Location of your photos.
myPhotos=/media/BIG/librephotos/pictures

# Internal data of LibrePhotos
data=./librephotos/data

Mas em librephotos, quando olho para a pasta para digitalizar, vejo apenas a pasta /data. Como adiciono pastas adicionais a ele (se possível)?

Also find this limitation of Librephotos where it only recognizes the data folder if you prefer you can go to Admin Area and then to the Skip patterns option and there put the folders that are not for librephotos to scan

An example provides:

/Documents/,/Downloads/

Or if you prefer you can add this in your .env file

# Comma delimited list of patterns to ignore (e.g. "@eaDir,#recycle" for synology devices)
skipPatterns=/Documents/,/Downloads/
edsonsbj commented 2 years ago

On my server, Nextcloud installed via snap has 4 users and they access librephotos.

What did I do:

Folder Name >> Photos

External Storage >> Local

Authentication >> None

Configuration >> /Librephotos/User1

Available for >> User1

In the example above, neither user will have access to the other's images.

yotama9 commented 2 years ago

Hi,

I've followed your suggestions and things seem to work now. I'm left with two points though:

  1. How do I run automatic scanning? The instructions here don't work. I get a django warning:

    django.core.exceptions.ImproperlyConfigured: The SECRET_KEY setting must not be empty.

  2. How do I delete users? Is it only via the SQL commands? I guess that if there is a django interfact I can use its admin?

Thanks a lot for all your help

edsonsbj commented 2 years ago

Oi,

Eu segui suas sugestões e as coisas parecem funcionar agora. Mas fico com dois pontos:

  1. Como executo a verificação automática? As instruções aqui não funcionam. Eu recebo um aviso do django:

django.core.exceptions.ImproperlyConfigured: A configuração SECRET_KEY não deve estar vazia.

  1. Como faço para excluir usuários? É apenas através dos comandos SQL? Eu acho que se houver um interfact django eu posso usar seu admin?

Muito obrigado por toda sua ajuda

Hi, glad it's working.

When running the scan by the command informed I also got the same problem. My solution was to go to settings and then to the scan photos option and then it finds the new images for my user, in your case you have to do this procedure individually for each user.

As for user deletion I'm also interested I haven't found anything yet.