CLI: Update usage descriptions for Boolean command flags

Signed-off-by: Michael Mayer <michael@photoprism.app>
This commit is contained in:
Michael Mayer
2025-08-28 19:10:36 +02:00
parent 68590ab408
commit 0357bc9abd
20 changed files with 120 additions and 88 deletions

View File

@@ -21,12 +21,12 @@ var AuthResetCommand = &cli.Command{
&cli.BoolFlag{ &cli.BoolFlag{
Name: "trace", Name: "trace",
Aliases: []string{"t"}, Aliases: []string{"t"},
Usage: "show trace logs for debugging", Usage: "shows trace logs for debugging",
}, },
&cli.BoolFlag{ &cli.BoolFlag{
Name: "yes", Name: "yes",
Aliases: []string{"y"}, Aliases: []string{"y"},
Usage: "assume \"yes\" and run non-interactively", Usage: "runs the command non-interactively",
}, },
}, },
Action: authResetAction, Action: authResetAction,

View File

@@ -33,12 +33,12 @@ var backupFlags = []cli.Flag{
&cli.BoolFlag{ &cli.BoolFlag{
Name: "force", Name: "force",
Aliases: []string{"f"}, Aliases: []string{"f"},
Usage: "replace the index database backup file, if it exists", Usage: "replaces the index database backup file, if it exists",
}, },
&cli.BoolFlag{ &cli.BoolFlag{
Name: "albums", Name: "albums",
Aliases: []string{"a"}, Aliases: []string{"a"},
Usage: "create YAML files to back up album metadata (in the standard backup path if no other path is specified)", Usage: "creates YAML files to back up album metadata (in the standard backup path if no other path is specified)",
}, },
&cli.PathFlag{ &cli.PathFlag{
Name: "albums-path", Name: "albums-path",
@@ -48,7 +48,7 @@ var backupFlags = []cli.Flag{
&cli.BoolFlag{ &cli.BoolFlag{
Name: "database", Name: "database",
Aliases: []string{"index", "i"}, Aliases: []string{"index", "i"},
Usage: "create index database backup (in the backup path with the date as filename if no filename is passed, or sent to stdout if - is passed as filename)", Usage: "creates an index database backup (in the backup path with the date as filename if no filename is passed, or sent to stdout if - is passed as filename)",
}, },
&cli.PathFlag{ &cli.PathFlag{
Name: "database-path", Name: "database-path",

View File

@@ -22,7 +22,7 @@ var CleanUpCommand = &cli.Command{
var cleanUpFlags = []cli.Flag{ var cleanUpFlags = []cli.Flag{
&cli.BoolFlag{ &cli.BoolFlag{
Name: "dry", Name: "dry",
Usage: "dry run, don't actually remove anything", Usage: "performs a dry run that doesn't actually remove anything",
}, },
} }

View File

@@ -20,7 +20,7 @@ var ClientsRemoveCommand = &cli.Command{
&cli.BoolFlag{ &cli.BoolFlag{
Name: "force", Name: "force",
Aliases: []string{"f"}, Aliases: []string{"f"},
Usage: "don't ask for confirmation", Usage: "skips asking for confirmation",
}, },
}, },
Action: clientsRemoveAction, Action: clientsRemoveAction,

View File

@@ -17,12 +17,12 @@ var ClientsResetCommand = &cli.Command{
&cli.BoolFlag{ &cli.BoolFlag{
Name: "trace", Name: "trace",
Aliases: []string{"t"}, Aliases: []string{"t"},
Usage: "show trace logs for debugging", Usage: "shows trace logs for debugging",
}, },
&cli.BoolFlag{ &cli.BoolFlag{
Name: "yes", Name: "yes",
Aliases: []string{"y"}, Aliases: []string{"y"},
Usage: "assume \"yes\" and run non-interactively", Usage: "runs the command non-interactively",
}, },
}, },
Action: clientsResetAction, Action: clientsResetAction,

View File

@@ -47,7 +47,7 @@ var FacesCommands = &cli.Command{
&cli.BoolFlag{ &cli.BoolFlag{
Name: "force", Name: "force",
Aliases: []string{"f"}, Aliases: []string{"f"},
Usage: "remove all people and faces", Usage: "removes all people and faces",
}, },
}, },
Action: facesResetAction, Action: facesResetAction,

View File

@@ -38,7 +38,7 @@ var indexFlags = []cli.Flag{
&cli.BoolFlag{ &cli.BoolFlag{
Name: "cleanup", Name: "cleanup",
Aliases: []string{"c"}, Aliases: []string{"c"},
Usage: "remove orphan index entries and thumbnails", Usage: "removes orphan index entries and thumbnails",
}, },
} }

View File

@@ -39,7 +39,7 @@ var MigrationsRunCommand = &cli.Command{
&cli.BoolFlag{ &cli.BoolFlag{
Name: "trace", Name: "trace",
Aliases: []string{"t"}, Aliases: []string{"t"},
Usage: "show trace logs for debugging", Usage: "shows trace logs for debugging",
}, },
}, },
Action: migrationsRunAction, Action: migrationsRunAction,

View File

@@ -27,12 +27,12 @@ var PasswdCommand = &cli.Command{
&cli.BoolFlag{ &cli.BoolFlag{
Name: "show", Name: "show",
Aliases: []string{"s"}, Aliases: []string{"s"},
Usage: "show bcrypt hash of new password", Usage: "shows bcrypt hash of new password",
}, },
&cli.BoolFlag{ &cli.BoolFlag{
Name: "remove", Name: "remove",
Aliases: []string{"rm"}, Aliases: []string{"rm"},
Usage: "remove password to disable local authentication", Usage: "removes password to disable local authentication",
}, },
}, },
Action: passwdAction, Action: passwdAction,

View File

@@ -30,7 +30,7 @@ var PlacesCommands = &cli.Command{
&cli.BoolFlag{ &cli.BoolFlag{
Name: "yes", Name: "yes",
Aliases: []string{"y"}, Aliases: []string{"y"},
Usage: "assume \"yes\" and run non-interactively", Usage: "runs the command non-interactively",
}, },
}, },
Action: placesUpdateAction, Action: placesUpdateAction,

View File

@@ -26,11 +26,11 @@ var PurgeCommand = &cli.Command{
var purgeFlags = []cli.Flag{ var purgeFlags = []cli.Flag{
&cli.BoolFlag{ &cli.BoolFlag{
Name: "hard", Name: "hard",
Usage: "permanently remove from index", Usage: "permanently removes data from the index",
}, },
&cli.BoolFlag{ &cli.BoolFlag{
Name: "dry", Name: "dry",
Usage: "dry run, don't actually remove anything", Usage: "performs a dry run that doesn't actually remove anything",
}, },
} }

View File

@@ -25,17 +25,17 @@ var ResetCommand = &cli.Command{
&cli.BoolFlag{ &cli.BoolFlag{
Name: "index", Name: "index",
Aliases: []string{"i"}, Aliases: []string{"i"},
Usage: "reset index database only", Usage: "resets only the index database ",
}, },
&cli.BoolFlag{ &cli.BoolFlag{
Name: "trace", Name: "trace",
Aliases: []string{"t"}, Aliases: []string{"t"},
Usage: "show trace logs for debugging", Usage: "shows trace logs for debugging",
}, },
&cli.BoolFlag{ &cli.BoolFlag{
Name: "yes", Name: "yes",
Aliases: []string{"y"}, Aliases: []string{"y"},
Usage: "assume \"yes\" and run non-interactively", Usage: "runs the command non-interactively",
}, },
}, },
Action: resetAction, Action: resetAction,

View File

@@ -15,10 +15,10 @@ const (
UserRoleUsage = "user account `ROLE` (admin or guest)" UserRoleUsage = "user account `ROLE` (admin or guest)"
UserAuthUsage = "authentication `PROVIDER` (default, local, oidc or none)" UserAuthUsage = "authentication `PROVIDER` (default, local, oidc or none)"
UserAuthIDUsage = "authentication `ID` e.g. Subject ID or Distinguished Name (DN)" UserAuthIDUsage = "authentication `ID` e.g. Subject ID or Distinguished Name (DN)"
UserAdminUsage = "make user super admin with full access" UserAdminUsage = "makes user super admin with full access"
UserNoLoginUsage = "disable login on the web interface" UserNoLoginUsage = "disables login on the web interface"
UserWebDAVUsage = "allow to sync files via WebDAV" UserWebDAVUsage = "allows to sync files via WebDAV"
UserDisable2FA = "deactivate two-factor authentication" UserDisable2FA = "deactivates two-factor authentication"
) )
// UsersCommands configures the user management subcommands. // UsersCommands configures the user management subcommands.
@@ -98,19 +98,19 @@ var UserTokensFlag = &cli.BoolFlag{
var UsersLoginFlag = &cli.BoolFlag{ var UsersLoginFlag = &cli.BoolFlag{
Name: "login", Name: "login",
Aliases: []string{"l"}, Aliases: []string{"l"},
Usage: "show date and time of last login", Usage: "shows date and time of last login",
} }
// UsersCreatedFlag is a CLI flag for showing the account creation timestamp in reports. // UsersCreatedFlag is a CLI flag for showing the account creation timestamp in reports.
var UsersCreatedFlag = &cli.BoolFlag{ var UsersCreatedFlag = &cli.BoolFlag{
Name: "created", Name: "created",
Aliases: []string{"a"}, Aliases: []string{"a"},
Usage: "show account creation timestamp", Usage: "shows account creation timestamp",
} }
// UsersDeletedFlag is a CLI flag for showing deleted user accounts in reports. // UsersDeletedFlag is a CLI flag for showing deleted user accounts in reports.
var UsersDeletedFlag = &cli.BoolFlag{ var UsersDeletedFlag = &cli.BoolFlag{
Name: "deleted", Name: "deleted",
Aliases: []string{"r"}, Aliases: []string{"r"},
Usage: "show deleted user accounts", Usage: "shows deleted user accounts",
} }

View File

@@ -21,7 +21,7 @@ var UsersRemoveCommand = &cli.Command{
&cli.BoolFlag{ &cli.BoolFlag{
Name: "force", Name: "force",
Aliases: []string{"f"}, Aliases: []string{"f"},
Usage: "don't ask for confirmation", Usage: "skips asking for confirmation",
}, },
}, },
Action: usersRemoveAction, Action: usersRemoveAction,

View File

@@ -20,12 +20,12 @@ var UsersResetCommand = &cli.Command{
&cli.BoolFlag{ &cli.BoolFlag{
Name: "trace", Name: "trace",
Aliases: []string{"t"}, Aliases: []string{"t"},
Usage: "show trace logs for debugging", Usage: "shows trace logs for debugging",
}, },
&cli.BoolFlag{ &cli.BoolFlag{
Name: "yes", Name: "yes",
Aliases: []string{"y"}, Aliases: []string{"y"},
Usage: "assume \"yes\" and run non-interactively", Usage: "runs the command non-interactively",
}, },
}, },
Action: usersResetAction, Action: usersResetAction,

View File

