Skip to content

Docker: Remove incorrect permission check for storage folder on startup #2334

Description

@lastzero

See #2328 (comment):

I have been made some test and is a problem with the debian bookworm version.
My test:
I pulled and run an interative sesion to a bare debian:bookworm:

sudo docker run -i -t debian:bookworm bash

Then just move to the home and create the audit.sh file with the following data:

#!/bin/bash

STORAGE_PATH=${PHOTOPRISM_STORAGE_PATH:-storage}

set -e

# create directory if not exists
mkdir -p "${STORAGE_PATH}" || (echo "Failed creating storage folder \"$STORAGE_PATH\", see $DOC_URL" 1>&2; exit 1)

# check directory permissions
[[ -w "${STORAGE_PATH}" ]] || \
  (echo "Storage folder \"$STORAGE_PATH\" is not writable, see $DOC_URL" 1>&2; exit 1)

# create and delete test file
(touch "${STORAGE_PATH}/is-writable" 2>/dev/null && rm "${STORAGE_PATH}/is-writable") || \
  (echo "Failed creating test file in storage folder, see $DOC_URL" 1>&2; exit 1)

Then chmod a+x audit.sh and run it

It fails with the permission error.

However if I made the exact same test inside a bullseye that I also fetch with:

sudo docker run -i -t debian:bullseye bash

It works without problem:

root@37d540302cd8:/home#chmod a+x audit.sh
root@37d540302cd8:/home# ./audit.sh
root@37d540302cd8:/home# ls
audit.sh  storage
root@37d540302cd8:/home#

Metadata

Metadata

Assignees

Labels

releasedAvailable in a stable releasesetupDocker images, Helm charts, scripts, and Compose examples

Type

No type

Fields

No fields configured for issues without a type.

Projects

Status
Release 🌈

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions