From d0d35319c5ad7879de132d8f6de912cc88b32ace Mon Sep 17 00:00:00 2001 From: Pieter Viljoen Date: Fri, 21 Jun 2024 10:42:39 -0700 Subject: [PATCH] readme --- PlexCleaner.code-workspace | 2 ++ README.md | 47 ++++++++++++++++++++++++++++---------- 2 files changed, 37 insertions(+), 12 deletions(-) diff --git a/PlexCleaner.code-workspace b/PlexCleaner.code-workspace index 314a38ca..047d63a9 100644 --- a/PlexCleaner.code-workspace +++ b/PlexCleaner.code-workspace @@ -6,6 +6,7 @@ ], "settings": { "cSpell.words": [ + "adduser", "adpcm", "aencode", "aencoder", @@ -77,6 +78,7 @@ "Muxing", "Nerdbank", "Newtonsoft", + "nonroot", "NONSTRICT", "nostats", "NVENC", diff --git a/README.md b/README.md index 4ce69fd0..415804aa 100644 --- a/README.md +++ b/README.md @@ -126,16 +126,23 @@ Alternatively, install directly on [Windows](#windows), [Linux](#linux), or [Mac Example, run in an interactive shell: -```text +```console # The host "/data/media" directory is mapped to the container "/media" directory # Replace the volume mappings to suit your needs +# Make sure the media file permissions allow writing for the executing user +# adduser --no-create-home --shell /bin/false --disabled-password --system --group users nonroot +# Replace the user account to suit your needs +sudo chown -R nonroot:users /data/media +sudo chmod -R ugo=rwx /data/media + # Run the bash shell in an interactive session docker run \ -it \ --rm \ --pull always \ --name PlexCleaner \ + --user nonroot:users \ --volume /data/media:/media:rw \ docker.io/ptr727/plexcleaner \ /bin/bash @@ -160,25 +167,42 @@ exit Example, run in a screen session: -```text +```console # Start a new screen session screen +# Or attach to the existing screen session +# screen -rd -# Or attach to an existing screen session -screen -r +# Run the monitor command in an interactive session +docker run \ + -it \ + --rm \ + --log-driver json-file --log-opt max-size=10m \ + --pull always \ + --name PlexCleaner \ + --user nonroot:users \ + --env TZ=America/Los_Angeles \ + --volume /data/media:/media:rw \ + docker.io/ptr727/plexcleaner \ + /PlexCleaner/PlexCleaner \ + --logfile /media/PlexCleaner/PlexCleaner.log \ + --logwarning \ + monitor \ + --settingsfile /media/PlexCleaner/PlexCleaner.json \ + --parallel \ + --mediafiles /media/Movies \ + --mediafiles /media/Series +``` -# Make sure the media file permissions allow writing -sudo chown -R nobody:users /data/media -sudo chmod -R u=rwx,g=rwx+s,o=rx /data/media +Example, run as a command: -# Run the process command in an interactive session +```console +# Run the process command docker run \ - -it \ --rm \ --pull always \ - --log-driver json-file --log-opt max-size=10m \ --name PlexCleaner \ - --user nobody:users \ + --user nonroot:users \ --env TZ=America/Los_Angeles \ --volume /data/media:/media:rw \ docker.io/ptr727/plexcleaner \ @@ -187,7 +211,6 @@ docker run \ --logwarning \ process \ --settingsfile /media/PlexCleaner/PlexCleaner.json \ - --parallel \ --mediafiles /media/Movies \ --mediafiles /media/Series ```