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-02-21 01:14:45 +01:00
|
|
|
// GlobalFlags lists all CLI flags
|
2018-09-24 09:53:16 +02:00
|
|
|
var GlobalFlags = []cli.Flag{
|
2020-04-06 22:09:45 +02:00
|
|
|
cli.StringFlag{
|
|
|
|
Name: "admin-password",
|
|
|
|
Usage: "admin password",
|
|
|
|
Value: "photoprism",
|
|
|
|
EnvVar: "PHOTOPRISM_ADMIN_PASSWORD",
|
|
|
|
},
|
|
|
|
cli.StringFlag{
|
|
|
|
Name: "webdav-password",
|
|
|
|
Usage: "WebDAV password (none to disable)",
|
|
|
|
Value: "",
|
|
|
|
EnvVar: "PHOTOPRISM_WEBDAV_PASSWORD",
|
|
|
|
},
|
2018-09-24 09:53:16 +02:00
|
|
|
cli.BoolFlag{
|
|
|
|
Name: "debug",
|
|
|
|
Usage: "run in debug mode",
|
|
|
|
EnvVar: "PHOTOPRISM_DEBUG",
|
|
|
|
},
|
2019-05-04 09:11:33 +02:00
|
|
|
cli.BoolFlag{
|
|
|
|
Name: "read-only, r",
|
|
|
|
Usage: "run in read-only mode",
|
|
|
|
EnvVar: "PHOTOPRISM_READ_ONLY",
|
|
|
|
},
|
2019-11-11 21:10:41 +01:00
|
|
|
cli.BoolFlag{
|
2020-01-08 19:51:21 +01:00
|
|
|
Name: "public, p",
|
2019-11-11 21:10:41 +01:00
|
|
|
Usage: "no authentication required",
|
|
|
|
EnvVar: "PHOTOPRISM_PUBLIC",
|
|
|
|
},
|
2019-12-30 12:38:11 +01:00
|
|
|
cli.BoolFlag{
|
|
|
|
Name: "experimental, e",
|
|
|
|
Usage: "enable experimental features",
|
|
|
|
EnvVar: "PHOTOPRISM_EXPERIMENTAL",
|
|
|
|
},
|
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{
|
|
|
|
Name: "url",
|
|
|
|
Usage: "canonical site URL",
|
|
|
|
Value: "http://localhost:2342/",
|
|
|
|
EnvVar: "PHOTOPRISM_URL",
|
|
|
|
},
|
|
|
|
cli.StringFlag{
|
|
|
|
Name: "title",
|
|
|
|
Usage: "site title",
|
|
|
|
Value: "PhotoPrism",
|
|
|
|
EnvVar: "PHOTOPRISM_TITLE",
|
|
|
|
},
|
|
|
|
cli.StringFlag{
|
|
|
|
Name: "subtitle",
|
|
|
|
Usage: "site subtitle",
|
|
|
|
Value: "Browse your life",
|
|
|
|
EnvVar: "PHOTOPRISM_SUBTITLE",
|
|
|
|
},
|
|
|
|
cli.StringFlag{
|
|
|
|
Name: "description",
|
|
|
|
Usage: "site description",
|
|
|
|
Value: "Personal Photo Management",
|
|
|
|
EnvVar: "PHOTOPRISM_DESCRIPTION",
|
|
|
|
},
|
|
|
|
cli.StringFlag{
|
|
|
|
Name: "author",
|
|
|
|
Usage: "site owner / copyright",
|
|
|
|
Value: "Anonymous",
|
|
|
|
EnvVar: "PHOTOPRISM_AUTHOR",
|
|
|
|
},
|
|
|
|
cli.StringFlag{
|
|
|
|
Name: "twitter",
|
|
|
|
Usage: "twitter handle for sharing",
|
|
|
|
Value: "@browseyourlife",
|
|
|
|
EnvVar: "PHOTOPRISM_TWITTER",
|
|
|
|
},
|
2019-05-04 13:29:32 +02:00
|
|
|
cli.StringFlag{
|
|
|
|
Name: "log-level, l",
|
|
|
|
Usage: "trace, debug, info, warning, error, fatal or panic",
|
|
|
|
Value: "info",
|
|
|
|
EnvVar: "PHOTOPRISM_LOG_LEVEL",
|
|
|
|
},
|
2019-06-30 05:38:39 +02:00
|
|
|
cli.StringFlag{
|
|
|
|
Name: "log-filename",
|
|
|
|
Usage: "filename for storing server logs",
|
|
|
|
EnvVar: "PHOTOPRISM_LOG_FILENAME",
|
|
|
|
Value: "~/.local/share/photoprism/photoprism.log",
|
|
|
|
},
|
|
|
|
cli.StringFlag{
|
|
|
|
Name: "pid-filename",
|
|
|
|
Usage: "filename for the server process id (pid)",
|
|
|
|
EnvVar: "PHOTOPRISM_PID_FILENAME",
|
|
|
|
Value: "~/.local/share/photoprism/photoprism.pid",
|
|
|
|
},
|
2018-09-24 09:53:16 +02:00
|
|
|
cli.StringFlag{
|
|
|
|
Name: "config-file, c",
|
|
|
|
Usage: "load configuration from `FILENAME`",
|
2019-06-05 18:25:20 +02:00
|
|
|
Value: "~/.config/photoprism/photoprism.yml",
|
2018-09-24 09:53:16 +02:00
|
|
|
EnvVar: "PHOTOPRISM_CONFIG_FILE",
|
|
|
|
},
|
2019-06-05 18:25:20 +02:00
|
|
|
cli.StringFlag{
|
|
|
|
Name: "config-path",
|
|
|
|
Usage: "config `PATH`",
|
2019-06-29 23:27:42 +02:00
|
|
|
Value: "~/.config/photoprism",
|
2019-06-05 18:25:20 +02:00
|
|
|
EnvVar: "PHOTOPRISM_CONFIG_PATH",
|
|
|
|
},
|
|
|
|
cli.StringFlag{
|
|
|
|
Name: "resources-path",
|
|
|
|
Usage: "resources `PATH`",
|
|
|
|
EnvVar: "PHOTOPRISM_RESOURCES_PATH",
|
|
|
|
},
|
2018-09-24 09:53:16 +02:00
|
|
|
cli.StringFlag{
|
|
|
|
Name: "originals-path",
|
|
|
|
Usage: "originals `PATH`",
|
2019-06-29 23:27:42 +02:00
|
|
|
Value: "~/Pictures/Originals",
|
2018-09-24 09:53:16 +02:00
|
|
|
EnvVar: "PHOTOPRISM_ORIGINALS_PATH",
|
|
|
|
},
|
|
|
|
cli.StringFlag{
|
|
|
|
Name: "import-path",
|
|
|
|
Usage: "import `PATH`",
|
2019-06-29 23:27:42 +02:00
|
|
|
Value: "~/Pictures/Import",
|
2018-09-24 09:53:16 +02:00
|
|
|
EnvVar: "PHOTOPRISM_IMPORT_PATH",
|
|
|
|
},
|
2020-04-06 16:34:29 +02:00
|
|
|
cli.StringFlag{
|
|
|
|
Name: "temp-path",
|
|
|
|
Usage: "temporary `PATH` for uploads and downloads",
|
|
|
|
Value: "",
|
|
|
|
EnvVar: "PHOTOPRISM_TEMP_PATH",
|
|
|
|
},
|
2018-11-09 20:48:23 +01:00
|
|
|
cli.StringFlag{
|
|
|
|
Name: "cache-path",
|
|
|
|
Usage: "cache `PATH`",
|
2019-06-29 23:27:42 +02:00
|
|
|
Value: "~/.cache/photoprism",
|
2018-11-09 20:48:23 +01:00
|
|
|
EnvVar: "PHOTOPRISM_CACHE_PATH",
|
|
|
|
},
|
2018-09-24 09:53:16 +02:00
|
|
|
cli.StringFlag{
|
|
|
|
Name: "assets-path",
|
|
|
|
Usage: "assets `PATH`",
|
2019-06-29 23:27:42 +02:00
|
|
|
Value: "~/.local/share/photoprism",
|
2018-09-24 09:53:16 +02:00
|
|
|
EnvVar: "PHOTOPRISM_ASSETS_PATH",
|
|
|
|
},
|
2020-03-23 20:29:31 +01:00
|
|
|
cli.StringFlag{
|
|
|
|
Name: "database-path",
|
|
|
|
Usage: "built-in database server storage path",
|
|
|
|
EnvVar: "PHOTOPRISM_DATABASE_PATH",
|
|
|
|
},
|
2018-09-24 09:53:16 +02:00
|
|
|
cli.StringFlag{
|
|
|
|
Name: "database-driver",
|
2018-12-21 08:44:13 +01:00
|
|
|
Usage: "database `DRIVER` (internal or mysql)",
|
|
|
|
Value: "internal",
|
2018-09-24 09:53:16 +02:00
|
|
|
EnvVar: "PHOTOPRISM_DATABASE_DRIVER",
|
|
|
|
},
|
|
|
|
cli.StringFlag{
|
|
|
|
Name: "database-dsn",
|
|
|
|
Usage: "database data source name (`DSN`)",
|
2018-12-18 18:38:30 +01:00
|
|
|
Value: "root:@tcp(localhost:4000)/photoprism?parseTime=true",
|
2018-09-24 09:53:16 +02:00
|
|
|
EnvVar: "PHOTOPRISM_DATABASE_DSN",
|
|
|
|
},
|
2019-06-06 14:44:29 +02:00
|
|
|
cli.StringFlag{
|
|
|
|
Name: "sips-bin",
|
|
|
|
Usage: "sips cli binary `FILENAME`",
|
|
|
|
Value: "sips",
|
|
|
|
EnvVar: "PHOTOPRISM_SIPS_BIN",
|
|
|
|
},
|
|
|
|
cli.StringFlag{
|
|
|
|
Name: "darktable-bin",
|
|
|
|
Usage: "darktable cli binary `FILENAME`",
|
|
|
|
Value: "darktable-cli",
|
|
|
|
EnvVar: "PHOTOPRISM_DARKTABLE_BIN",
|
|
|
|
},
|
|
|
|
cli.StringFlag{
|
|
|
|
Name: "exiftool-bin",
|
|
|
|
Usage: "exiftool cli binary `FILENAME`",
|
|
|
|
Value: "exiftool",
|
|
|
|
EnvVar: "PHOTOPRISM_EXIFTOOL_BIN",
|
|
|
|
},
|
|
|
|
cli.StringFlag{
|
|
|
|
Name: "heifconvert-bin",
|
|
|
|
Usage: "heif conversion cli binary `FILENAME`",
|
|
|
|
Value: "heif-convert",
|
|
|
|
EnvVar: "PHOTOPRISM_HEIFCONVERT_BIN",
|
|
|
|
},
|
2019-07-02 18:25:46 +02:00
|
|
|
cli.IntFlag{
|
2020-01-08 19:51:21 +01:00
|
|
|
Name: "http-port",
|
2019-07-02 18:25:46 +02:00
|
|
|
Usage: "HTTP server port",
|
|
|
|
EnvVar: "PHOTOPRISM_HTTP_PORT",
|
|
|
|
},
|
|
|
|
cli.StringFlag{
|
2020-01-08 19:51:21 +01:00
|
|
|
Name: "http-host",
|
2019-07-02 18:25:46 +02:00
|
|
|
Usage: "HTTP server host",
|
|
|
|
EnvVar: "PHOTOPRISM_HTTP_HOST",
|
|
|
|
},
|
|
|
|
cli.StringFlag{
|
|
|
|
Name: "http-mode, m",
|
|
|
|
Usage: "debug, release or test",
|
|
|
|
EnvVar: "PHOTOPRISM_HTTP_MODE",
|
|
|
|
},
|
|
|
|
cli.IntFlag{
|
2020-01-08 19:51:21 +01:00
|
|
|
Name: "sql-port",
|
2019-07-02 18:25:46 +02:00
|
|
|
Usage: "built-in SQL server port",
|
|
|
|
EnvVar: "PHOTOPRISM_SQL_PORT",
|
|
|
|
},
|
|
|
|
cli.StringFlag{
|
|
|
|
Name: "sql-host",
|
|
|
|
Usage: "built-in SQL server host",
|
|
|
|
EnvVar: "PHOTOPRISM_SQL_HOST",
|
|
|
|
},
|
|
|
|
cli.StringFlag{
|
|
|
|
Name: "sql-password",
|
|
|
|
Usage: "built-in SQL server password",
|
|
|
|
EnvVar: "PHOTOPRISM_SQL_PASSWORD",
|
|
|
|
},
|
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",
|
|
|
|
},
|
|
|
|
cli.IntFlag{
|
|
|
|
Name: "thumb-quality, q",
|
2020-01-06 14:32:15 +01:00
|
|
|
Usage: "jpeg quality of thumbnails (25-100)",
|
2020-01-13 11:07:09 +01:00
|
|
|
Value: 90,
|
2020-01-06 06:59:35 +01:00
|
|
|
EnvVar: "PHOTOPRISM_THUMB_QUALITY",
|
|
|
|
},
|
|
|
|
cli.IntFlag{
|
2020-01-08 19:51:21 +01:00
|
|
|
Name: "thumb-size, s",
|
2020-01-13 12:25:16 +01:00
|
|
|
Usage: "pre-render size limit in pixels (720-3840)",
|
2020-01-13 11:07:09 +01:00
|
|
|
Value: 2048,
|
2020-01-06 06:59:35 +01:00
|
|
|
EnvVar: "PHOTOPRISM_THUMB_SIZE",
|
|
|
|
},
|
2020-01-13 11:07:09 +01:00
|
|
|
cli.IntFlag{
|
|
|
|
Name: "thumb-limit, x",
|
2020-01-13 12:25:16 +01:00
|
|
|
Usage: "on-demand size limit in pixels (720-3840)",
|
2020-01-13 11:07:09 +01:00
|
|
|
Value: 3840,
|
|
|
|
EnvVar: "PHOTOPRISM_THUMB_LIMIT",
|
|
|
|
},
|
|
|
|
cli.StringFlag{
|
2020-01-13 13:46:05 +01:00
|
|
|
Name: "thumb-filter, f",
|
|
|
|
Usage: "resample filter (blackman, lanczos, cubic or linear)",
|
2020-01-31 16:28:52 +01:00
|
|
|
Value: "lanczos",
|
2020-01-13 13:46:05 +01:00
|
|
|
EnvVar: "PHOTOPRISM_THUMB_FILTER",
|
2020-01-13 11:07:09 +01:00
|
|
|
},
|
2020-04-12 18:00:31 +02:00
|
|
|
cli.BoolFlag{
|
|
|
|
Name: "disable-tf",
|
|
|
|
Usage: "don't use TensorFlow for image classification",
|
|
|
|
EnvVar: "PHOTOPRISM_DISABLE_TF",
|
|
|
|
},
|
|
|
|
cli.BoolFlag{
|
|
|
|
Name: "disable-settings",
|
|
|
|
Usage: "user can not change settings",
|
|
|
|
EnvVar: "PHOTOPRISM_DISABLE_SETTINGS",
|
|
|
|
},
|
2018-09-24 09:53:16 +02:00
|
|
|
}
|