8318ab8983
Signed-off-by: Michael Mayer <michael@liquidbytes.net>
89 lines
4 KiB
Go
89 lines
4 KiB
Go
package commands
|
|
|
|
import (
|
|
"fmt"
|
|
"time"
|
|
|
|
"github.com/photoprism/photoprism/internal/config"
|
|
"github.com/urfave/cli"
|
|
)
|
|
|
|
// ConfigCommand is used to register the display config cli command
|
|
var ConfigCommand = cli.Command{
|
|
Name: "config",
|
|
Usage: "Displays global configuration values",
|
|
Action: configAction,
|
|
}
|
|
|
|
// configAction prints current configuration
|
|
func configAction(ctx *cli.Context) error {
|
|
conf := config.NewConfig(ctx)
|
|
|
|
fmt.Printf("NAME VALUE\n")
|
|
fmt.Printf("admin-password %s\n", conf.AdminPassword())
|
|
fmt.Printf("webdav-password %s\n", conf.WebDAVPassword())
|
|
fmt.Printf("name %s\n", conf.Name())
|
|
fmt.Printf("url %s\n", conf.Url())
|
|
fmt.Printf("title %s\n", conf.Title())
|
|
fmt.Printf("subtitle %s\n", conf.Subtitle())
|
|
fmt.Printf("description %s\n", conf.Description())
|
|
fmt.Printf("author %s\n", conf.Author())
|
|
fmt.Printf("twitter %s\n", conf.Twitter())
|
|
fmt.Printf("version %s\n", conf.Version())
|
|
fmt.Printf("copyright %s\n", conf.Copyright())
|
|
fmt.Printf("debug %t\n", conf.Debug())
|
|
fmt.Printf("read-only %t\n", conf.ReadOnly())
|
|
fmt.Printf("public %t\n", conf.Public())
|
|
fmt.Printf("experimental %t\n", conf.Experimental())
|
|
fmt.Printf("workers %d\n", conf.Workers())
|
|
fmt.Printf("wakeup-interval %d\n", conf.WakeupInterval()/time.Second)
|
|
fmt.Printf("log-level %s\n", conf.LogLevel())
|
|
fmt.Printf("log-filename %s\n", conf.LogFilename())
|
|
fmt.Printf("pid-filename %s\n", conf.PIDFilename())
|
|
fmt.Printf("config-file %s\n", conf.ConfigFile())
|
|
fmt.Printf("config-path %s\n", conf.ConfigPath())
|
|
|
|
fmt.Printf("assets-path %s\n", conf.AssetsPath())
|
|
fmt.Printf("originals-path %s\n", conf.OriginalsPath())
|
|
fmt.Printf("import-path %s\n", conf.ImportPath())
|
|
fmt.Printf("temp-path %s\n", conf.TempPath())
|
|
fmt.Printf("cache-path %s\n", conf.CachePath())
|
|
fmt.Printf("thumbnails-path %s\n", conf.ThumbnailsPath())
|
|
fmt.Printf("resources-path %s\n", conf.ResourcesPath())
|
|
fmt.Printf("tf-version %s\n", conf.TensorFlowVersion())
|
|
fmt.Printf("tf-model-path %s\n", conf.TensorFlowModelPath())
|
|
fmt.Printf("templates-path %s\n", conf.HttpTemplatesPath())
|
|
fmt.Printf("favicons-path %s\n", conf.HttpFaviconsPath())
|
|
fmt.Printf("static-path %s\n", conf.HttpStaticPath())
|
|
fmt.Printf("static-build-path %s\n", conf.HttpStaticBuildPath())
|
|
|
|
fmt.Printf("http-host %s\n", conf.HttpServerHost())
|
|
fmt.Printf("http-port %d\n", conf.HttpServerPort())
|
|
fmt.Printf("http-mode %s\n", conf.HttpServerMode())
|
|
|
|
fmt.Printf("tidb-host %s\n", conf.TidbServerHost())
|
|
fmt.Printf("tidb-port %d\n", conf.TidbServerPort())
|
|
fmt.Printf("tidb-password %s\n", conf.TidbServerPassword())
|
|
fmt.Printf("tidb-path %s\n", conf.TidbServerPath())
|
|
|
|
fmt.Printf("database-driver %s\n", conf.DatabaseDriver())
|
|
fmt.Printf("database-dsn %s\n", conf.DatabaseDsn())
|
|
|
|
fmt.Printf("sips-bin %s\n", conf.SipsBin())
|
|
fmt.Printf("darktable-bin %s\n", conf.DarktableBin())
|
|
fmt.Printf("exiftool-bin %s\n", conf.ExifToolBin())
|
|
fmt.Printf("heifconvert-bin %s\n", conf.HeifConvertBin())
|
|
|
|
fmt.Printf("detect-nsfw %t\n", conf.DetectNSFW())
|
|
fmt.Printf("upload-nsfw %t\n", conf.UploadNSFW())
|
|
fmt.Printf("geocoding-api %s\n", conf.GeoCodingApi())
|
|
fmt.Printf("thumb-quality %d\n", conf.ThumbQuality())
|
|
fmt.Printf("thumb-size %d\n", conf.ThumbSize())
|
|
fmt.Printf("thumb-limit %d\n", conf.ThumbLimit())
|
|
fmt.Printf("thumb-filter %s\n", conf.ThumbFilter())
|
|
|
|
fmt.Printf("disable-tf %t\n", conf.DisableTensorFlow())
|
|
fmt.Printf("disable-settings %t\n", conf.DisableSettings())
|
|
|
|
return nil
|
|
}
|