mirror of
https://github.com/photoprism/photoprism.git
synced 2025-12-12 00:34:13 +01:00
UX: Refactor config options to be more intuitive
Make sure to update your local config files when upgrading as the name of some config values has changed. The default config path has changed from "settings" to "config".
This commit is contained in:
@@ -2,7 +2,9 @@ package commands
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"strings"
|
||||
"time"
|
||||
"unicode/utf8"
|
||||
|
||||
"github.com/photoprism/photoprism/internal/config"
|
||||
"github.com/urfave/cli"
|
||||
@@ -35,8 +37,40 @@ func configAction(ctx *cli.Context) error {
|
||||
fmt.Printf("%-25s %s\n", "config-file", conf.ConfigFile())
|
||||
fmt.Printf("%-25s %s\n", "settings-file", conf.SettingsFile())
|
||||
|
||||
// Passwords.
|
||||
fmt.Printf("%-25s %s\n", "admin-password", conf.AdminPassword())
|
||||
// Main directories.
|
||||
fmt.Printf("%-25s %s\n", "originals-path", conf.OriginalsPath())
|
||||
fmt.Printf("%-25s %d\n", "originals-limit", conf.OriginalsLimit())
|
||||
fmt.Printf("%-25s %s\n", "import-path", conf.ImportPath())
|
||||
fmt.Printf("%-25s %s\n", "storage-path", conf.StoragePath())
|
||||
fmt.Printf("%-25s %s\n", "sidecar-path", conf.SidecarPath())
|
||||
fmt.Printf("%-25s %s\n", "albums-path", conf.AlbumsPath())
|
||||
fmt.Printf("%-25s %s\n", "cache-path", conf.CachePath())
|
||||
fmt.Printf("%-25s %s\n", "temp-path", conf.TempPath())
|
||||
fmt.Printf("%-25s %s\n", "backup-path", conf.BackupPath())
|
||||
fmt.Printf("%-25s %s\n", "assets-path", conf.AssetsPath())
|
||||
|
||||
// Asset path and file names.
|
||||
fmt.Printf("%-25s %s\n", "static-path", conf.StaticPath())
|
||||
fmt.Printf("%-25s %s\n", "build-path", conf.BuildPath())
|
||||
fmt.Printf("%-25s %s\n", "img-path", conf.ImgPath())
|
||||
fmt.Printf("%-25s %s\n", "templates-path", conf.TemplatesPath())
|
||||
|
||||
// Workers.
|
||||
fmt.Printf("%-25s %d\n", "workers", conf.Workers())
|
||||
fmt.Printf("%-25s %d\n", "wakeup-interval", conf.WakeupInterval()/time.Second)
|
||||
|
||||
// Disable features.
|
||||
fmt.Printf("%-25s %t\n", "disable-backups", conf.DisableBackups())
|
||||
fmt.Printf("%-25s %t\n", "disable-settings", conf.DisableSettings())
|
||||
fmt.Printf("%-25s %t\n", "disable-places", conf.DisablePlaces())
|
||||
fmt.Printf("%-25s %t\n", "disable-exiftool", conf.DisableExifTool())
|
||||
|
||||
// Everything related to TensorFlow.
|
||||
fmt.Printf("%-25s %t\n", "disable-tensorflow", conf.DisableTensorFlow())
|
||||
fmt.Printf("%-25s %s\n", "tensorflow-version", conf.TensorFlowVersion())
|
||||
fmt.Printf("%-25s %s\n", "tensorflow-model-path", conf.TensorFlowModelPath())
|
||||
fmt.Printf("%-25s %t\n", "detect-nsfw", conf.DetectNSFW())
|
||||
fmt.Printf("%-25s %t\n", "upload-nsfw", conf.UploadNSFW())
|
||||
|
||||
// Site information.
|
||||
fmt.Printf("%-25s %s\n", "site-url", conf.SiteUrl())
|
||||
@@ -46,24 +80,18 @@ func configAction(ctx *cli.Context) error {
|
||||
fmt.Printf("%-25s %s\n", "site-description", conf.SiteDescription())
|
||||
fmt.Printf("%-25s %s\n", "site-author", conf.SiteAuthor())
|
||||
|
||||
// Everything related to TensorFlow.
|
||||
fmt.Printf("%-25s %t\n", "tensorflow-off", conf.TensorFlowOff())
|
||||
fmt.Printf("%-25s %s\n", "tensorflow-version", conf.TensorFlowVersion())
|
||||
fmt.Printf("%-25s %s\n", "tensorflow-model-path", conf.TensorFlowModelPath())
|
||||
fmt.Printf("%-25s %t\n", "detect-nsfw", conf.DetectNSFW())
|
||||
fmt.Printf("%-25s %t\n", "upload-nsfw", conf.UploadNSFW())
|
||||
|
||||
// Background workers and logging.
|
||||
fmt.Printf("%-25s %d\n", "workers", conf.Workers())
|
||||
fmt.Printf("%-25s %d\n", "wakeup-interval", conf.WakeupInterval()/time.Second)
|
||||
// Logging.
|
||||
fmt.Printf("%-25s %s\n", "log-level", conf.LogLevel())
|
||||
fmt.Printf("%-25s %s\n", "log-filename", conf.LogFilename())
|
||||
fmt.Printf("%-25s %s\n", "pid-filename", conf.PIDFilename())
|
||||
|
||||
// HTTP server configuration.
|
||||
fmt.Printf("%-25s %s\n", "http-host", conf.HttpServerHost())
|
||||
fmt.Printf("%-25s %d\n", "http-port", conf.HttpServerPort())
|
||||
fmt.Printf("%-25s %s\n", "http-mode", conf.HttpServerMode())
|
||||
fmt.Printf("%-25s %s\n", "http-host", conf.HttpHost())
|
||||
fmt.Printf("%-25s %d\n", "http-port", conf.HttpPort())
|
||||
fmt.Printf("%-25s %s\n", "http-mode", conf.HttpMode())
|
||||
|
||||
// Passwords.
|
||||
fmt.Printf("%-25s %s\n", "admin-password", strings.Repeat("*", utf8.RuneCountInString(conf.AdminPassword())))
|
||||
|
||||
// Database configuration.
|
||||
fmt.Printf("%-25s %s\n", "database-driver", dbDriver)
|
||||
@@ -73,28 +101,10 @@ func configAction(ctx *cli.Context) error {
|
||||
fmt.Printf("%-25s %s\n", "database-port", conf.DatabasePortString())
|
||||
fmt.Printf("%-25s %s\n", "database-name", conf.DatabaseName())
|
||||
fmt.Printf("%-25s %s\n", "database-user", conf.DatabaseUser())
|
||||
fmt.Printf("%-25s %s\n", "database-password", conf.DatabasePassword())
|
||||
fmt.Printf("%-25s %s\n", "database-password", strings.Repeat("*", utf8.RuneCountInString(conf.DatabasePassword())))
|
||||
fmt.Printf("%-25s %d\n", "database-conns", conf.DatabaseConns())
|
||||
fmt.Printf("%-25s %d\n", "database-conns-idle", conf.DatabaseConnsIdle())
|
||||
|
||||
// Main directories.
|
||||
fmt.Printf("%-25s %s\n", "assets-path", conf.AssetsPath())
|
||||
fmt.Printf("%-25s %s\n", "storage-path", conf.StoragePath())
|
||||
fmt.Printf("%-25s %s\n", "backup-path", conf.BackupPath())
|
||||
fmt.Printf("%-25s %s\n", "albums-path", conf.AlbumsPath())
|
||||
fmt.Printf("%-25s %s\n", "import-path", conf.ImportPath())
|
||||
fmt.Printf("%-25s %s\n", "originals-path", conf.OriginalsPath())
|
||||
fmt.Printf("%-25s %d\n", "originals-limit", conf.OriginalsLimit())
|
||||
|
||||
// Additional path and file names.
|
||||
fmt.Printf("%-25s %s\n", "static-path", conf.StaticPath())
|
||||
fmt.Printf("%-25s %s\n", "build-path", conf.BuildPath())
|
||||
fmt.Printf("%-25s %s\n", "img-path", conf.ImgPath())
|
||||
fmt.Printf("%-25s %s\n", "templates-path", conf.TemplatesPath())
|
||||
fmt.Printf("%-25s %s\n", "cache-path", conf.CachePath())
|
||||
fmt.Printf("%-25s %s\n", "temp-path", conf.TempPath())
|
||||
fmt.Printf("%-25s %t\n", "settings-hidden", conf.SettingsHidden())
|
||||
|
||||
// External binaries and sidecar configuration.
|
||||
fmt.Printf("%-25s %s\n", "rawtherapee-bin", conf.RawtherapeeBin())
|
||||
fmt.Printf("%-25s %s\n", "darktable-bin", conf.DarktableBin())
|
||||
@@ -103,12 +113,6 @@ func configAction(ctx *cli.Context) error {
|
||||
fmt.Printf("%-25s %s\n", "heifconvert-bin", conf.HeifConvertBin())
|
||||
fmt.Printf("%-25s %s\n", "ffmpeg-bin", conf.FFmpegBin())
|
||||
fmt.Printf("%-25s %s\n", "exiftool-bin", conf.ExifToolBin())
|
||||
fmt.Printf("%-25s %t\n", "sidecar-json", conf.SidecarJson())
|
||||
fmt.Printf("%-25s %t\n", "sidecar-yaml", conf.SidecarYaml())
|
||||
fmt.Printf("%-25s %s\n", "sidecar-path", conf.SidecarPath())
|
||||
|
||||
// Geo data API.
|
||||
fmt.Printf("%-25s %s\n", "geo-api", conf.GeoApi())
|
||||
|
||||
// Thumbs, resampling and download security token.
|
||||
fmt.Printf("%-25s %s\n", "download-token", conf.DownloadToken())
|
||||
|
||||
Reference in New Issue
Block a user