How to install PhotoStructure in TrueNAS Scale

pwapwa

Cadet
Joined
Jun 4, 2023
Messages
8
Photo Structure is a great tool for managing photos with a slightly different and more useful feature set for my needs than the Official App called Photoprism.
It looks like it should be installable on TrueNAS Scale as it apparently supports Docker and Docker Compose, however I am relatively new to these tools and don't quite understand the application installation mechanism used by Docker Scale. I can use a command line.
Useful references exist at
For the knowledgable they are likely great overviews - but are not detailed enough for a Docker or Docker Compose newbie (like me) to achieve the goal even if I am a long time programmer.
For example I have a file structure in TrueNAS Scale of say:
source files /mnt/Images/photo_source/
Target repository /mnt/Photos/sorted_photos/ (also referred to as ps/library)
Settings /mnt/Photos/photo_structure/config
Logs /mnt/Photos/photo_structure/logs
tmp /mnt/Photos/photo_structure/tmp

Thanks in advance for any help you may offer me.

Cheers,
Peter
 

sretalla

Powered by Neutrality
Moderator
Joined
Jan 1, 2016
Messages
9,703
Seems like you're 99% of the way there...

Use the Launch Docker Image button and fill in "photostructure/server" for the image repository and "stable" for the image tag.

Then under Storage, Add Host Path Volumes for the locations you've got listed above corresponding to the paths in the container from the docs.

Under Port Forwarding, it looks like you'll want to add a forward of 1787 from the container to something on the host (which must be higher than 9000... take your pick).

Then you can start the container and connect to it on the port you specified on the IP of the TrueNAS host.

Maybe look here if any of that isn't clear enough: https://www.truenas.com/docs/scale/scaletutorials/apps/docker/
 

sretalla

Powered by Neutrality
Moderator
Joined
Jan 1, 2016
Messages
9,703
I also see that TrueCharts have it already in their catalog (still in incubator for now), so may be easier to run their version depending on how far they are along with it.

Or you could try one of the many other already tested apps like photoprism.
 

pwapwa

Cadet
Joined
Jun 4, 2023
Messages
8
Hi sretalla,

Thanks for the tips and encouragement.

I have tried photoprism and got that going. I want the photos imported and sorted into a library of folder structure of /year/month/day and photoprism does not do this. It stops at Year/Month.
I almost got there last night but backed out because I was not confident of the correct settings.
Tried today but got error messages like "use SMB share [EINVAL]" - not sure about the format or whether I should be trying to use Storage or Volumes.
... which I interpret to mean I should be using an SMB share rather than the file path starting at /mnt.

I am working through possible permutations and syntaxes:
1) Any idea what the syntax is for an SMB share or whether I can use a direct files system connection (and if so how)/
2) Also do you whether I should be trying to use "storage" or "volumes" to access the filesystems (on the same TrueNAS Scale machine)?


Cheers,
Peter
 

sretalla

Powered by Neutrality
Moderator
Joined
Jan 1, 2016
Messages
9,703
1) Any idea what the syntax is for an SMB share or whether I can use a direct files system connection (and if so how)/
2) Also do you whether I should be trying to use "storage" or "volumes" to access the filesystems (on the same TrueNAS Scale machine)?
Then under Storage, Add Host Path Volumes for the locations you've got listed above corresponding to the paths in the container from the docs.
As mentioned... using host path volumes is the right way... use the path you need to use on the NAS (like /mnt/Images/photo_source)

You should see it looking like this after you add one:
1686034559765.png


Where the mount path would then be

/ps/library​

 
Last edited:

pwapwa

Cadet
Joined
Jun 4, 2023
Messages
8
Thanks for the additional help. Using Storage is what I tried first - exactly as you suggested. Got the following errors (which I do not understand).

