From 03c1d35271cbfa05c48ceac9624e5889d0cc5dc0 Mon Sep 17 00:00:00 2001 From: Stefan Maierhofer Date: Mon, 15 Aug 2022 15:30:11 +0200 Subject: [PATCH] updte README.md --- README.md | 25 ++++++++++++++++++++++--- src/Screenshotr.App/Program.cs | 2 +- 2 files changed, 23 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 8922079..04922e5 100644 --- a/README.md +++ b/README.md @@ -68,7 +68,8 @@ Usage: Commands: import [-t ] * [-x ] [--addRandomLabels] list [--skip ] [--take ] - tail + tags + tail [-v|--verbose] apikeys create -d [-r ]+ [--days ] Available roles are: admin, importer @@ -78,17 +79,35 @@ Usage: disconnect Examples: - screenshotr connect -e "http://localhost" -k "7d10785f41e8..." + screenshotr connect -e "https://localhost" -k "7d10785f41e8..." screenshotr disconnect screenshotr import -t "mytag some-other-tag" img.jpg /data/pictures/ screenshotr list --skip 10 --take 5 - screenshotr tail + screenshotr tags + screenshotr tail -v screenshotr apikeys create -d "alice's import key" -r "importer" screenshotr apikeys delete "2442d075d2f3888..." screenshotr apikeys list ``` +# Config +## Data directory +By default, the screenshotr server will store all data in `./data`. +You can set a custom directory by setting the `Screenshotr:Data` environment variable, e.g. +``` +set Screenshotr:Data=/my/screenshots/data/dir +``` + +## User Name (from reverse proxy) +Specify the env variable `Screenshotr:HttpHeaderDisplayName=` to extract and display the current user's name from an HTTP header. + +This can be used, if you run a reverse proxy sending the current user's display name along with the requests. + +E.g. if your reverse proxy adds an HTTP header named `X-Display-Name`, then you would specify +``` +set Screenshotr:HttpHeaderDisplayName=X-Display-Name +``` # Docker diff --git a/src/Screenshotr.App/Program.cs b/src/Screenshotr.App/Program.cs index a60317a..74ad2da 100644 --- a/src/Screenshotr.App/Program.cs +++ b/src/Screenshotr.App/Program.cs @@ -10,7 +10,7 @@ Console.WriteLine($"[ScreenshotrService] init ..."); -var screenshotrBaseDir = builder.Configuration["Screenshotr:Data"]; +var screenshotrBaseDir = builder.Configuration["Screenshotr:Data"] ?? "./data"; var corsOrigins = builder.Configuration["Screenshotr:CorsOrigins"]; var enableHttpLogging = bool.TryParse(builder.Configuration["Screenshotr:EnableHttpLogging"], out var x) && x; ScreenshotrApp.HttpHeaderUserId = builder.Configuration["Screenshotr:HttpHeaderUserId"];