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-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-11-11 21:10:41 +01:00
|
|
|
cli.BoolFlag{
|
2020-05-31 02:09:52 +02:00
|
|
|
Name: "tf-off",
|
|
|
|
Usage: "don't use TensorFlow for image classification (or anything else)",
|
|
|
|
EnvVar: "PHOTOPRISM_TENSORFLOW_OFF",
|
2019-11-11 21:10:41 +01:00
|
|
|
},
|
2019-12-30 12:38:11 +01:00
|
|
|
cli.BoolFlag{
|
|
|
|
Name: "experimental, e",
|
|
|
|
Usage: "enable experimental features",
|
|
|
|
EnvVar: "PHOTOPRISM_EXPERIMENTAL",
|
|
|
|
},
|
2020-05-31 02:09:52 +02:00
|
|
|
cli.StringFlag{
|
|
|
|
Name: "admin-password",
|
2020-06-29 21:14:34 +02:00
|
|
|
Usage: "initial admin password (can be changed in settings)",
|
2020-05-31 02:09:52 +02:00
|
|
|
EnvVar: "PHOTOPRISM_ADMIN_PASSWORD",
|
|
|
|
},
|
2020-01-06 23:43:19 +01:00
|
|
|
cli.IntFlag{
|
|
|
|
Name: "workers, w",
|
|
|
|
Usage: "number of workers for indexing",
|
|
|
|
EnvVar: "PHOTOPRISM_WORKERS",
|
|
|
|
},
|
2020-04-06 22:09:45 +02:00
|
|
|
cli.IntFlag{
|
|
|
|
Name: "wakeup-interval",
|
|
|
|
Usage: "background worker wakeup interval in seconds",
|
|
|
|
EnvVar: "PHOTOPRISM_WAKEUP_INTERVAL",
|
|
|
|
},
|
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
|
|
|
},
|
|
|
|
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-06-26 14:26:36 +02:00
|
|
|
Usage: "data source or file name (`DSN`)",
|
2020-05-31 02:09:52 +02:00
|
|
|
EnvVar: "PHOTOPRISM_DATABASE_DSN",
|
|
|
|
},
|
|
|
|
cli.IntFlag{
|
|
|
|
Name: "database-conns",
|
2020-07-13 10:41:45 +02:00
|
|
|
Usage: "max `NUMBER` of open connections to the database",
|
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",
|
|
|
|
Usage: "max `NUMBER` of idle connections (equal or less than open)",
|
|
|
|
EnvVar: "PHOTOPRISM_DATABASE_CONNS_IDLE",
|
|
|
|
},
|
2020-05-31 02:09:52 +02:00
|
|
|
cli.StringFlag{
|
|
|
|
Name: "assets-path",
|
2020-05-31 11:28:28 +02:00
|
|
|
Usage: "assets `PATH` for static files like templates and TensorFlow models",
|
2020-05-31 02:09:52 +02:00
|
|
|
EnvVar: "PHOTOPRISM_ASSETS_PATH",
|
2018-09-24 09:53:16 +02:00
|
|
|
},
|
2019-06-05 18:25:20 +02:00
|
|
|
cli.StringFlag{
|
2020-05-31 02:09:52 +02:00
|
|
|
Name: "storage-path",
|
2020-05-31 11:28:28 +02:00
|
|
|
Usage: "storage `PATH` for generated files like cache and index",
|
2020-05-31 02:09:52 +02:00
|
|
|
EnvVar: "PHOTOPRISM_STORAGE_PATH",
|
2019-06-05 18:25:20 +02:00
|
|
|
},
|
|
|
|
cli.StringFlag{
|
2020-05-31 02:09:52 +02:00
|
|
|
Name: "import-path",
|
2020-05-31 12:20:32 +02:00
|
|
|
Usage: "optional import `PATH` for copying files to originals",
|
2020-05-31 02:09:52 +02:00
|
|
|
EnvVar: "PHOTOPRISM_IMPORT_PATH",
|
2019-06-05 18:25:20 +02:00
|
|
|
},
|
2018-09-24 09:53:16 +02:00
|
|
|
cli.StringFlag{
|
|
|
|
Name: "originals-path",
|
2020-05-31 12:20:32 +02:00
|
|
|
Usage: "originals `PATH` for photo, video and sidecar files",
|
2018-09-24 09:53:16 +02:00
|
|
|
EnvVar: "PHOTOPRISM_ORIGINALS_PATH",
|
|
|
|
},
|
2020-05-25 19:10:44 +02:00
|
|
|
cli.IntFlag{
|
|
|
|
Name: "originals-limit",
|
|
|
|
Value: 1000,
|
2020-06-26 14:26:36 +02:00
|
|
|
Usage: "file size limit for originals in `MEGABYTE`",
|
2020-05-25 19:10:44 +02:00
|
|
|
EnvVar: "PHOTOPRISM_ORIGINALS_LIMIT",
|
|
|
|
},
|
2018-09-24 09:53:16 +02:00
|
|
|
cli.StringFlag{
|
2020-05-31 02:09:52 +02:00
|
|
|
Name: "log-level, l",
|
|
|
|
Usage: "trace, debug, info, warning, error, fatal or panic",
|
|
|
|
Value: "info",
|
|
|
|
EnvVar: "PHOTOPRISM_LOG_LEVEL",
|
2018-09-24 09:53:16 +02:00
|
|
|
},
|
2020-04-06 16:34:29 +02:00
|
|
|
cli.StringFlag{
|
2020-05-31 02:09:52 +02:00
|
|
|
Name: "log-filename",
|
|
|
|
Usage: "filename for storing server logs",
|
|
|
|
EnvVar: "PHOTOPRISM_LOG_FILENAME",
|
|
|
|
Value: "",
|
|
|
|
},
|
|
|
|
cli.StringFlag{
|
|
|
|
Name: "pid-filename",
|
|
|
|
Usage: "filename for the server process id (pid)",
|
|
|
|
EnvVar: "PHOTOPRISM_PID_FILENAME",
|
2020-04-06 16:34:29 +02:00
|
|
|
},
|
2018-11-09 20:48:23 +01:00
|
|
|
cli.StringFlag{
|
|
|
|
Name: "cache-path",
|
|
|
|
Usage: "cache `PATH`",
|
|
|
|
EnvVar: "PHOTOPRISM_CACHE_PATH",
|
|
|
|
},
|
2018-09-24 09:53:16 +02:00
|
|
|
cli.StringFlag{
|
2020-05-31 02:09:52 +02:00
|
|
|
Name: "temp-path",
|
|
|
|
Usage: "temporary `PATH` for uploads and downloads",
|
|
|
|
EnvVar: "PHOTOPRISM_TEMP_PATH",
|
|
|
|
},
|
|
|
|
cli.StringFlag{
|
|
|
|
Name: "config-file, c",
|
|
|
|
Usage: "load configuration from `FILENAME`",
|
|
|
|
EnvVar: "PHOTOPRISM_CONFIG_FILE",
|
|
|
|
},
|
|
|
|
cli.StringFlag{
|
|
|
|
Name: "settings-path",
|
|
|
|
Usage: "settings `PATH`",
|
|
|
|
EnvVar: "PHOTOPRISM_SETTINGS_PATH",
|
|
|
|
},
|
|
|
|
cli.BoolFlag{
|
|
|
|
Name: "settings-hidden",
|
|
|
|
Usage: "users can not view or change settings",
|
|
|
|
EnvVar: "PHOTOPRISM_SETTINGS_HIDDEN",
|
2018-09-24 09:53:16 +02:00
|
|
|
},
|
2019-06-06 14:44:29 +02:00
|
|
|
cli.StringFlag{
|
|
|
|
Name: "sips-bin",
|
2020-05-11 18:29:17 +02:00
|
|
|
Usage: "sips executable `FILENAME`",
|
2019-06-06 14:44:29 +02:00
|
|
|
Value: "sips",
|
|
|
|
EnvVar: "PHOTOPRISM_SIPS_BIN",
|
|
|
|
},
|
|
|
|
cli.StringFlag{
|
|
|
|
Name: "darktable-bin",
|
2020-05-11 18:29:17 +02:00
|
|
|
Usage: "darktable-cli executable `FILENAME`",
|
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{
|
|
|
|
Name: "darktable-workers",
|
|
|
|
Usage: "disable presets to run multiple instances concurrently",
|
|
|
|
EnvVar: "PHOTOPRISM_DARKTABLE_WORKERS",
|
|
|
|
},
|
2020-05-11 18:29:17 +02:00
|
|
|
cli.StringFlag{
|
|
|
|
Name: "heifconvert-bin",
|
|
|
|
Usage: "heif-convert executable `FILENAME`",
|
|
|
|
Value: "heif-convert",
|
|
|
|
EnvVar: "PHOTOPRISM_HEIFCONVERT_BIN",
|
|
|
|
},
|
|
|
|
cli.StringFlag{
|
2020-05-13 15:36:42 +02:00
|
|
|
Name: "ffmpeg-bin",
|
|
|
|
Usage: "ffmpeg executable `FILENAME`",
|
|
|
|
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-05-11 18:29:17 +02:00
|
|
|
Usage: "exiftool executable `FILENAME`",
|
2019-06-06 14:44:29 +02:00
|
|
|
Value: "exiftool",
|
|
|
|
EnvVar: "PHOTOPRISM_EXIFTOOL_BIN",
|
|
|
|
},
|
2020-05-11 18:29:17 +02:00
|
|
|
cli.BoolFlag{
|
2020-05-14 11:57:26 +02:00
|
|
|
Name: "sidecar-json, j",
|
2020-05-19 11:00:17 +02:00
|
|
|
Usage: "read metadata from JSON sidecar files created by exiftool",
|
2020-05-13 20:53:15 +02:00
|
|
|
EnvVar: "PHOTOPRISM_SIDECAR_JSON",
|
2019-06-06 14:44:29 +02:00
|
|
|
},
|
2020-05-18 22:18:58 +02:00
|
|
|
cli.BoolFlag{
|
|
|
|
Name: "sidecar-yaml, y",
|
2020-05-19 11:00:17 +02:00
|
|
|
Usage: "backup photo metadata to YAML sidecar files",
|
2020-05-18 22:18:58 +02:00
|
|
|
EnvVar: "PHOTOPRISM_SIDECAR_YAML",
|
|
|
|
},
|
2020-05-19 11:00:17 +02:00
|
|
|
cli.BoolFlag{
|
|
|
|
Name: "sidecar-hidden",
|
|
|
|
Usage: "create JSON and YAML sidecar files in .photoprism if enabled",
|
|
|
|
EnvVar: "PHOTOPRISM_SIDECAR_HIDDEN",
|
|
|
|
},
|
2020-06-07 10:09:35 +02:00
|
|
|
cli.StringFlag{
|
|
|
|
Name: "sidecar-path",
|
|
|
|
Usage: "storage `PATH` for automatically created sidecar files (relative or absolute)",
|
|
|
|
EnvVar: "PHOTOPRISM_SIDECAR_PATH",
|
|
|
|
},
|
2019-12-15 17:19:16 +01:00
|
|
|
cli.BoolFlag{
|
2020-01-13 16:48:32 +01:00
|
|
|
Name: "detect-nsfw",
|
2020-04-24 20:28:16 +02:00
|
|
|
Usage: "flag photos as private that may be offensive",
|
2020-01-13 16:48:32 +01:00
|
|
|
EnvVar: "PHOTOPRISM_DETECT_NSFW",
|
2019-12-15 17:19:16 +01:00
|
|
|
},
|
|
|
|
cli.BoolFlag{
|
|
|
|
Name: "upload-nsfw",
|
2020-04-24 20:28:16 +02:00
|
|
|
Usage: "allow uploads that may be offensive",
|
2019-12-15 17:19:16 +01:00
|
|
|
EnvVar: "PHOTOPRISM_UPLOAD_NSFW",
|
|
|
|
},
|
2020-01-06 06:59:35 +01:00
|
|
|
cli.StringFlag{
|
|
|
|
Name: "geocoding-api, g",
|
|
|
|
Usage: "geocoding api (none, osm or places)",
|
|
|
|
Value: "places",
|
|
|
|
EnvVar: "PHOTOPRISM_GEOCODING_API",
|
|
|
|
},
|
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",
|
|
|
|
Usage: "on-demand rendering of default thumbnails (high memory and cpu usage)",
|
|
|
|
EnvVar: "PHOTOPRISM_THUMB_UNCACHED",
|
|
|
|
},
|
|
|
|
cli.IntFlag{
|
|
|
|
Name: "thumb-size, s",
|
2020-06-26 14:26:36 +02:00
|
|
|
Usage: "default thumbnail size limit in `PIXELS` (720-3840)",
|
2020-05-05 17:04:13 +02:00
|
|
|
Value: 2048,
|
|
|
|
EnvVar: "PHOTOPRISM_THUMB_SIZE",
|
|
|
|
},
|
|
|
|
cli.IntFlag{
|
|
|
|
Name: "thumb-limit, x",
|
2020-06-26 14:26:36 +02:00
|
|
|
Usage: "on-demand thumbnail size limit in `PIXELS` (720-3840)",
|
2020-05-05 17:04:13 +02:00
|
|
|
Value: 3840,
|
|
|
|
EnvVar: "PHOTOPRISM_THUMB_LIMIT",
|
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-05-19 11:00:17 +02:00
|
|
|
Value: 90,
|
|
|
|
EnvVar: "PHOTOPRISM_JPEG_QUALITY",
|
|
|
|
},
|
2018-09-24 09:53:16 +02:00
|
|
|
}
|