Error: [EINVAL] chart_release_create.hostPathVolumes.0.hos Path: Invalid mount '/mnt/Photos/library' path.
Following service(s) use this path: SMB Share [EINVAL]
chart_release_create.hostPathVolumes.1.hostPath: Invalid mount '/mnt/Photos/photostructure/tmp' path. Following service(s) use this path: SMB Share [EINVAL]
chart_release_create.hostPathVolumes.2.hostPath: Invalid mount '/mnt/Photos/photostructure/config' path. Following service(s) use this path: SMB Share [EINVAL]
chart_release_create.hostPathVolumes.3.hostPath: Invalid mount '/mnt/Photos/photostructure/logs' path. Following service(s) use this path: SMB Share [EINVAL]
chart_release_create.hostPathVolumes.4.hostPath: Invalid mount '/mnt/RaidMaster-RaidZ1/Images/Photos/Source' path. Following service(s) use this path: NFS Share, SMB Share

Which to me looks like "Launch Docker Image" is trying to create mount points that already exist and are used by SMB shares as well. Tried to do a similar thing with Volumes (rather than Storage). Got other errors that don't make sense.

Looked at template in TruesCharts Incubator. https://truecharts.org/charts/incubator/dashboard/
Does not look like there is anything there apart from a heading/placeholder. Even if there was - it is not obvious how to get the template out of the incubator and into my TrueNAS Scale server.

I may just try running a docker YAML script next - but I but as I understand it, using docker may not allow me to access other mount points on the server.

This is confusing and harder than I thought it should be. There is some documentation on Launch Docker Image but unfortunately not enough to for me to understand what a lot of the variables mean and whether they should be used. Can't find a worked example with similar requirements .... Arrrghhh
 

pwapwa

Cadet
Joined
Jun 4, 2023
Messages
8
Observation

The issue may be related to my (not) favorite topic of how to protect your system security where it is only deemed safe if security is so good that no-one can access the files – including you, the owner. Of course, this makes the system safe but utterly unusable = Security Achieved.



I have read a number of posts that suggest linlking from within a TrueNAS Scale container to a filesystem on the local TrueNAS server that has an SMB link connected anywhere in its (parental) path prevents the container from being able to access it. Various things have been tried to overcome this issue including:



  • Disabling Host Path Safety Check – but this could be problematic for all sorts of scary anticipated reasons.
  • Creating a symlink to the path you want and linking to that (did not work for me)
  • Use an SMB mount to the SMB share in the same way SMB mountpoint using the same SMB link mechanism as external connections to TrueNAS use (have not figured how to do this yet – and this does not sound like a very high speed or smart way to do this).
  • Use storage dedicated to the container (not desirable in my case as it just requires a stack more disks and expense)


Frustratingly, I do not know how to solve this and may have to abandon the project as it is too hard for my skill set and is taking too long. Any suggestions very much appreciated.
 

pwapwa

Cadet
Joined
Jun 4, 2023
Messages
8
If I use Truenas Scale mounts which do not have SMB shares assigned to them, then I can create a Photostructure app which states that it is I can’t get open a shell or a web connection/portal. No idea how to debug this unless it is to try different configurations. Status is Deploying Up to Date.
Configuration is
Photo Structure Files
/ps/library /mnt/Photos/originals Where sorted photos go
/ps/tmp /mnt/Photos/photostructure/tmp Cache and working files
/ps/config /mnt/Photos/photostructure/config Settings
/ps/logs /mnt/Photos/photostructure/logs Logs
Setup Steps for TrueNas Scale
  1. Application Name photostructure
  2. Version 2304.0.7 (Default and Can’t Change)
  3. Container Images
    a. Docker Image
    i. Image Repository photostructure/server
    ii. Image Tag stable
  4. Image Pull Policy Only pull image if not present on host
  5. Container Entrypoint
    a. Container CMD None (Default)
    b. Container Args None (Default)
    c. Container Environmental Variables None (Default)
  6. Networking
    a. Add external interfaces None (default)
    b. DNS Policy None (default)
    Use Default DNS Policy where Pod will inherit the name resolution configuration from the node.
    c. Nameservers None (Default)
    d. Searches None (Default)
    e. DNS Options None (Default)
  7. Provide access to node network namespace for the workload (Not Checked)
  8. Port Forwarding
    a. Container Port 1787
    b. Node Port 9787
    c. Protocol TCP Protocol
  9. Storage
Mount Path Dataset Name What for
/mnt/Photos/library /ps/library Where sorted photos go
/mnt/Photos/photostructure/tmp /ps/tmp Cache and working files
/mnt/Photos/photostructure/config /ps/config Settings
/mnt/Photos/photostructure/logs /ps/logs Logs
/mnt/Photos/Source /ps/source Photo source
  1. Memory Backed Volumes
    a. None - default
  2. Volumes
    a. None - Default all settings
  3. Workload Details
    a. Enable TTY Not Checked
    b. Enable STDIN Not Checked
    c. Security Context
    i. Priviledged Node Not Checked
  4. Capabilities
    a. None – Default
  5. Configure Container User and GroupID – Not Checked
    a. Run Container as User 568
    b. Run Container as Group 568
  6. Scaling / Upgrade Policy
    a. Resource Reservation
    b. Update Strategy
    i. “Kill existing pods before creating new ones” (Default)
  7. Resource Reservation
    a. GPU Configuration
    i. GPU Resource (nvidia.com/gpu)
  1. Allocate 1 nvidia.com/gpu GPU
  1. Resource Limits
    a. Enable pod resource limits
  2. Portal Configuration
    a. Enable WebUI Portal (Only supported in TRUENAS Scale Bluefin)
  3. WebUIPortal
    a. Portal Name
    i. Web Portal
  4. Protocol for Portal
    a. HTTP Protocol
  5. Use Node IP for Portal IP/Domain
    a. Port 16000
 

sretalla

Powered by Neutrality
Moderator
Joined
Jan 1, 2016
Messages
9,703
  1. Portal Configuration
    a. Enable WebUI Portal (Only supported in TRUENAS Scale Bluefin)
  2. WebUIPortal
    a. Portal Name
    i. Web Portal
  3. Protocol for Portal
    a. HTTP Protocol
  4. Use Node IP for Portal IP/Domain
    a. Port 16000
I don't understand what you're doing here... it doesn't seem related at all to the actual app:
Port Forwarding
a. Container Port 1787
b. Node Port 9787
c. Protocol TCP Protocol
Which should mean that you connect on the NAS IP on port 9787 to see the interface.
 

pwapwa

Cadet
Joined
Jun 4, 2023
Messages
8
Thanks agin for advice. Tried that (yes you were right - I did not understand the relationship between Node Port and previous settings). Still cannot connect - but I think it is getting closer.
 

sretalla

Powered by Neutrality
Moderator
Joined
Jan 1, 2016
Messages
9,703
OK, so it's saying that it's running, but you can't connect to http://ip.of.NAS:9787/ ? or are you trying https (or are both no good?)
 

pwapwa

Cadet
Joined
Jun 4, 2023
Messages
8
I appreciate your continued interest in helping.
Re: PhotoStructure
1) I can't open a shell or connect to port 9787.
2) Restarted the system - Application PhotoStructure is stuck at Deploying
3) Noticed Although application name is protostructure, when I try and open a shell I am offered a panel that says
pods: photostructure-ix-chart-7b45b4b66b-kqbhp
container: ix-chart
These are the only options offered. Result of attempt to open = warning: Your user does not have sudo privileges so /usr/local/bin/k3s command will runon your behalf. This might cause permission issues.error: unable to upgrade connection: container not found ("ix-chart")
4) Tried to list logs:
Pods: photostructure-ix-chart-7b45b4b66b-kqbhp
Container: ix-chart
Tail: 500
Results in: No logs yet
Re: Photoprism
1) Noticed its app panel offered an update. Foolishly I did the update and now it is also stuck at deploying.
2) While it was working before the update - it is not working now.
3) Now cannot connect to shell or app on previously working port
4) Tried looking at logs:
Pods: photoprism-5f8cbc9c7c-4lpgr
Container: No Options
Tail: 500
results in: can't choose logs

My guess is that PhotoStructure never started and the update killed PhotoPrism app.
Think I will delete apps and try again to install both from scratch.
Is there a way of seeing a log on why the apps are stuck at deploying?
 
Top