hooram / ownphotos

Self hosted alternative to Google Photos
MIT License
2.77k stars 233 forks source link

Small face thumbnail missing on "Label Faces" modal #65

Open isleshocky77 opened 5 years ago

isleshocky77 commented 5 years ago

When on the "Label Faces" modal, the small face thumbnail on the top left is missing. When inspecting it looks like this:

<img auth="[object Object]" height="40" width="40" src="http://backend/media/faces/c5291c1156b701f0b5d4ff2cc10545a74_0.jpg" class="ui image">

Note http://backend

I'm running this by checking out the dev branch and using docker-compose up. I've tweaked the docker-compose.yml file only by changing all 3000 to 3007 and updating BACKEND_HOST to machine.local:3007. I'm wondering if the proxy is handling this correctly with 3000 being hard-coded into the nginx config file.

Note 2 If I replace "http://backend/media/faces/c5291c1156b701f0b5d4ff2cc10545a74_0.jpg" with "http://machine.local:3007/media/faces/c5291c1156b701f0b5d4ff2cc10545a74_0.jpg", the file does exist correctly. I'm not seeing this issue on any of the other images in the system so far.

guysoft commented 5 years ago

Can you post your doker-compose.yml? you can remove the passwords if that is an issue.

isleshocky77 commented 5 years ago
version: '2'

services:

  proxy:
    image: guysoft/ownphotos-proxy
    tty: true
    container_name: ownphotos-proxy
    restart: always
    links:
      - "backend:backend"
      - "frontend:frontend"
    ports:
      - "3007:80"

  ownphotos-db:
    image: postgres
    container_name: ownphotos-db
    restart: always
    environment:
    # This db password is internal, you can change it if you want, but also change it in ownphotos-backend container
      - POSTGRES_PASSWORD=AaAa1234
      - POSTGRES_DB=ownphotos
    volumes:
      - ownphotos-data:/var/lib/postgresql/data

  frontend:
    container_name: ownphotos-frontend
    image: guysoft/ownphotos-frontend:dev
    tty: true
    environment:
       # This is the path to the backend host public facing. if your website is ownphotos.org then this should be "ownphotos.org".
       # Default here is assuming you are running on localhost on port 3000 as given in ownphotos-proxy service
      - BACKEND_HOST=ducks.local:3007
    links:
      - "backend:backend"

  backend:
    image: hooram/ownphotos:dev
    # For development uncomment this and comment the image name above
    #build: .
    container_name: ownphotos-backend
    volumes:
      # Your photos go here
      - $HOME/Pictures/:/data
      - media:/code/media
    environment:
      - SECRET_KEY=change_meme
      # This is backend host from within the service, you dont need to change this
      - BACKEND_HOST=backend
      - ADMIN_EMAIL=admin@example.com
      - ADMIN_USERNAME=admin
      # Change your admin password!
      - ADMIN_PASSWORD=admin
      - DEBUG=true
      - DB_BACKEND=postgresql
      - DB_NAME=ownphotos
      - DB_USER=postgres
      # This db password is internal, you can change it if you want, but also change it in ownphotos-db container
      - DB_PASS=AaAa1234
      - DB_HOST=ownphotos-db
      - DB_PORT=5432
      - REDIS_HOST=ownphotos-redis
      - REDIS_PORT=6379
      - MAPBOX_API_KEY=CHANGE_MEAAAA
    links:
      - "ownphotos-db:ownphotos-db"
      - "ownphotos-redis:ownphotos-redis"

  ownphotos-redis:
    image: redis
    container_name: ownphotos-redis

volumes:
  ownphotos-data:
  media:
guysoft commented 5 years ago

1. It looks like you set ducks.local to be your hostname, so indeed "http://ducks.local:3007/media/faces/c5291c1156b701f0b5d4ff2cc10545a74_0.jpg" should point there. You should access the gui using based on your current settings as: http://ducks.local:3007

If you want that to be reached by backend you need to set there backend. 2. Port 3000 is what is used internally between containers, so not relevant. Should work with 3007 and works for me on 80 as well.

wtrdk commented 5 years ago

At my install the URL for a 'Label Faces' image is this:

http://backend/media/faces/45e70083ad43f0fa89022c889adb0f973_1.jpg

That doesn't seem right, but what do I have to change in the docker-compose.yml? Does it have anything to do with this setting? (I'll try to test this later and update my findings here)

- BACKEND_HOST=backend

My docker-compose.yml:

version: '2'

