Hey,

so i have a nextcloud docker instance running and i want to set up immich aswell. But the photos are nested inside the nextcloud folder structure and are all owned by www-data user. What is the easiest way to get immich access to them without duplicating them with the proper permissions?

I want the files to exist once.

  • rambos@lemm.ee
    link
    fedilink
    English
    arrow-up
    8
    ·
    10 months ago

    You can add external library path to your nextcloud folder. Then you can see everething in immich, but immich cant eddit or delete files from external library.

    • RandomLegend [He/Him]@lemmy.dbzer0.comOP
      link
      fedilink
      English
      arrow-up
      6
      ·
      10 months ago

      Yeah according to the other comments i’ll go with immich as the main photo storage and just sync them over to nextcloud via external storage connection.

      Thanks!

  • shiftymccool@lemm.ee
    link
    fedilink
    English
    arrow-up
    5
    ·
    edit-2
    10 months ago

    I toyed with this idea, but the directory structures are completely different, and they both keep their own databases. If one updates images, the other database will be out of sync. IMHO, it’s best to keep them separate

  • tofubl
    link
    fedilink
    English
    arrow-up
    4
    ·
    10 months ago

    Nextcloud doesn’t like changes on disk in its own file structure, but you can mount “external storage” where Nextcloud is okay with changes and happily scans the location when you access it (a network share, or a local file path also works; SMB share will probably get you around the permissions problem though.)

    Don’t know about immich as I haven’t used it, but you will probably have to decide on one of the two services to be “in charge” of the files, I think.

    • RandomLegend [He/Him]@lemmy.dbzer0.comOP
      link
      fedilink
      English
      arrow-up
      2
      ·
      10 months ago

      Yeah according to the other comments i’ll go with immich as the main photo storage and just sync them over to nextcloud via external storage connection.

      Thanks!

      • tofubl
        link
        fedilink
        English
        arrow-up
        2
        ·
        10 months ago

        That sounds reasonable. I would do the same.

  • denshirenji@lemmy.world
    link
    fedilink
    English
    arrow-up
    3
    ·
    10 months ago

    I run both, and I do not upload pictures to Nextcloud. I know it doesn’t solve your problem about a Nextcloud instance already running with the photos, but I highly recommend moving over to immich for your photos needs and using it’s file structure. I.E. reuploading the files and deleting them from Nextcloud. If someone does have a better way to do it, I could have used it a few months ago, lol.

    • Scipitie@lemmy.dbzer0.com
      link
      fedilink
      English
      arrow-up
      2
      ·
      10 months ago

      Then you need a third application (e.g. syncthing) to replicate the auto upload functionality of Nextcloud.

      Personally I don’t want to have same functionality in a different stack because of pipeline issues. Doesn’t solve OPs issue I just wanted to point out that your solution might have drawbacks OP didn’t see at first glance :)

      • denshirenji@lemmy.world
        link
        fedilink
        English
        arrow-up
        2
        ·
        10 months ago

        Not sure you do. Maybe you can use one to move the existing files on Nextcloid, but immich has an auto upload feature that works perfectly fine on their android app.

  • JVT038@feddit.nl
    link
    fedilink
    English
    arrow-up
    2
    ·
    10 months ago

    You could try making a symlink, so that there is a ‘file’ in the Nextcloud directory which points to the Immich gallery, although I’m not sure how good it truly works.

  • atzanteol@sh.itjust.works
    link
    fedilink
    English
    arrow-up
    2
    ·
    edit-2
    10 months ago

    This sort of thing can be a bit of a pain.

    chmod -R a+rX /path/to/pictures will grant “world-readable” to things so immich would be able to find them. You’d then want to set something like umask 002 for Nextcloud to create files by default with world readable permission. If it’s running in a container I’m not sure how that is done as I’ve not done it before. You then hope Nextcloud doesn’t set it own file permissions, which it may out of a duty to be more secure.

    If you don’t want files to be world-readable you could create a group that nextcloud and immich share then set group ownership. You may need to set a “sticky” bit to maintain the group ownership and then hope the individual applications don’t override it, which they probably will.

    If you can get both apps to use the same user or group that would probably be best. With the containerized versions of these you might be able to pass in a UID/GID for them to use?

  • WhyAUsername_1@lemmy.world
    link
    fedilink
    English
    arrow-up
    2
    ·
    10 months ago

    Just throwing out an idea, could you create an smb share from nextcloud. Mount that smb in the server that hosts Immich( even if it’s the same server that hosts nextcloud).

    Now, in Immich add an external library. The path of external library could be the smb mount.

    Consider testing this, if it works for you.