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

Support watching the file system #7

Closed
skutter-de opened this issue Feb 6, 2022 · 23 comments
Closed

Support watching the file system #7

skutter-de opened this issue Feb 6, 2022 · 23 comments

Comments

@skutter-de
Copy link

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.

@alextran1502
Copy link
Contributor

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 :)

@ippocratis
Copy link

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

@alextran1502
Copy link
Contributor

@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
Copy link
Contributor

@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.

@ippocratis
Copy link

@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?

@alextran1502
Copy link
Contributor

@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

@ippocratis
Copy link

ippocratis commented Mar 9, 2022

@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  | 

@alextran1502
Copy link
Contributor

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

@ippocratis
Copy link

@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:

@alextran1502
Copy link
Contributor

@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

@ippocratis
Copy link

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

@spupuz
Copy link

spupuz commented May 16, 2022

@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

@tokenwizard
Copy link

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

@alextran1502
Copy link
Contributor

alextran1502 commented Jun 22, 2022

@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(

@tokenwizard
Copy link

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.

@nk950357
Copy link

nk950357 commented Sep 4, 2022

@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?

@ashishjullia
Copy link

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.

@tazzytazzy
Copy link

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!

@alextran1502
Copy link
Contributor

I am starting the discussion for the implementation here #1006

@etnoy
Copy link
Contributor

etnoy commented Jul 5, 2023

Will be solved when #3124 is merged

@etnoy
Copy link
Contributor

etnoy commented Sep 20, 2023

Fixed in #3124

@etnoy etnoy closed this as completed Sep 20, 2023
@github-project-automation github-project-automation bot moved this from 🚧 Tasks to ✅ Done in Immich Development Sep 20, 2023
@daniele-athome
Copy link
Contributor

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

@jrasm91
Copy link
Contributor

jrasm91 commented Sep 20, 2023

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.

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

No branches or pull requests