PS_START_PAUSED doesn't seem to work

Hey all,

So while troubleshooting my other thread regarding the thumbnails, I was trying to do some testing without automatically processing things on startup. To that end, I set the following environmental variable in compose:

- PS_START_PAUSED=true

However, upon initially saving my settings and clicking start, which I believe is required for the settings files to be written, the processing and import on /ps/library began. I’m wondering if its possible to debug this, or if I’ve simply made a careless error. Here is my updated compose:

  photostructure:
    image: photostructure/server:beta
    container_name: photostructure
    restart: unless-stopped
    networks:
      - $TRAEFIK_NETWORK
    security_opt:
      - no-new-privileges:true
    stop_grace_period: 2m
    volumes:
      - $MEDIADIR/photos:/ps/library
      - $DOCKERDIR/photostructure/tmp:/ps/tmp
      - $DOCKERDIR/photostructure/config:/ps/config
      - $DOCKERDIR/photostructure/logs:/ps/logs
      - $DOCKERDIR/photostructure/previews:/ps/previews
    environment:
      - TZ
      - PUID
      - PGID=100
      - UMASK=002
      - PS_START_PAUSED=true
      - PS_TRANSCODE_VIDEOS=false
      - PS_PREVIEWS_DIR=/ps/previews
    labels:
      - traefik.enable=true
      ## HTTP Routers
      - traefik.http.routers.photostructure-rtr.entrypoints=https
      - traefik.http.routers.photostructure-rtr.rule=Host(`photos.$DOMAINNAME`)
      ## Middlewares
      - traefik.http.routers.photostructure-rtr.middlewares=chain-authelia@file
      ## HTTP Services
      - traefik.http.routers.photostructure-rtr.service=photostructure-svc
      - traefik.http.services.photostructure-svc.loadbalancer.server.port=1787

For reference I am running docker version 20.10.7, compose version 1.29.1, and my compose is version 3.8 - all on Ubuntu server 20.04 LTS.

Thanks very much!

When I used Docker Compose my environment vars were in double-quotes, and they seemed to work:

image

Hey,

Thanks for the suggestion. I had previously used quotes in my compose file around my labels but recently removed them. If you run a docker-compose config, you’ll be able to simulate exactly how compose interprets the file, including substituting in values for variables, etc. as a test.

Just to double check, I did this:

On the left is original and on the right the variables were quoted, so that seems to not be affecting things. I verified in Portainer as well.

I should clarify that the video transcode flag appears to be working, as is my temporary redirect of the previews directory. It specifically only seems to be the start paused? Unless I am misunderstanding how start paused works. I thought I could turn it on, click save on my settings, and it would not begin to scan my folders.

Thanks!

docker-compose.yml should support both dictionaries and arrays:

https://docs.docker.com/compose/compose-file/compose-file-v3/#environment

startPaused causes the main process to set paused to true at launch, which should prevent sync from starting. Is this not working for you?

On initial launch after saving my settings and logging into billing, it appears to still scan all loaded folders after I hit ‘return to library’ the first time when it should be paused.

Oh man: I always tested it with an existing library. I actually had to make a couple changes to make this work as expected, and those changes will be in beta.10 which I hope to release shortly.

Thanks for reporting this!

Also: if you want to see what non-default settings are set, run the info --child-env command. Here’s an example via docker:

$ docker exec -it psdc_photostructure_1 ./photostructure info --child-env
{
  PATH: '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/lib/libraw:/opt/local/sbin:/opt/local/bin',
  HOSTNAME: '5401abcfd5e6',
  TERM: 'xterm',
  PS_EXPOSE_NETWORK_WITHOUT_AUTH: 'true',
  PS_LOG_LEVEL: 'debug',
  UID: '1000',
  GID: '1000',
  NODE_VERSION: '16.3.0',
  YARN_VERSION: '1.22.5',
  HOME: '/root',
  NODE_ENV: 'production',
  VIPS_MIN_STACK_SIZE: '2m',
  VIPSHOME: '/target',
  PS_LOG_COLOR: 'true',
  PS_IS_DOCKER: '1',
  PS_COPY_ASSETS_TO_LIBRARY: 'false',
  PS_LIBRARY_PATH: '/ps/library',
  PS_SCAN_ALL_DRIVES: 'true',
  PS_REPORT_ERRORS: 'true'
}

Looking forward to it! Thank you. Very hand too regarding the non-default settings reporting. Does this seem reasonable or expected? I only set 4 of the PS_ prefixed settings. (start paused through transcode videos)

Thanks!

{
  PATH: '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/lib/libraw:/opt/local/sbin:/opt/local/bin',
  HOSTNAME: '0508ac8d689b',
  TERM: 'xterm',
  TZ: 'America/Los_Angeles',
  PUID: '1026',
  PGID: '1000',
  UMASK: '002',
  PS_START_PAUSED: 'true',
  PS_ORIGINALS_DIR: '/photos',
  PS_MAX_ASSET_FILE_SIZE_BYTES: '5000000000',
  PS_TRANSCODE_VIDEOS: 'false',
  NODE_VERSION: '16.3.0',
  YARN_VERSION: '1.22.5',
  HOME: '/root',
  NODE_ENV: 'production',
  VIPS_MIN_STACK_SIZE: '2m',
  VIPSHOME: '/target',
  PS_LOG_COLOR: 'true',
  PS_IS_DOCKER: '1',
  PS_COPY_ASSETS_TO_LIBRARY: 'true',
  PS_LIBRARY_PATH: '/ps/library',
  PS_SCAN_ALL_DRIVES: 'true',
  PS_REPORT_ERRORS: 'true'
}