2019-05-06 23:18:10 +02:00
|
|
|
package config
|
2018-09-24 09:53:16 +02:00
|
|
|
|
2019-06-20 01:11:03 +02:00
|
|
|
import (
|
|
|
|
"github.com/urfave/cli"
|
|
|
|
)
|
2018-09-24 09:53:16 +02:00
|
|
|
|
2020-05-31 02:09:52 +02:00
|
|
|
// PhotoPrism command-line parameters and flags.
|
2018-09-24 09:53:16 +02:00
|
|
|
var GlobalFlags = []cli.Flag{
|
|
|
|
cli.BoolFlag{
|
|
|
|
Name: "debug",
|
2020-05-31 12:20:32 +02:00
|
|
|
Usage: "run in debug mode (shows additional log messages)",
|
2018-09-24 09:53:16 +02:00
|
|
|
EnvVar: "PHOTOPRISM_DEBUG",
|
|
|
|
},
|
2020-12-18 10:59:21 +01:00
|
|
|
cli.BoolFlag{
|
|
|
|
Name: "demo",
|
|
|
|
Hidden: true,
|
|
|
|
Usage: "run in demo mode",
|
|
|
|
EnvVar: "PHOTOPRISM_DEMO",
|
|
|
|
},
|
2020-05-31 02:09:52 +02:00
|
|
|
cli.BoolFlag{
|
|
|
|
Name: "public, p",
|
2020-05-31 12:20:32 +02:00
|
|
|
Usage: "no authentication required (disables password protection)",
|
2020-05-31 02:09:52 +02:00
|
|
|
EnvVar: "PHOTOPRISM_PUBLIC",
|
|
|
|
},
|
2019-05-04 09:11:33 +02:00
|
|
|
cli.BoolFlag{
|
|
|
|
Name: "read-only, r",
|
2020-06-07 10:39:23 +02:00
|
|
|
Usage: "don't modify originals directory (import and upload disabled)",
|
2020-05-29 09:23:26 +02:00
|
|
|
EnvVar: "PHOTOPRISM_READONLY",
|
2019-05-04 09:11:33 +02:00
|
|
|
},
|
2019-12-30 12:38:11 +01:00
|
|
|
cli.BoolFlag{
|
|
|
|
Name: "experimental, e",
|
|
|
|
Usage: "enable experimental features",
|
|
|
|
EnvVar: "PHOTOPRISM_EXPERIMENTAL",
|
|
|
|
},
|
2020-12-17 18:24:55 +01:00
|
|
|
cli.StringFlag{
|
|
|
|
Name: "config-path",
|
|
|
|
Usage: "config `PATH`",
|
|
|
|
EnvVar: "PHOTOPRISM_CONFIG_PATH",
|
|
|
|
},
|
|
|
|
cli.StringFlag{
|
|
|
|
Name: "config-file, c",
|
|
|
|
Usage: "main config `FILENAME`",
|
|
|
|
EnvVar: "PHOTOPRISM_CONFIG_FILE",
|
|
|
|
},
|
2020-05-31 02:09:52 +02:00
|
|
|
cli.StringFlag{
|
2020-12-18 09:11:42 +01:00
|
|
|
Name: "originals-path",
|
|
|
|
Usage: "originals `PATH` for your photo and video collection",
|
|
|
|
EnvVar: "PHOTOPRISM_ORIGINALS_PATH",
|
2020-05-31 02:09:52 +02:00
|
|
|
},
|
2020-12-18 09:11:42 +01:00
|
|
|
cli.IntFlag{
|
|
|
|
Name: "originals-limit",
|
|
|
|
Value: 1000,
|
|
|
|
Usage: "file size limit for originals in `MEGABYTE`",
|
|
|
|
EnvVar: "PHOTOPRISM_ORIGINALS_LIMIT",
|
|
|
|
},
|
|
|
|
cli.StringFlag{
|
|
|
|
Name: "import-path",
|
|
|
|
Usage: "optional `PATH` for importing files to originals",
|
|
|
|
EnvVar: "PHOTOPRISM_IMPORT_PATH",
|
|
|
|
},
|
|
|
|
cli.StringFlag{
|
|
|
|
Name: "storage-path",
|
|
|
|
Usage: "storage `PATH` for cache, database and sidecar files",
|
|
|
|
EnvVar: "PHOTOPRISM_STORAGE_PATH",
|
|
|
|
},
|
|
|
|
cli.StringFlag{
|
|
|
|
Name: "sidecar-path",
|
|
|
|
Usage: "relative or absolute storage `PATH` for sidecar files",
|
|
|
|
EnvVar: "PHOTOPRISM_SIDECAR_PATH",
|
|
|
|
},
|
|
|
|
cli.StringFlag{
|
|
|
|
Name: "cache-path",
|
|
|
|
Usage: "cache storage `PATH` for sessions and thumbnails",
|
|
|
|
EnvVar: "PHOTOPRISM_CACHE_PATH",
|
|
|
|
},
|
|
|
|
cli.StringFlag{
|
|
|
|
Name: "temp-path",
|
|
|
|
Usage: "temporary `PATH` for uploads and downloads",
|
|
|
|
EnvVar: "PHOTOPRISM_TEMP_PATH",
|
|
|
|
},
|
|
|
|
cli.StringFlag{
|
|
|
|
Name: "backup-path",
|
|
|
|
Usage: "backup storage `PATH`",
|
|
|
|
EnvVar: "PHOTOPRISM_BACKUP_PATH",
|
|
|
|
},
|
|
|
|
cli.StringFlag{
|
|
|
|
Name: "assets-path",
|
|
|
|
Usage: "assets `PATH` for static resources like models and templates",
|
|
|
|
EnvVar: "PHOTOPRISM_ASSETS_PATH",
|
2020-12-17 18:24:55 +01:00
|
|
|
},
|
2020-01-06 23:43:19 +01:00
|
|
|
cli.IntFlag{
|
|
|
|
Name: "workers, w",
|
2020-12-18 09:11:42 +01:00
|
|
|
Usage: "`LIMIT` the number of indexing workers to reduce system load",
|
2020-01-06 23:43:19 +01:00
|
|
|
EnvVar: "PHOTOPRISM_WORKERS",
|
|
|
|
},
|
2020-04-06 22:09:45 +02:00
|
|
|
cli.IntFlag{
|
|
|
|
Name: "wakeup-interval",
|
2020-12-18 09:11:42 +01:00
|
|
|
Usage: "background worker wakeup interval in `SECONDS`",
|
2020-04-06 22:09:45 +02:00
|
|
|
EnvVar: "PHOTOPRISM_WAKEUP_INTERVAL",
|
|
|
|
},
|
2020-12-18 09:11:42 +01:00
|
|
|
cli.BoolFlag{
|
|
|
|
Name: "disable-backups",
|
|
|
|
Usage: "don't backup photo and album metadata to YAML files",
|
|
|
|
EnvVar: "PHOTOPRISM_DISABLE_BACKUPS",
|
|
|
|
},
|
2020-12-18 10:59:21 +01:00
|
|
|
cli.BoolFlag{
|
|
|
|
Name: "disable-webdav",
|
|
|
|
Usage: "disable built-in WebDAV server",
|
|
|
|
EnvVar: "PHOTOPRISM_DISABLE_WEBDAV",
|
|
|
|
},
|
2020-12-18 09:11:42 +01:00
|
|
|
cli.BoolFlag{
|
|
|
|
Name: "disable-settings",
|
|
|
|
Usage: "users can not view or change settings",
|
|
|
|
EnvVar: "PHOTOPRISM_DISABLE_SETTINGS",
|
|
|
|
},
|
|
|
|
cli.BoolFlag{
|
|
|
|
Name: "disable-places",
|
|
|
|
Usage: "disables reverse geocoding and maps",
|
|
|
|
EnvVar: "PHOTOPRISM_DISABLE_PLACES",
|
|
|
|
},
|
|
|
|
cli.BoolFlag{
|
|
|
|
Name: "disable-exiftool",
|
|
|
|
Usage: "don't create ExifTool JSON files for improved metadata extraction",
|
|
|
|
EnvVar: "PHOTOPRISM_DISABLE_EXIFTOOL",
|
|
|
|
},
|
|
|
|
cli.BoolFlag{
|
|
|
|
Name: "disable-tensorflow",
|
|
|
|
Usage: "don't use TensorFlow for image classification",
|
|
|
|
EnvVar: "PHOTOPRISM_DISABLE_TENSORFLOW",
|
|
|
|
},
|
|
|
|
cli.BoolFlag{
|
|
|
|
Name: "detect-nsfw",
|
|
|
|
Usage: "flag photos as private that may be offensive (requires TensorFlow)",
|
|
|
|
EnvVar: "PHOTOPRISM_DETECT_NSFW",
|
|
|
|
},
|
|
|
|
cli.BoolFlag{
|
|
|
|
Name: "upload-nsfw",
|
|
|
|
Usage: "allow uploads that may be offensive",
|
|
|
|
EnvVar: "PHOTOPRISM_UPLOAD_NSFW",
|
|
|
|
},
|
|
|
|
cli.StringFlag{
|
|
|
|
Name: "log-level, l",
|
|
|
|
Usage: "trace, debug, info, warning, error, fatal or panic",
|
|
|
|
Value: "info",
|
|
|
|
EnvVar: "PHOTOPRISM_LOG_LEVEL",
|
|
|
|
},
|
|
|
|
cli.StringFlag{
|
|
|
|
Name: "log-filename",
|
|
|
|
Usage: "server log `FILENAME`",
|
|
|
|
EnvVar: "PHOTOPRISM_LOG_FILENAME",
|
|
|
|
Value: "",
|
|
|
|
},
|
|
|
|
cli.StringFlag{
|
|
|
|
Name: "pid-filename",
|
|
|
|
Usage: "server process id `FILENAME`",
|
|
|
|
EnvVar: "PHOTOPRISM_PID_FILENAME",
|
|
|
|
},
|
2019-12-11 14:10:20 +01:00
|
|
|
cli.StringFlag{
|
2020-05-31 02:09:52 +02:00
|
|
|
Name: "site-url",
|
2020-06-26 14:26:36 +02:00
|
|
|
Usage: "public site `URL`",
|
2019-12-11 14:10:20 +01:00
|
|
|
Value: "http://localhost:2342/",
|
2020-05-31 02:09:52 +02:00
|
|
|
EnvVar: "PHOTOPRISM_SITE_URL",
|
2019-12-11 14:10:20 +01:00
|
|
|
},
|
2020-06-26 14:26:36 +02:00
|
|
|
cli.StringFlag{
|
|
|
|
Name: "site-preview",
|
|
|
|
Usage: "public preview image `URL`",
|
|
|
|
EnvVar: "PHOTOPRISM_SITE_PREVIEW",
|
|
|
|
},
|
2019-12-11 14:10:20 +01:00
|
|
|
cli.StringFlag{
|
2020-05-31 02:09:52 +02:00
|
|
|
Name: "site-title",
|
2019-12-11 14:10:20 +01:00
|
|
|
Usage: "site title",
|
|
|
|
Value: "PhotoPrism",
|
2020-05-31 02:09:52 +02:00
|
|
|
EnvVar: "PHOTOPRISM_SITE_TITLE",
|
2019-12-11 14:10:20 +01:00
|
|
|
},
|
|
|
|
cli.StringFlag{
|
2020-05-31 02:09:52 +02:00
|
|
|
Name: "site-caption",
|
2020-06-26 14:26:36 +02:00
|
|
|
Usage: "short site caption",
|
2020-06-25 18:39:48 +02:00
|
|
|
Value: "Browse Your Life",
|
2020-05-31 02:09:52 +02:00
|
|
|
EnvVar: "PHOTOPRISM_SITE_CAPTION",
|
2019-12-11 14:10:20 +01:00
|
|
|
},
|
|
|
|
cli.StringFlag{
|
2020-05-31 02:09:52 +02:00
|
|
|
Name: "site-description",
|
|
|
|
Usage: "long site description",
|
|
|
|
EnvVar: "PHOTOPRISM_SITE_DESCRIPTION",
|
2019-12-11 14:10:20 +01:00
|
|
|
},
|
|
|
|
cli.StringFlag{
|
2020-05-31 02:09:52 +02:00
|
|
|
Name: "site-author",
|
2020-06-26 14:26:36 +02:00
|
|
|
Usage: "site artist or copyright",
|
2020-05-31 02:09:52 +02:00
|
|
|
EnvVar: "PHOTOPRISM_SITE_AUTHOR",
|
|
|
|
},
|
|
|
|
cli.IntFlag{
|
|
|
|
Name: "http-port",
|
|
|
|
Value: 2342,
|
2020-06-26 14:26:36 +02:00
|
|
|
Usage: "http server port `NUMBER``",
|
2020-05-31 02:09:52 +02:00
|
|
|
EnvVar: "PHOTOPRISM_HTTP_PORT",
|
2019-12-11 14:10:20 +01:00
|
|
|
},
|
2019-05-04 13:29:32 +02:00
|
|
|
cli.StringFlag{
|
2020-05-31 02:09:52 +02:00
|
|
|
Name: "http-host",
|
2020-06-26 14:26:36 +02:00
|
|
|
Usage: "http server `IP` address",
|
2020-05-31 02:09:52 +02:00
|
|
|
EnvVar: "PHOTOPRISM_HTTP_HOST",
|
2019-05-04 13:29:32 +02:00
|
|
|
},
|
2019-06-30 05:38:39 +02:00
|
|
|
cli.StringFlag{
|
2020-05-31 02:09:52 +02:00
|
|
|
Name: "http-mode, m",
|
|
|
|
Usage: "debug, release or test",
|
|
|
|
EnvVar: "PHOTOPRISM_HTTP_MODE",
|
2019-06-30 05:38:39 +02:00
|
|
|
},
|
2020-12-18 09:11:42 +01:00
|
|
|
cli.StringFlag{
|
|
|
|
Name: "admin-password",
|
|
|
|
Usage: "initial admin `PASSWORD`",
|
|
|
|
EnvVar: "PHOTOPRISM_ADMIN_PASSWORD",
|
|
|
|
},
|
2019-06-30 05:38:39 +02:00
|
|
|
cli.StringFlag{
|
2020-05-31 02:09:52 +02:00
|
|
|
Name: "database-driver",
|
2020-06-26 14:26:36 +02:00
|
|
|
Usage: "database driver `NAME` (sqlite or mysql)",
|
2020-05-31 02:09:52 +02:00
|
|
|
Value: "sqlite",
|
|
|
|
EnvVar: "PHOTOPRISM_DATABASE_DRIVER",
|
2019-06-30 05:38:39 +02:00
|
|
|
},
|
2018-09-24 09:53:16 +02:00
|
|
|
cli.StringFlag{
|
2020-05-31 02:09:52 +02:00
|
|
|
Name: "database-dsn",
|
2020-12-11 12:46:28 +01:00
|
|
|
Usage: "sqlite file name, `DSN` is optional for mysql",
|
2020-05-31 02:09:52 +02:00
|
|
|
EnvVar: "PHOTOPRISM_DATABASE_DSN",
|
|
|
|
},
|
2020-12-11 12:46:28 +01:00
|
|
|
cli.StringFlag{
|
|
|
|
Name: "database-server",
|
|
|
|
Usage: "database server `HOST`, port is optional",
|
|
|
|
EnvVar: "PHOTOPRISM_DATABASE_SERVER",
|
|
|
|
},
|
|
|
|
cli.StringFlag{
|
|
|
|
Name: "database-name",
|
|
|
|
Value: "photoprism",
|
|
|
|
Usage: "database `NAME`",
|
|
|
|
EnvVar: "PHOTOPRISM_DATABASE_NAME",
|
|
|
|
},
|
|
|
|
cli.StringFlag{
|
|
|
|
Name: "database-user",
|
|
|
|
Value: "photoprism",
|
|
|
|
Usage: "database user `NAME`",
|
|
|
|
EnvVar: "PHOTOPRISM_DATABASE_USER",
|
|
|
|
},
|
|
|
|
cli.StringFlag{
|
|
|
|
Name: "database-password",
|
|
|
|
Usage: "database user `PASSWORD``",
|
|
|
|
EnvVar: "PHOTOPRISM_DATABASE_PASSWORD",
|
|
|
|
},
|
2020-05-31 02:09:52 +02:00
|
|
|
cli.IntFlag{
|
|
|
|
Name: "database-conns",
|
2020-12-18 09:11:42 +01:00
|
|
|
Usage: "`LIMIT` the number of open database connections",
|
2020-05-31 02:09:52 +02:00
|
|
|
EnvVar: "PHOTOPRISM_DATABASE_CONNS",
|
|
|
|
},
|
2020-07-13 10:41:45 +02:00
|
|
|
cli.IntFlag{
|
|
|
|
Name: "database-conns-idle",
|
2020-12-18 09:11:42 +01:00
|
|
|
Usage: "`LIMIT` the number of idle database connections",
|
2020-07-13 10:41:45 +02:00
|
|
|
EnvVar: "PHOTOPRISM_DATABASE_CONNS_IDLE",
|
|
|
|
},
|
2020-08-12 13:16:25 +02:00
|
|
|
cli.StringFlag{
|
|
|
|
Name: "rawtherapee-bin",
|
2020-12-18 09:11:42 +01:00
|
|
|
Usage: "RawTherapee CLI `COMMAND` for raw image conversion",
|
2020-08-12 13:16:25 +02:00
|
|
|
Value: "rawtherapee-cli",
|
|
|
|
EnvVar: "PHOTOPRISM_RAWTHERAPEE_BIN",
|
|
|
|
},
|
2019-06-06 14:44:29 +02:00
|
|
|
cli.StringFlag{
|
|
|
|
Name: "darktable-bin",
|
2020-12-18 09:11:42 +01:00
|
|
|
Usage: "Darktable CLI `COMMAND` for raw image conversion",
|
2019-06-06 14:44:29 +02:00
|
|
|
Value: "darktable-cli",
|
|
|
|
EnvVar: "PHOTOPRISM_DARKTABLE_BIN",
|
|
|
|
},
|
2020-07-12 16:36:39 +02:00
|
|
|
cli.BoolFlag{
|
2020-07-21 12:18:53 +02:00
|
|
|
Name: "darktable-presets",
|
2020-12-18 09:11:42 +01:00
|
|
|
Usage: "use Darktable presets (disables concurrent raw image conversion)",
|
2020-07-21 12:18:53 +02:00
|
|
|
EnvVar: "PHOTOPRISM_DARKTABLE_PRESETS",
|
2020-07-13 15:23:54 +02:00
|
|
|
},
|
|
|
|
cli.StringFlag{
|
|
|
|
Name: "sips-bin",
|
2020-12-18 09:11:42 +01:00
|
|
|
Usage: "Scriptable Image Processing System `COMMAND`",
|
2020-07-13 15:23:54 +02:00
|
|
|
Value: "sips",
|
|
|
|
EnvVar: "PHOTOPRISM_SIPS_BIN",
|
2020-07-12 16:36:39 +02:00
|
|
|
},
|
2020-05-11 18:29:17 +02:00
|
|
|
cli.StringFlag{
|
|
|
|
Name: "heifconvert-bin",
|
2020-12-18 09:11:42 +01:00
|
|
|
Usage: "HEIC/HEIF image convert `COMMAND`",
|
2020-05-11 18:29:17 +02:00
|
|
|
Value: "heif-convert",
|
|
|
|
EnvVar: "PHOTOPRISM_HEIFCONVERT_BIN",
|
|
|
|
},
|
|
|
|
cli.StringFlag{
|
2020-05-13 15:36:42 +02:00
|
|
|
Name: "ffmpeg-bin",
|
2020-12-18 09:11:42 +01:00
|
|
|
Usage: "FFmpeg `COMMAND` for video transcoding and cover images",
|
2020-05-13 15:36:42 +02:00
|
|
|
Value: "ffmpeg",
|
2020-05-11 18:29:17 +02:00
|
|
|
EnvVar: "PHOTOPRISM_FFMPEG_BIN",
|
|
|
|
},
|
2019-06-06 14:44:29 +02:00
|
|
|
cli.StringFlag{
|
|
|
|
Name: "exiftool-bin",
|
2020-12-18 09:11:42 +01:00
|
|
|
Usage: "ExifTool `COMMAND` for metadata extraction",
|
2019-06-06 14:44:29 +02:00
|
|
|
Value: "exiftool",
|
|
|
|
EnvVar: "PHOTOPRISM_EXIFTOOL_BIN",
|
|
|
|
},
|
2020-05-27 19:38:40 +02:00
|
|
|
cli.StringFlag{
|
|
|
|
Name: "download-token",
|
2020-06-26 14:26:36 +02:00
|
|
|
Usage: "`SECRET` url token for file downloads",
|
2020-05-27 19:38:40 +02:00
|
|
|
EnvVar: "PHOTOPRISM_DOWNLOAD_TOKEN",
|
|
|
|
},
|
|
|
|
cli.StringFlag{
|
2020-05-27 19:56:56 +02:00
|
|
|
Name: "preview-token",
|
2020-06-26 16:11:56 +02:00
|
|
|
Usage: "`SECRET` url token for preview images and video streaming",
|
|
|
|
Value: "public",
|
2020-05-27 19:56:56 +02:00
|
|
|
EnvVar: "PHOTOPRISM_PREVIEW_TOKEN",
|
2020-05-27 19:38:40 +02:00
|
|
|
},
|
2020-01-13 11:07:09 +01:00
|
|
|
cli.StringFlag{
|
2020-05-05 17:17:19 +02:00
|
|
|
Name: "thumb-filter, f",
|
2020-06-26 14:26:36 +02:00
|
|
|
Usage: "resample filter `NAME` (best to worst: blackman, lanczos, cubic, linear)",
|
2020-01-31 16:28:52 +01:00
|
|
|
Value: "lanczos",
|
2020-05-05 17:17:19 +02:00
|
|
|
EnvVar: "PHOTOPRISM_THUMB_FILTER",
|
2020-05-05 15:42:54 +02:00
|
|
|
},
|
|
|
|
cli.BoolFlag{
|
2020-05-05 17:04:13 +02:00
|
|
|
Name: "thumb-uncached, u",
|
2020-07-13 15:23:54 +02:00
|
|
|
Usage: "enable on-demand thumbnail rendering (high memory and cpu usage)",
|
2020-05-05 17:04:13 +02:00
|
|
|
EnvVar: "PHOTOPRISM_THUMB_UNCACHED",
|
|
|
|
},
|
|
|
|
cli.IntFlag{
|
|
|
|
Name: "thumb-size, s",
|
2020-07-13 15:23:54 +02:00
|
|
|
Usage: "pre-rendered thumbnail size limit in `PIXELS` (720-7680)",
|
2020-05-05 17:04:13 +02:00
|
|
|
Value: 2048,
|
|
|
|
EnvVar: "PHOTOPRISM_THUMB_SIZE",
|
|
|
|
},
|
|
|
|
cli.IntFlag{
|
2020-07-13 15:23:54 +02:00
|
|
|
Name: "thumb-size-uncached, x",
|
|
|
|
Usage: "on-demand rendering size limit in `PIXELS` (720-7680)",
|
2020-07-15 08:30:28 +02:00
|
|
|
Value: 7680,
|
2020-07-13 15:23:54 +02:00
|
|
|
EnvVar: "PHOTOPRISM_THUMB_SIZE_UNCACHED",
|
|
|
|
},
|
|
|
|
cli.IntFlag{
|
2020-07-14 14:30:19 +02:00
|
|
|
Name: "jpeg-size",
|
2020-07-13 15:23:54 +02:00
|
|
|
Usage: "size limit for converted image files in `PIXELS` (720-30000)",
|
2020-07-15 08:30:28 +02:00
|
|
|
Value: 7680,
|
2020-07-14 14:30:19 +02:00
|
|
|
EnvVar: "PHOTOPRISM_JPEG_SIZE",
|
2020-01-13 11:07:09 +01:00
|
|
|
},
|
2020-05-19 11:00:17 +02:00
|
|
|
cli.IntFlag{
|
|
|
|
Name: "jpeg-quality, q",
|
2020-06-26 14:26:36 +02:00
|
|
|
Usage: "choose 95 for high-quality thumbnails (25-100)",
|
2020-08-12 13:16:25 +02:00
|
|
|
Value: 92,
|
2020-05-19 11:00:17 +02:00
|
|
|
EnvVar: "PHOTOPRISM_JPEG_QUALITY",
|
|
|
|
},
|
2018-09-24 09:53:16 +02:00
|
|
|
}
|