@@ -30,14 +30,14 @@ func TestCliFlags_Replace(t *testing.T) {
Name: "public", Name: "public",
Aliases: []string{"p"}, Aliases: []string{"p"},
Hidden: true, Hidden: true,
Usage: "disable authentication, advanced settings, and WebDAV remote access", Usage: "disables authentication, advanced settings, and WebDAV remote access",
EnvVars: EnvVars("PUBLIC"), EnvVars: EnvVars("PUBLIC"),
}} }}
newPublicFlag := CliFlag{Flag: &cli.BoolFlag{ newPublicFlag := CliFlag{Flag: &cli.BoolFlag{
Name: "public", Name: "public",
Hidden: false, Hidden: false,
Usage: "disable authentication, advanced settings, and WebDAV remote access", Usage: "disables authentication, advanced settings, and WebDAV remote access",
EnvVars: EnvVars("PUBLIC"), EnvVars: EnvVars("PUBLIC"),
}} }}
@@ -114,7 +114,7 @@ func TestCliFlags_Insert(t *testing.T) {
Name: "public", Name: "public",
Aliases: []string{"p"}, Aliases: []string{"p"},
Hidden: true, Hidden: true,
Usage: "disable authentication, advanced settings, and WebDAV remote access", Usage: "disables authentication, advanced settings, and WebDAV remote access",
EnvVars: EnvVars("PUBLIC"), EnvVars: EnvVars("PUBLIC"),
}} }}
@@ -163,7 +163,7 @@ func TestCliFlags_InsertBefore(t *testing.T) {
Name: "public", Name: "public",
Aliases: []string{"p"}, Aliases: []string{"p"},
Hidden: true, Hidden: true,
Usage: "disable authentication, advanced settings, and WebDAV remote access", Usage: "disables authentication, advanced settings, and WebDAV remote access",
EnvVars: EnvVars("PUBLIC"), EnvVars: EnvVars("PUBLIC"),
}} }}
@@ -214,7 +214,7 @@ func TestCliFlags_Prepend(t *testing.T) {
Name: "public", Name: "public",
Aliases: []string{"p"}, Aliases: []string{"p"},
Hidden: true, Hidden: true,
Usage: "disable authentication, advanced settings, and WebDAV remote access", Usage: "disables authentication, advanced settings, and WebDAV remote access",
EnvVars: EnvVars("PUBLIC"), EnvVars: EnvVars("PUBLIC"),
}} }}

View File