services:

  proxy:
    image: guysoft/ownphotos-proxy
    tty: true
    container_name: ownphotos-proxy
    restart: always
    links:
      - "backend:backend"
      - "frontend:frontend"
    ports:
      - "3000:80"

  ownphotos-db:
    image: postgres
    container_name: ownphotos-db
    restart: always
    environment:
    # This db password is internal, you can change it if you want, but also change it in ownphotos-backend container
      - POSTGRES_PASSWORD=AaAa1234
      - POSTGRES_DB=ownphotos
    volumes:
      - ownphotos-data:/var/lib/postgresql/data

  frontend:
    container_name: ownphotos-frontend
    image: guysoft/ownphotos-frontend:dev
    tty: true
    environment:
       # This is the path to the backend host public facing. if your website is ownphotos.org then this should be "ownphotos.org".
       # Default here is assuming you are running on localhost on port 3000 as given in ownphotos-proxy service
       - BACKEND_HOST=ownphotos.mydomain.nl
    links:
      - "backend:backend"

  backend:
    image: hooram/ownphotos:dev
    # For development uncomment this and comment the image name above
    #build: .
    container_name: ownphotos-backend
    volumes:
      # Your photos go here
      - $HOME/Backups/Main/:/data
      - media:/code/media
    environment:
      - SECRET_KEY=f4i39N81
      # This is backend host from within the service, you dont need to change this
      - BACKEND_HOST=backend
      - ADMIN_EMAIL=xxxx@xxxx.xx
      - ADMIN_USERNAME=xxxxxx
      # Change your admin password!
      - ADMIN_PASSWORD=xxxxxxxxxx
      - DEBUG=true
      - DB_BACKEND=postgresql
      - DB_NAME=ownphotos
      - DB_USER=postgres
      # This db password is internal, you can change it if you want, but also change it in ownphotos-db container
      - DB_PASS=XXXXxxxxXX
      - DB_HOST=ownphotos-db
      - DB_PORT=5432
      - REDIS_HOST=ownphotos-redis
      - REDIS_PORT=6379
      - MAPBOX_API_KEY=<My key!> 
    links:
      - "ownphotos-db:ownphotos-db"
      - "ownphotos-redis:ownphotos-redis"

  ownphotos-redis:
    image: redis
    container_name: ownphotos-redis

  adminer:
    image: adminer
    restart: always
    ports:
      - 8980:8080
    container_name: ownphotos-adminer
    links:
      - "ownphotos-db:db"

volumes:
  ownphotos-data:
  media:
thechickenmoo commented 5 years ago

I'll chime in and say I'm having the same issue. The only thing I can see that mentions "backend" in my compose file is the environment setting under the comment that says: " # This is backend host from within the service, you dont need to change this" I tried changing it anyway but (as you can guess) it didn't work correctly so I changed it back.

I'll post my docker-compose.yml below. Please let me know if there is something I've set wrong or etc.

version: '3'

services:

  proxy:
    image: guysoft/ownphotos-proxy
    tty: true
    container_name: ownphotos-proxy
    restart: unless-stopped
    environment:
      - VIRTUAL_HOST=photos.thechickenmoo.com
      - VIRTUAL_PORT=80
      - LETSENCRYPT_HOST=photos.thechickenmoo.com
      - LETSENCRYPT_EMAIL=XXXXXXXXXX
    links:
      - "backend:ownphotos-backend"
      - "frontend:ownphotos-frontend"
    expose:
      - '80'
      - '443'
    networks:
      - nginx-proxy
      - default

  ownphotos-db:
    image: postgres
    container_name: ownphotos-db
    restart: unless-stopped
    environment:
    # This db password is internal, you can change it if you want, but also change it in ownphotos-backend container
      - POSTGRES_PASSWORD=XXXXXXXXXX
      - POSTGRES_DB=XXXXXXXXXX
    volumes:
      - ownphotos-data:/var/lib/postgresql/data
    networks:
      - default

  frontend:
    container_name: ownphotos-frontend
    image: guysoft/ownphotos-frontend:dev
    tty: true
    environment:
       # This is the path to the backend host public facing. if your website is ownphotos.org then this should be "ownphotos.org".
       # Default here is assuming you are running on localhost on port 3000 as given in ownphotos-proxy service
       - BACKEND_HOST=photos.thechickenmoo.com
    links:
      - "backend:backend"
    networks:
      - default

  backend:
    image: hooram/ownphotos:dev
    # For development uncomment this and comment the image name above
    #build: .
    container_name: ownphotos-backend
    volumes:
      # Your photos go here
      - /mnt/pmlibrary/Pictures:/data:ro
      - media:/code/protected_media
    environment:
      - SECRET_KEY=change_meme
      # This is backend host from within the service, you dont need to change this
      - BACKEND_HOST=backend
      - ADMIN_EMAIL=XXXXXXXXXX
      - ADMIN_USERNAME=XXXXXXXXXX
      # Change your admin password!
      - ADMIN_PASSWORD=XXXXXXXXXX
      - DEBUG=true
      - DB_BACKEND=postgresql
      - DB_NAME=ownphotos
      - DB_USER=postgres
      # This db password is internal, you can change it if you want, but also change it in ownphotos-db container
      - DB_PASS=XXXXXXXXXX
      - DB_HOST=ownphotos-db
      - DB_PORT=5432
      - REDIS_HOST=ownphotos-redis
      - REDIS_PORT=6379
      - MAPBOX_API_KEY=pk.eyJ1IjoidGhlY2hpY2tlbm1vbyIsImEiOiJjanMzNWUzcjUxd2tqM3lvOWl2a3U3d3htIn0.2KdSwmZrvp5UtXAXzrVA4Q
    links:
      - "ownphotos-db:ownphotos-db"
      - "ownphotos-redis:ownphotos-redis"
    networks:
      - default

  ownphotos-redis:
    image: redis
    container_name: ownphotos-redis
    networks:
      - default

  adminer:
    image: adminer
    restart: always
    ports:
      - 8080:8080
    container_name: ownphotos-adminer
    links:
      - "ownphotos-db:db"
    networks:
     - default

volumes:
  ownphotos-data:
  media:
networks:
  nginx-proxy:
    external: true
  default: