immich icon indicating copy to clipboard operation
immich copied to clipboard

Support watching the file system

Open Gaming4LifeDE opened this issue 2 years ago • 20 comments

As I already mentioned on Reddit, some people will have their photo volume mounted on their desktops via SMB or similar. When adding a picture there (let's say, when dumping from a DSLR), immich should watch the file system and index new files automatically.

Gaming4LifeDE avatar Feb 06 '22 15:02 Gaming4LifeDE

I was hoping to do this through a web interface instead, so the flow is unified and to avoid the dependence on different file system architecture. I will put this as enhancement for the next milestone of the app :)

alextran1502 avatar Feb 06 '22 15:02 alextran1502

not sure if Gaming4LifeDE meant the same thing but an indexer for local files on server is absolutely missing and would be usefull if not that maybe some sort of importer , like a way to import photos already on the machine the server is running into immich

ippocratis avatar Feb 12 '22 13:02 ippocratis

@ippocratis Yes, it is exactly what @Gaming4LifeDE means. I am leaning toward an importer with a web interface though, so I can leverage the current APIs on the server-side. Once I got the mobile app stable, this is one of the first feature I am going to work on next

alextran1502 avatar Feb 12 '22 17:02 alextran1502

@Gaming4LifeDE , @ippocratis

I've created a CLI tool to upload images/video from your local machine/server to Immich

You can take a look and test here https://github.com/alextran1502/immich_cli

Please rebuild the server before testing, I added some additional helper functions on the server to accommodate the CLI tool

Let me know how it goes.

alextran1502 avatar Mar 07 '22 17:03 alextran1502

@Gaming4LifeDE , @ippocratis

I've created a CLI tool to upload images/video from your local machine/server to Immich

You can take a look and test here https://github.com/alextran1502/immich_cli

Please rebuild the server before testing, I added some additional helper functions on the server to accommodate the CLI tool

Let me know how it goes.

recloned the immich repo and tried to rebuild i'm having tensorflow errors again looked at package.json there are no tensorflow dependencies where should i look?

ippocratis avatar Mar 08 '22 21:03 ippocratis

@ippocratis I am running TensorFlow in its own service, you can remove/commented out immich_tf_fastapi in the docker-compose file to not run it.

image

alextran1502 avatar Mar 08 '22 22:03 alextran1502

@alextran1502 comented the above lines in docker-compose.yml cntainers builds but i cant add a user with the curl command

proxy_nginx             | 2022/03/09 18:55:02 [error] 24#24: *5 connect() failed (111: Connection refused) while connecting to upstream, client: 192.168.1.24, server: , request: "POST /auth/signUp HTTP/1.1", upstream: "http://xxxxxxxxx:3000/auth/signUp", host: "192.168.1.24:2283"

also varus redis errors

docker-immich_server-1  | src/api-v1/communication/communication.gateway.ts:1:93 - error TS2307: Cannot find module '@nestjs/websockets' or its corresponding type declarations.
docker-immich_server-1  | 
docker-immich_server-1  | 1 import { OnGatewayConnection, OnGatewayDisconnect, WebSocketGateway, WebSocketServer } from '@nestjs/websockets';
docker-immich_server-1  |                                                                                               ~~~~~~~~~~~~~~~~~~~~
docker-immich_server-1  | 
docker-immich_server-1  | src/api-v1/communication/communication.gateway.ts:3:32 - error TS2307: Cannot find module 'socket.io' or its corresponding type declarations.
docker-immich_server-1  | 
docker-immich_server-1  | 3 import { Socket, Server } from 'socket.io';
docker-immich_server-1  |                                  ~~~~~~~~~~~
docker-immich_server-1  | 
docker-immich_server-1  | src/main.ts:11:27 - error TS2345: Argument of type 'RedisIoAdapter' is not assignable to parameter of type 'WebSocketAdapter<any, any, any>'.
docker-immich_server-1  |   Type 'RedisIoAdapter' is missing the following properties from type 'WebSocketAdapter<any, any, any>': create, bindClientConnect, bindMessageHandlers, close
docker-immich_server-1  | 
docker-immich_server-1  | 11   app.useWebSocketAdapter(new RedisIoAdapter(app));
docker-immich_server-1  |                              ~~~~~~~~~~~~~~~~~~~~~~~
docker-immich_server-1  | 
docker-immich_server-1  | src/main.ts:11:46 - error TS2554: Expected 0 arguments, but got 1.
docker-immich_server-1  | 
docker-immich_server-1  | 11   app.useWebSocketAdapter(new RedisIoAdapter(app));
docker-immich_server-1  |                                                 ~~~
docker-immich_server-1  | 
docker-immich_server-1  | src/middlewares/redis-io.adapter.middleware.ts:1:27 - error TS2307: Cannot find module '@nestjs/platform-socket.io' or its corresponding type declarations.
docker-immich_server-1  | 
docker-immich_server-1  | 1 import { IoAdapter } from '@nestjs/platform-socket.io';
docker-immich_server-1  |                             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
docker-immich_server-1  | 
docker-immich_server-1  | src/middlewares/redis-io.adapter.middleware.ts:3:31 - error TS2307: Cannot find module 'socket.io' or its corresponding type declarations.
docker-immich_server-1  | 
docker-immich_server-1  | 3 import { ServerOptions } from 'socket.io';
docker-immich_server-1  |                                 ~~~~~~~~~~~
docker-immich_server-1  | 
docker-immich_server-1  | src/middlewares/redis-io.adapter.middleware.ts:4:31 - error TS2307: Cannot find module 'socket.io-redis' or its corresponding type declarations.
docker-immich_server-1  | 
docker-immich_server-1  | 4 import { createAdapter } from 'socket.io-redis';
docker-immich_server-1  |                                 ~~~~~~~~~~~~~~~~~
docker-immich_server-1  | 
docker-immich_server-1  | src/modules/image-optimize/image-optimize.processor.ts:11:33 - error TS2307: Cannot find module '@nestjs/websockets' or its corresponding type declarations.
docker-immich_server-1  | 
docker-immich_server-1  | 11 import { WebSocketServer } from '@nestjs/websockets';
docker-immich_server-1  |                                    ~~~~~~~~~~~~~~~~~~~~
docker-immich_server-1  | 
docker-immich_server-1  | src/modules/image-optimize/image-optimize.processor.ts:12:50 - error TS2307: Cannot find module 'socket.io' or its corresponding type declarations.
docker-immich_server-1  | 
docker-immich_server-1  | 12 import { Socket, Server as SocketIoServer } from 'socket.io';
docker-immich_server-1  |                                                     ~~~~~~~~~~~
docker-immich_server-1  | 
docker-immich_server-1  | [7:01:34 PM] Found 9 errors. Watching for file changes.
docker-immich_server-1  | 

ippocratis avatar Mar 09 '22 18:03 ippocratis

@ippocratis can you show me your docker-compose file?

alextran1502 avatar Mar 09 '22 19:03 alextran1502

@alextran1502

version: "3.8"

services:
  immich_server:
    image: immich-server-dev:1.0.0
    build:
      context: ../server
      target: development
      dockerfile: ../server/Dockerfile
    entrypoint: ["/bin/sh", "./entrypoint.sh"]
    # command: npm run start:dev
    expose:
      - "3000"
    volumes:
      - ../server:/usr/src/app
      - ${UPLOAD_LOCATION}:/usr/src/app/upload
      - /usr/src/app/node_modules
    env_file:
      - .env
    depends_on:
      - redis
      - database
    networks:
      - immich_network

  redis:
    container_name: immich_redis
    image: redis:6.2
    networks:
      - immich_network

  database:
    container_name: immich_postgres
    image: postgres:14
    env_file:
      - .env
    environment:
      POSTGRES_PASSWORD: ${DB_PASSWORD}
      POSTGRES_USER: ${DB_USERNAME}
      POSTGRES_DB: ${DB_DATABASE_NAME}
      PG_DATA: /var/lib/postgresql/data
    volumes:
      - pgdata:/var/lib/postgresql/data
    ports:
      - 5432:5432
    networks:
      - immich_network

  nginx:
    container_name: proxy_nginx
    image: nginx:latest
    volumes:
      - ./settings/nginx-conf:/etc/nginx/conf.d
    ports:
      - 2283:80
      - 2284:443
    logging:
      driver: none
    networks:
      - immich_network
    depends_on:
      - immich_server

#  immich_tf_fastapi:
#    container_name: immich_tf_fastapi
#    image: tensor_flow_fastapi:1.0.0
#    restart: always
#    command: uvicorn app.main:app --proxy-headers --host 0.0.0.0 --port 8000 --reload
#    build:
#      context: ../machine_learning
#      target: cpu
#      dockerfile: ../machine_learning/Dockerfile
#    volumes:
#      - ../machine_learning/app:/code/app
#      - ${UPLOAD_LOCATION}:/code/app/upload
#    ports:
#      - 2285:8000
#    expose:
#      - "8000"
#    depends_on:
#      - database
#    networks:
#      - immich_network

networks:
  immich_network:
volumes:
  pgdata:

ippocratis avatar Mar 09 '22 19:03 ippocratis

@ippocratis can you use this command to run docker-compose

'docker-compose -f ./docker/docker-compose.yml up --build -V'

Since there is new update in package.json, docker needs to copy and rebuild the node_modules

I believe that should solve the problem

alextran1502 avatar Mar 09 '22 19:03 alextran1502

@alextran1502 Yep that was it It was pretty clear in the readme actualy 'force rebuild node modules after installing new packages' Sorry

ippocratis avatar Mar 09 '22 20:03 ippocratis

@ippocratis can you use this command to run docker-compose

'docker-compose -f ./docker/docker-compose.yml up --build -V'

Since there is new update in package.json, docker needs to copy and rebuild the node_modules

I believe that should solve the problem

i try that but still proxy_nginx ports are not available

spupuz avatar May 16 '22 15:05 spupuz

I, too, would love to see this as a way to have Immich work with NextCloud uploads. Since I am already automatically backing up my mobile photos to my NC instance, it would be great if I could point Immich to that folder and let it do its thing when a new photo is added to NC.

If I'm understanding, I can add my NC Photos folder where it says ${UPLOAD_LOCATION} in the docker-compose.yml shown above and that would allow what I'm trying to accomplish?

volumes: - ../server:/usr/src/app - ${NEXTCLOUD_PHOTOS_FOLDER}:/usr/src/app/upload - /usr/src/app/node_modules

tokenwizard avatar Jun 22 '22 13:06 tokenwizard

@tokenwizard Immich doesn't watch for files in the UPLOAD_LOCATION. It is the location where the server put the asset uploaded from your phone and from the web.

There is currently no plan to integrate with NextCloud in the foreseeable future as we are focusing on building out a fully functional platform

However, Immich has a CLI tool (out-of-date at the moment with the recent releases) that can perform bulk upload to Immich server so you can move everything to Immich by that way(

alextran1502 avatar Jun 22 '22 14:06 alextran1502

Ah, ok. I already have a functioning setup with NC handling all my automatic backups and PhotoView indexing my NC folder. I was just hoping to take advantage of Immich's better AI/Recognition services.

Thanks for the reply.

tokenwizard avatar Jun 22 '22 14:06 tokenwizard

@tokenwizard Immich doesn't watch for files in the UPLOAD_LOCATION. It is the location where the server put the asset uploaded from your phone and from the web.

There is currently no plan to integrate with NextCloud in the foreseeable future as we are focusing on building out a fully functional platform

However, Immich has a CLI tool (out-of-date at the moment with the recent releases) that can perform bulk upload to Immich server so you can move everything to Immich by that way(

So immich won't have ability that manages existing folder's photos, right? If I have much of photos in existing nas folder, immich needs uses CLI to uplod these photos into immich's upload folder to manage them, right?

nk950357 avatar Sep 04 '22 18:09 nk950357

Did you guys ever find a solution which can be a workaround for this and doesn't require having duplicates of same files one in your already existing folder/directory and one in the immich's upload directory.

ashishjullia avatar Nov 05 '22 17:11 ashishjullia

I just found this app, it looks amazing! However, I'm already using Folder Sync Pro on our android devices and manage our photos from home using DigiKam. Any changes get pushed back to our phones.

It would be absolutely amazing to be able to have this app use a couple of local directories and make them available thru Immich.

If you are going to implement this, hopefully do it in a way that allow multiple directories. For example: /home/username1/Pictures /home/username2/Pictures /home/shared/Pictures

This is currently our workflow and it's been working for us.

Love your work and doing an amazing job!

tazzytazzy avatar Nov 17 '22 17:11 tazzytazzy

I am starting the discussion for the implementation here #1006

alextran1502 avatar Nov 22 '22 13:11 alextran1502

Will be solved when https://github.com/immich-app/immich/pull/3124 is merged

etnoy avatar Jul 05 '23 15:07 etnoy

Fixed in #3124

etnoy avatar Sep 20 '23 11:09 etnoy

Wasn't this issue about using a notification mechanism (e.g. inotify on Linux)?

daniele-athome avatar Sep 20 '23 12:09 daniele-athome

This issue and associated discussion were about a lot of things, but all generally related to the approach of auto import into immich without uploading/copying. Basically the new library approach. IMO this can stay closed and we can open a new request for library improvements like automatic change detection, etc., which can now be revisited in the context of libraries.

jrasm91 avatar Sep 20 '23 13:09 jrasm91