@@ -35,7 +35,7 @@ var Flags = CliFlags{
Name: "public", Name: "public",
Aliases: []string{"p"}, Aliases: []string{"p"},
Hidden: true, Hidden: true,
Usage: "disable authentication, advanced settings, and WebDAV remote access", Usage: "disables authentication, advanced settings, and WebDAV remote access",
EnvVars: EnvVars("PUBLIC"), EnvVars: EnvVars("PUBLIC"),
}}, { }}, {
Flag: &cli.StringFlag{ Flag: &cli.StringFlag{
@@ -95,12 +95,12 @@ var Flags = CliFlags{
}}, { }}, {
Flag: &cli.BoolFlag{ Flag: &cli.BoolFlag{
Name: "oidc-redirect", Name: "oidc-redirect",
Usage: "automatically redirect unauthenticated users to the configured identity provider", Usage: "automatically redirects unauthenticated users to the configured identity provider",
EnvVars: EnvVars("OIDC_REDIRECT"), EnvVars: EnvVars("OIDC_REDIRECT"),
}}, { }}, {
Flag: &cli.BoolFlag{ Flag: &cli.BoolFlag{
Name: "oidc-register", Name: "oidc-register",
Usage: "allow new users to create an account when they sign in with OpenID Connect", Usage: "allows new users to create an account when they sign in with OpenID Connect",
EnvVars: EnvVars("OIDC_REGISTER"), EnvVars: EnvVars("OIDC_REGISTER"),
}}, { }}, {
Flag: &cli.StringFlag{ Flag: &cli.StringFlag{
@@ -111,12 +111,12 @@ var Flags = CliFlags{
}}, { }}, {
Flag: &cli.BoolFlag{ Flag: &cli.BoolFlag{
Name: "oidc-webdav", Name: "oidc-webdav",
Usage: "allow new OpenID Connect users to use WebDAV when they have a role that allows it", Usage: "allows new OpenID Connect users to use WebDAV when they have a role that allows it",
EnvVars: EnvVars("OIDC_WEBDAV"), EnvVars: EnvVars("OIDC_WEBDAV"),
}}, { }}, {
Flag: &cli.BoolFlag{ Flag: &cli.BoolFlag{
Name: "disable-oidc", Name: "disable-oidc",
Usage: "disable single sign-on via OpenID Connect, even if an identity provider has been configured", Usage: "disables single sign-on via OpenID Connect, even if an identity provider has been configured",
EnvVars: EnvVars("DISABLE_OIDC"), EnvVars: EnvVars("DISABLE_OIDC"),
}}, { }}, {
Flag: &cli.Int64Flag{ Flag: &cli.Int64Flag{
@@ -146,34 +146,34 @@ var Flags = CliFlags{
}}, { }}, {
Flag: &cli.BoolFlag{ Flag: &cli.BoolFlag{
Name: "prod", Name: "prod",
Usage: "disable debug mode and log startup warnings and errors only", Usage: "disables debug mode and only logs startup warnings and errors",
EnvVars: EnvVars("PROD"), EnvVars: EnvVars("PROD"),
}}, { }}, {
Flag: &cli.BoolFlag{ Flag: &cli.BoolFlag{
Name: "debug", Name: "debug",
Usage: "enable debug mode for development and troubleshooting", Usage: "enables debug mode for development and troubleshooting",
EnvVars: EnvVars("DEBUG"), EnvVars: EnvVars("DEBUG"),
}}, { }}, {
Flag: &cli.BoolFlag{ Flag: &cli.BoolFlag{
Name: "trace", Name: "trace",
Usage: "enable trace mode to display all debug and trace logs", Usage: "enables trace mode to display all debug and trace logs",
EnvVars: EnvVars("TRACE"), EnvVars: EnvVars("TRACE"),
}}, { }}, {
Flag: &cli.BoolFlag{ Flag: &cli.BoolFlag{
Name: "test", Name: "test",
Hidden: true, Hidden: true,
Usage: "enable test mode", Usage: "enables test mode",
}}, { }}, {
Flag: &cli.BoolFlag{ Flag: &cli.BoolFlag{
Name: "unsafe", Name: "unsafe",
Hidden: true, Hidden: true,
Usage: "disable safety checks", Usage: "disables safety checks",
EnvVars: EnvVars("UNSAFE"), EnvVars: EnvVars("UNSAFE"),
}}, { }}, {
Flag: &cli.BoolFlag{ Flag: &cli.BoolFlag{
Name: "demo", Name: "demo",
Hidden: true, Hidden: true,
Usage: "enable demo mode", Usage: "enables demo mode",
EnvVars: EnvVars("DEMO"), EnvVars: EnvVars("DEMO"),
}}, { }}, {
Flag: &cli.BoolFlag{ Flag: &cli.BoolFlag{
@@ -198,7 +198,7 @@ var Flags = CliFlags{
Flag: &cli.StringFlag{ Flag: &cli.StringFlag{
Name: "defaults-yaml", Name: "defaults-yaml",
Aliases: []string{"y"}, Aliases: []string{"y"},
Usage: "load default config values from `FILENAME` if it exists, does not override CLI flags or environment variables", Usage: "loads default config values from `FILENAME` if it exists, does not override CLI flags or environment variables",
Value: "/etc/photoprism/defaults.yml", Value: "/etc/photoprism/defaults.yml",
EnvVars: EnvVars("DEFAULTS_YAML"), EnvVars: EnvVars("DEFAULTS_YAML"),
TakesFile: true, TakesFile: true,
@@ -252,23 +252,23 @@ var Flags = CliFlags{
}}, { }}, {
Flag: &cli.StringFlag{ Flag: &cli.StringFlag{
Name: "import-allow", Name: "import-allow",
Usage: "restrict imports to these file types (comma-separated list of `EXTENSIONS`; leave blank to allow all)", Usage: "restricts imports to these file types (comma-separated list of `EXTENSIONS`; leave blank to allow all)",
EnvVars: EnvVars("IMPORT_ALLOW"), EnvVars: EnvVars("IMPORT_ALLOW"),
}}, { }}, {
Flag: &cli.BoolFlag{ Flag: &cli.BoolFlag{
Name: "upload-nsfw", Name: "upload-nsfw",
Aliases: []string{"n"}, Aliases: []string{"n"},
Usage: "allow uploads that might be offensive (detecting unsafe content requires TensorFlow)", Usage: "allows uploads that might be offensive (detecting unsafe content requires TensorFlow)",
EnvVars: EnvVars("UPLOAD_NSFW"), EnvVars: EnvVars("UPLOAD_NSFW"),
}}, { }}, {
Flag: &cli.StringFlag{ Flag: &cli.StringFlag{
Name: "upload-allow", Name: "upload-allow",
Usage: "restrict uploads to these file types (comma-separated list of `EXTENSIONS`; leave blank to allow all)", Usage: "restricts uploads to these file types (comma-separated list of `EXTENSIONS`; leave blank to allow all)",
EnvVars: EnvVars("UPLOAD_ALLOW"), EnvVars: EnvVars("UPLOAD_ALLOW"),
}}, { }}, {
Flag: &cli.BoolFlag{ Flag: &cli.BoolFlag{
Name: "upload-archives", Name: "upload-archives",
Usage: "allow upload of zip archives (will be extracted before import)", Usage: "allows upload of zip archives (will be extracted before import)",
EnvVars: EnvVars("UPLOAD_ARCHIVES"), EnvVars: EnvVars("UPLOAD_ARCHIVES"),
}}, { }}, {
Flag: &cli.IntFlag{ Flag: &cli.IntFlag{
@@ -312,12 +312,12 @@ var Flags = CliFlags{
}}, { }}, {
Flag: &cli.BoolFlag{ Flag: &cli.BoolFlag{
Name: "sidecar-yaml", Name: "sidecar-yaml",
Usage: "create YAML sidecar files to back up picture metadata", Usage: "creates YAML sidecar files to back up picture metadata",
EnvVars: EnvVars("SIDECAR_YAML"), EnvVars: EnvVars("SIDECAR_YAML"),
}, DocDefault: "true"}, { }, DocDefault: "true"}, {
Flag: &cli.BoolFlag{ Flag: &cli.BoolFlag{
Name: "usage-info", Name: "usage-info",
Usage: "display usage information in the user interface", Usage: "displays storage usage information in the user interface",
EnvVars: EnvVars("USAGE_INFO"), EnvVars: EnvVars("USAGE_INFO"),
}}, { }}, {
Flag: &cli.Uint64Flag{ Flag: &cli.Uint64Flag{
@@ -346,12 +346,12 @@ var Flags = CliFlags{
}}, { }}, {
Flag: &cli.BoolFlag{ Flag: &cli.BoolFlag{
Name: "backup-database", Name: "backup-database",
Usage: "create regular backups based on the configured schedule", Usage: "creates regular backups based on the configured schedule",
EnvVars: EnvVars("BACKUP_DATABASE"), EnvVars: EnvVars("BACKUP_DATABASE"),
}, DocDefault: "true"}, { }, DocDefault: "true"}, {
Flag: &cli.BoolFlag{ Flag: &cli.BoolFlag{
Name: "backup-albums", Name: "backup-albums",
Usage: "create YAML files to back up album metadata", Usage: "creates YAML files to back up album metadata",
EnvVars: EnvVars("BACKUP_ALBUMS"), EnvVars: EnvVars("BACKUP_ALBUMS"),
}, DocDefault: "true"}, { }, DocDefault: "true"}, {
Flag: &cli.IntFlag{ Flag: &cli.IntFlag{
@@ -389,118 +389,118 @@ var Flags = CliFlags{
Flag: &cli.BoolFlag{ Flag: &cli.BoolFlag{
Name: "read-only", Name: "read-only",
Aliases: []string{"r"}, Aliases: []string{"r"},
Usage: "disable features that require write permission for the originals folder", Usage: "disables features that require write permission for the originals folder",
EnvVars: EnvVars("READONLY"), EnvVars: EnvVars("READONLY"),
}}, { }}, {
Flag: &cli.BoolFlag{ Flag: &cli.BoolFlag{
Name: "experimental", Name: "experimental",
Aliases: []string{"e"}, Aliases: []string{"e"},
Usage: "enable new features that may be incomplete or unstable", Usage: "enables new features that may be incomplete or unstable",
EnvVars: EnvVars("EXPERIMENTAL"), EnvVars: EnvVars("EXPERIMENTAL"),
}}, { }}, {
Flag: &cli.BoolFlag{ Flag: &cli.BoolFlag{
Name: "disable-frontend", Name: "disable-frontend",
Usage: "disable the web user interface so that only the service API endpoints are accessible", Usage: "disables the web user interface so that only the service API endpoints are accessible",
EnvVars: EnvVars("DISABLE_FRONTEND"), EnvVars: EnvVars("DISABLE_FRONTEND"),
}}, { }}, {
Flag: &cli.BoolFlag{ Flag: &cli.BoolFlag{
Name: "disable-settings", Name: "disable-settings",
Usage: "disable the settings frontend and related API endpoints, e.g. in combination with public mode", Usage: "disables the settings frontend and related API endpoints, e.g. in combination with public mode",
EnvVars: EnvVars("DISABLE_SETTINGS"), EnvVars: EnvVars("DISABLE_SETTINGS"),
}}, { }}, {
Flag: &cli.BoolFlag{ Flag: &cli.BoolFlag{
Name: "disable-backups", Name: "disable-backups",
Usage: "prevent database and album backups as well as YAML sidecar files from being created", Usage: "prevents database and album backups as well as YAML sidecar files from being created",
EnvVars: EnvVars("DISABLE_BACKUPS"), EnvVars: EnvVars("DISABLE_BACKUPS"),
}}, { }}, {
Flag: &cli.BoolFlag{ Flag: &cli.BoolFlag{
Name: "disable-restart", Name: "disable-restart",
Usage: "prevent admins from restarting the server through the user interface", Usage: "prevents admins from restarting the server through the user interface",
EnvVars: EnvVars("DISABLE_RESTART"), EnvVars: EnvVars("DISABLE_RESTART"),
}}, { }}, {
Flag: &cli.BoolFlag{ Flag: &cli.BoolFlag{
Name: "disable-webdav", Name: "disable-webdav",
Usage: "prevent other apps from accessing PhotoPrism as a shared network drive", Usage: "prevents other apps from accessing PhotoPrism as a shared network drive",
EnvVars: EnvVars("DISABLE_WEBDAV"), EnvVars: EnvVars("DISABLE_WEBDAV"),
}}, { }}, {
Flag: &cli.BoolFlag{ Flag: &cli.BoolFlag{
Name: "disable-places", Name: "disable-places",
Usage: "disable interactive world maps and reverse geocoding", Usage: "disables interactive world maps and reverse geocoding",
EnvVars: EnvVars("DISABLE_PLACES"), EnvVars: EnvVars("DISABLE_PLACES"),
}}, { }}, {
Flag: &cli.BoolFlag{ Flag: &cli.BoolFlag{
Name: "disable-tensorflow", Name: "disable-tensorflow",
Usage: "disable features depending on TensorFlow, e.g. image classification and face recognition", Usage: "disables features depending on TensorFlow, e.g. image classification and face recognition",
EnvVars: EnvVars("DISABLE_TENSORFLOW"), EnvVars: EnvVars("DISABLE_TENSORFLOW"),
}}, { }}, {
Flag: &cli.BoolFlag{ Flag: &cli.BoolFlag{
Name: "disable-faces", Name: "disable-faces",
Usage: "disable face detection and recognition (requires TensorFlow)", Usage: "disables face detection and recognition (requires TensorFlow)",
EnvVars: EnvVars("DISABLE_FACES"), EnvVars: EnvVars("DISABLE_FACES"),
}}, { }}, {
Flag: &cli.BoolFlag{ Flag: &cli.BoolFlag{
Name: "disable-classification", Name: "disable-classification",
Usage: "disable image classification (requires TensorFlow)", Usage: "disables image classification (requires TensorFlow)",
EnvVars: EnvVars("DISABLE_CLASSIFICATION"), EnvVars: EnvVars("DISABLE_CLASSIFICATION"),
}}, { }}, {
Flag: &cli.BoolFlag{ Flag: &cli.BoolFlag{
Name: "disable-ffmpeg", Name: "disable-ffmpeg",
Usage: "disable video transcoding and thumbnail extraction with FFmpeg", Usage: "disables video transcoding and thumbnail extraction with FFmpeg",
EnvVars: EnvVars("DISABLE_FFMPEG"), EnvVars: EnvVars("DISABLE_FFMPEG"),
}}, { }}, {
Flag: &cli.BoolFlag{ Flag: &cli.BoolFlag{
Name: "disable-exiftool", Name: "disable-exiftool",
Usage: "disable metadata extraction with ExifTool (required for full Video, Live Photo, and XMP support)", Usage: "disables metadata extraction with ExifTool (required for full Video, Live Photo, and XMP support)",
EnvVars: EnvVars("DISABLE_EXIFTOOL"), EnvVars: EnvVars("DISABLE_EXIFTOOL"),
}}, { }}, {
Flag: &cli.BoolFlag{ Flag: &cli.BoolFlag{
Name: "disable-vips", Name: "disable-vips",
Usage: "disable image processing and conversion with libvips", Usage: "disables image processing and conversion with libvips",
EnvVars: EnvVars("DISABLE_VIPS"), EnvVars: EnvVars("DISABLE_VIPS"),
}}, { }}, {
Flag: &cli.BoolFlag{ Flag: &cli.BoolFlag{
Name: "disable-sips", Name: "disable-sips",
Usage: "disable file conversion using the sips command under macOS", Usage: "disables file conversion using the sips command under macOS",
EnvVars: EnvVars("DISABLE_SIPS"), EnvVars: EnvVars("DISABLE_SIPS"),
}}, { }}, {
Flag: &cli.BoolFlag{ Flag: &cli.BoolFlag{
Name: "disable-darktable", Name: "disable-darktable",
Usage: "disable conversion of RAW images with Darktable", Usage: "disables conversion of RAW images with Darktable",
EnvVars: EnvVars("DISABLE_DARKTABLE"), EnvVars: EnvVars("DISABLE_DARKTABLE"),
}}, { }}, {
Flag: &cli.BoolFlag{ Flag: &cli.BoolFlag{
Name: "disable-rawtherapee", Name: "disable-rawtherapee",
Usage: "disable conversion of RAW images with RawTherapee", Usage: "disables conversion of RAW images with RawTherapee",
EnvVars: EnvVars("DISABLE_RAWTHERAPEE"), EnvVars: EnvVars("DISABLE_RAWTHERAPEE"),
}}, { }}, {
Flag: &cli.BoolFlag{ Flag: &cli.BoolFlag{
Name: "disable-imagemagick", Name: "disable-imagemagick",
Usage: "disable conversion of image files with ImageMagick", Usage: "disables conversion of image files with ImageMagick",
EnvVars: EnvVars("DISABLE_IMAGEMAGICK"), EnvVars: EnvVars("DISABLE_IMAGEMAGICK"),
}}, { }}, {
Flag: &cli.BoolFlag{ Flag: &cli.BoolFlag{
Name: "disable-heifconvert", Name: "disable-heifconvert",
Usage: "disable conversion of HEIC images with libheif", Usage: "disables conversion of HEIC images with libheif",
EnvVars: EnvVars("DISABLE_HEIFCONVERT"), EnvVars: EnvVars("DISABLE_HEIFCONVERT"),
}}, { }}, {
Flag: &cli.BoolFlag{ Flag: &cli.BoolFlag{
Name: "disable-jpegxl", Name: "disable-jpegxl",
Usage: "disable JPEG XL file format support", Usage: "disables JPEG XL file format support",
EnvVars: EnvVars("DISABLE_JPEGXL"), EnvVars: EnvVars("DISABLE_JPEGXL"),
}}, { }}, {
Flag: &cli.BoolFlag{ Flag: &cli.BoolFlag{
Name: "disable-raw", Name: "disable-raw",
Usage: "disable indexing and conversion of RAW images", Usage: "disables indexing and conversion of RAW images",
EnvVars: EnvVars("DISABLE_RAW"), EnvVars: EnvVars("DISABLE_RAW"),
}}, { }}, {
Flag: &cli.BoolFlag{ Flag: &cli.BoolFlag{
Name: "raw-presets", Name: "raw-presets",
Usage: "enables applying user presets when converting RAW images (reduces performance)", Usage: "enables custom user presets when converting RAW images (reduces performance)",
EnvVars: EnvVars("RAW_PRESETS"), EnvVars: EnvVars("RAW_PRESETS"),
}}, { }}, {
Flag: &cli.BoolFlag{ Flag: &cli.BoolFlag{
Name: "exif-bruteforce", Name: "exif-bruteforce",
Usage: "always perform a brute-force search if no Exif headers were found", Usage: "performs a brute-force search if no Exif headers were found",
EnvVars: EnvVars("EXIF_BRUTEFORCE"), EnvVars: EnvVars("EXIF_BRUTEFORCE"),
}}, { }}, {
Flag: &cli.StringFlag{ Flag: &cli.StringFlag{
@@ -630,7 +630,7 @@ var Flags = CliFlags{
}}, { }}, {
Flag: &cli.BoolFlag{ Flag: &cli.BoolFlag{
Name: "cdn-video", Name: "cdn-video",
Usage: "stream videos over the specified CDN", Usage: "streams videos over the specified CDN",
EnvVars: EnvVars("CDN_VIDEO"), EnvVars: EnvVars("CDN_VIDEO"),
}}, { }}, {
Flag: &cli.StringFlag{ Flag: &cli.StringFlag{
@@ -651,6 +651,26 @@ var Flags = CliFlags{
EnvVars: EnvVars("CORS_METHODS"), EnvVars: EnvVars("CORS_METHODS"),
Value: header.DefaultAccessControlAllowMethods, Value: header.DefaultAccessControlAllowMethods,
}}, { }}, {
Flag: &cli.StringFlag{
Name: "portal-url",
Usage: "PhotoPrism® Portal server `URL`",
EnvVars: EnvVars("PORTAL_URL"),
}}, {
Flag: &cli.StringFlag{
Name: "portal-client",
Usage: "PhotoPrism® Portal client `ID`",
EnvVars: EnvVars("PORTAL_CLIENT"),
}}, {
Flag: &cli.StringFlag{
Name: "portal-secret",
Usage: "PhotoPrism® Portal client `SECRET`",
EnvVars: EnvVars("PORTAL_SECRET"),
}}, {
Flag: &cli.StringFlag{
Name: "instance-secret",
Usage: "unique `SECRET` for authenticating this instance",
EnvVars: EnvVars("INSTANCE_SECRET"),
}}, {
Flag: &cli.StringFlag{ Flag: &cli.StringFlag{
Name: "https-proxy", Name: "https-proxy",
Usage: "proxy server `URL` to be used for outgoing connections*optional*", Usage: "proxy server `URL` to be used for outgoing connections*optional*",
@@ -658,7 +678,7 @@ var Flags = CliFlags{
}}, { }}, {
Flag: &cli.BoolFlag{ Flag: &cli.BoolFlag{
Name: "https-proxy-insecure", Name: "https-proxy-insecure",
Usage: "ignore invalid HTTPS certificates when using a proxy", Usage: "ignores invalid HTTPS certificates when using a proxy",
EnvVars: EnvVars("HTTPS_PROXY_INSECURE"), EnvVars: EnvVars("HTTPS_PROXY_INSECURE"),
}}, { }}, {
Flag: &cli.StringFlag{ Flag: &cli.StringFlag{
@@ -693,12 +713,12 @@ var Flags = CliFlags{
}}, { }}, {
Flag: &cli.BoolFlag{ Flag: &cli.BoolFlag{
Name: "disable-tls", Name: "disable-tls",
Usage: "disable HTTPS/TLS even if the site URL starts with https:// and a certificate is available", Usage: "disables HTTPS/TLS even if the site URL starts with https:// and a certificate is available",
EnvVars: EnvVars("DISABLE_TLS"), EnvVars: EnvVars("DISABLE_TLS"),
}}, { }}, {
Flag: &cli.BoolFlag{ Flag: &cli.BoolFlag{
Name: "default-tls", Name: "default-tls",
Usage: "default to a self-signed HTTPS/TLS certificate if no other certificate is available", Usage: "uses a self-signed HTTPS/TLS certificate if no other certificate is available",
EnvVars: EnvVars("DEFAULT_TLS"), EnvVars: EnvVars("DEFAULT_TLS"),
}}, { }}, {
Flag: &cli.StringFlag{ Flag: &cli.StringFlag{
@@ -731,7 +751,7 @@ var Flags = CliFlags{
}}, { }}, {
Flag: &cli.BoolFlag{ Flag: &cli.BoolFlag{
Name: "http-cache-public", Name: "http-cache-public",
Usage: "allow static content to be cached by a CDN or caching proxy", Usage: "allows static content to be cached by a CDN or caching proxy",
EnvVars: EnvVars("HTTP_CACHE_PUBLIC"), EnvVars: EnvVars("HTTP_CACHE_PUBLIC"),
}}, { }}, {
Flag: &cli.IntFlag{ Flag: &cli.IntFlag{
@@ -995,7 +1015,7 @@ var Flags = CliFlags{
Flag: &cli.BoolFlag{ Flag: &cli.BoolFlag{
Name: "thumb-uncached", Name: "thumb-uncached",
Aliases: []string{"u"}, Aliases: []string{"u"},
Usage: "generate missing thumbnails on demand (high memory and cpu usage)", Usage: "generates missing thumbnails on demand (high memory and cpu usage)",
EnvVars: EnvVars("THUMB_UNCACHED"), EnvVars: EnvVars("THUMB_UNCACHED"),
}}, { }}, {
Flag: &cli.StringFlag{ Flag: &cli.StringFlag{
@@ -1026,24 +1046,24 @@ var Flags = CliFlags{
}}, { }}, {
Flag: &cli.BoolFlag{ Flag: &cli.BoolFlag{
Name: "vision-api", Name: "vision-api",
Usage: "enable computer vision service API endpoints under /api/v1/vision (requires authorized access token)", Usage: "enables the computer vision API endpoints under /api/v1/vision (requires authorization)",
EnvVars: EnvVars("VISION_API"), EnvVars: EnvVars("VISION_API"),
}}, { }}, {
Flag: &cli.StringFlag{ Flag: &cli.StringFlag{
Name: "vision-uri", Name: "vision-uri",
Usage: "remote computer vision service `URI`, e.g. https://example.com/api/v1/vision (leave blank to disable)", Usage: "vision service base `URI`, e.g. https://example.com/api/v1/vision (leave blank to disable)",
Value: "", Value: "",
EnvVars: EnvVars("VISION_URI"), EnvVars: EnvVars("VISION_URI"),
}}, { }}, {
Flag: &cli.StringFlag{ Flag: &cli.StringFlag{
Name: "vision-key", Name: "vision-key",
Usage: "remote computer vision service access `TOKEN`*optional*", Usage: "vision service access `TOKEN`*optional*",
Value: "", Value: "",
EnvVars: EnvVars("VISION_KEY"), EnvVars: EnvVars("VISION_KEY"),
}}, { }}, {
Flag: &cli.BoolFlag{ Flag: &cli.BoolFlag{
Name: "detect-nsfw", Name: "detect-nsfw",
Usage: "flag newly added pictures as private if they might be offensive (requires TensorFlow)", Usage: "flags newly added pictures as private if they might be offensive (requires TensorFlow)",
EnvVars: EnvVars("DETECT_NSFW"), EnvVars: EnvVars("DETECT_NSFW"),
}}, { }}, {
Flag: &cli.IntFlag{ Flag: &cli.IntFlag{

View File

@@ -140,6 +140,10 @@ type Options struct {
CORSOrigin string `yaml:"CORSOrigin" json:"-" flag:"cors-origin"` CORSOrigin string `yaml:"CORSOrigin" json:"-" flag:"cors-origin"`
CORSHeaders string `yaml:"CORSHeaders" json:"-" flag:"cors-headers"` CORSHeaders string `yaml:"CORSHeaders" json:"-" flag:"cors-headers"`
CORSMethods string `yaml:"CORSMethods" json:"-" flag:"cors-methods"` CORSMethods string `yaml:"CORSMethods" json:"-" flag:"cors-methods"`
PortalUrl string `yaml:"PortalUrl" json:"-" flag:"portal-url"`
PortalClient string `yaml:"PortalClient" json:"-" flag:"portal-client"`
PortalSecret string `yaml:"PortalSecret" json:"-" flag:"portal-secret"`
InstanceSecret string `yaml:"InstanceSecret" json:"-" flag:"instance-secret"`
HttpsProxy string `yaml:"HttpsProxy" json:"HttpsProxy" flag:"https-proxy"` HttpsProxy string `yaml:"HttpsProxy" json:"HttpsProxy" flag:"https-proxy"`
HttpsProxyInsecure bool `yaml:"HttpsProxyInsecure" json:"HttpsProxyInsecure" flag:"https-proxy-insecure"` HttpsProxyInsecure bool `yaml:"HttpsProxyInsecure" json:"HttpsProxyInsecure" flag:"https-proxy-insecure"`
TrustedPlatform string `yaml:"TrustedPlatform" json:"-" flag:"trusted-platform"` TrustedPlatform string `yaml:"TrustedPlatform" json:"-" flag:"trusted-platform"`

View File

@@ -168,6 +168,12 @@ func (c *Config) Report() (rows [][]string, cols []string) {
{"cors-headers", c.CORSHeaders()}, {"cors-headers", c.CORSHeaders()},
{"cors-methods", c.CORSMethods()}, {"cors-methods", c.CORSMethods()},
// Portal Server.
{"portal-url", fmt.Sprintf("%s", c.Options().PortalUrl)},
{"portal-client", fmt.Sprintf("%s", c.Options().PortalClient)},
{"portal-secret", fmt.Sprintf("%s", strings.Repeat("*", utf8.RuneCountInString(c.Options().PortalSecret)))},
{"instance-secret", fmt.Sprintf("%s", strings.Repeat("*", utf8.RuneCountInString(c.Options().InstanceSecret)))},
// URIs. // URIs.
{"base-uri", c.BaseUri("/")}, {"base-uri", c.BaseUri("/")},
{"api-uri", c.ApiUri()}, {"api-uri", c.ApiUri()},

View File

@@ -25,6 +25,7 @@ var OptionsReportSections = []ReportSection{
{Start: "PHOTOPRISM_READONLY", Title: "Feature Flags"}, {Start: "PHOTOPRISM_READONLY", Title: "Feature Flags"},
{Start: "PHOTOPRISM_DEFAULT_LOCALE", Title: "Customization"}, {Start: "PHOTOPRISM_DEFAULT_LOCALE", Title: "Customization"},
{Start: "PHOTOPRISM_SITE_URL", Title: "Site Information"}, {Start: "PHOTOPRISM_SITE_URL", Title: "Site Information"},
{Start: "PHOTOPRISM_PORTAL_URL", Title: "Portal Server"},
{Start: "PHOTOPRISM_HTTPS_PROXY", Title: "Proxy Server"}, {Start: "PHOTOPRISM_HTTPS_PROXY", Title: "Proxy Server"},
{Start: "PHOTOPRISM_DISABLE_TLS", Title: "Web Server"}, {Start: "PHOTOPRISM_DISABLE_TLS", Title: "Web Server"},
{Start: "PHOTOPRISM_DATABASE_DRIVER", Title: "Database Connection"}, {Start: "PHOTOPRISM_DATABASE_DRIVER", Title: "Database Connection"},
@@ -51,6 +52,7 @@ var YamlReportSections = []ReportSection{
{Start: "ReadOnly", Title: "Feature Flags"}, {Start: "ReadOnly", Title: "Feature Flags"},
{Start: "DefaultLocale", Title: "Customization"}, {Start: "DefaultLocale", Title: "Customization"},
{Start: "SiteUrl", Title: "Site Information"}, {Start: "SiteUrl", Title: "Site Information"},
{Start: "PortalUrl", Title: "Portal Server"},
{Start: "HttpsProxy", Title: "Proxy Server"}, {Start: "HttpsProxy", Title: "Proxy Server"},
{Start: "DisableTLS", Title: "Web Server"}, {Start: "DisableTLS", Title: "Web Server"},
{Start: "DatabaseDriver", Title: "Database Connection"}, {Start: "DatabaseDriver", Title: "Database Connection"},