2018-09-24 09:53:16 +02:00
|
|
|
package commands
|
|
|
|
|
|
|
|
import (
|
|
|
|
"fmt"
|
2018-10-31 07:14:33 +01:00
|
|
|
|
2019-05-06 23:18:10 +02:00
|
|
|
"github.com/photoprism/photoprism/internal/config"
|
2018-09-24 09:53:16 +02:00
|
|
|
"github.com/urfave/cli"
|
|
|
|
)
|
|
|
|
|
2020-02-18 23:42:51 +01:00
|
|
|
// ConfigCommand is used to register the display config cli command
|
2018-09-24 09:53:16 +02:00
|
|
|
var ConfigCommand = cli.Command{
|
|
|
|
Name: "config",
|
|
|
|
Usage: "Displays global configuration values",
|
|
|
|
Action: configAction,
|
|
|
|
}
|
|
|
|
|
2020-02-18 23:42:51 +01:00
|
|
|
// configAction prints current configuration
|
2018-11-17 06:21:39 +01:00
|
|
|
func configAction(ctx *cli.Context) error {
|
2019-05-06 23:18:10 +02:00
|
|
|
conf := config.NewConfig(ctx)
|
2018-09-24 09:53:16 +02:00
|
|
|
|
|
|
|
fmt.Printf("NAME VALUE\n")
|
2019-05-06 23:18:10 +02:00
|
|
|
fmt.Printf("name %s\n", conf.Name())
|
2019-12-11 14:10:20 +01:00
|
|
|
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())
|
2019-05-06 23:18:10 +02:00
|
|
|
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())
|
2019-11-11 21:10:41 +01:00
|
|
|
fmt.Printf("public %t\n", conf.Public())
|
2019-12-30 12:38:11 +01:00
|
|
|
fmt.Printf("experimental %t\n", conf.Experimental())
|
2020-01-06 23:43:19 +01:00
|
|
|
fmt.Printf("workers %d\n", conf.Workers())
|
2019-11-08 06:53:40 +01:00
|
|
|
fmt.Printf("admin-password %s\n", conf.AdminPassword())
|
2020-02-21 04:23:16 +01:00
|
|
|
fmt.Printf("webdav-password %s\n", conf.WebDAVPassword())
|
2019-05-06 23:18:10 +02:00
|
|
|
fmt.Printf("log-level %s\n", conf.LogLevel())
|
2019-06-30 05:38:39 +02:00
|
|
|
fmt.Printf("log-filename %s\n", conf.LogFilename())
|
|
|
|
fmt.Printf("pid-filename %s\n", conf.PIDFilename())
|
2019-05-06 23:18:10 +02:00
|
|
|
fmt.Printf("config-file %s\n", conf.ConfigFile())
|
2019-06-05 18:25:20 +02:00
|
|
|
fmt.Printf("config-path %s\n", conf.ConfigPath())
|
2019-05-06 23:18:10 +02:00
|
|
|
|
|
|
|
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("export-path %s\n", conf.ExportPath())
|
|
|
|
fmt.Printf("cache-path %s\n", conf.CachePath())
|
|
|
|
fmt.Printf("thumbnails-path %s\n", conf.ThumbnailsPath())
|
2019-06-05 18:25:20 +02:00
|
|
|
fmt.Printf("resources-path %s\n", conf.ResourcesPath())
|
2019-06-30 05:38:39 +02:00
|
|
|
fmt.Printf("tf-version %s\n", conf.TensorFlowVersion())
|
2019-05-06 23:18:10 +02:00
|
|
|
fmt.Printf("tf-model-path %s\n", conf.TensorFlowModelPath())
|
2020-01-06 06:59:35 +01:00
|
|
|
fmt.Printf("tf-disabled %t\n", conf.TensorFlowDisabled())
|
2019-05-06 23:18:10 +02:00
|
|
|
fmt.Printf("templates-path %s\n", conf.HttpTemplatesPath())
|
|
|
|
fmt.Printf("favicons-path %s\n", conf.HttpFaviconsPath())
|
2019-05-22 13:55:11 +02:00
|
|
|
fmt.Printf("static-path %s\n", conf.HttpStaticPath())
|
|
|
|
fmt.Printf("static-build-path %s\n", conf.HttpStaticBuildPath())
|
2019-05-06 23:18:10 +02:00
|
|
|
|
2020-03-23 20:29:31 +01:00
|
|
|
fmt.Printf("database-path %s\n", conf.DatabasePath())
|
|
|
|
fmt.Printf("database-driver %s\n", conf.DatabaseDriver())
|
|
|
|
fmt.Printf("database-dsn %s\n", conf.DatabaseDsn())
|
|
|
|
|
|
|
|
fmt.Printf("sql-host %s\n", conf.SqlServerHost())
|
|
|
|
fmt.Printf("sql-port %d\n", conf.SqlServerPort())
|
|
|
|
fmt.Printf("sql-password %s\n", conf.SqlServerPassword())
|
|
|
|
|
|
|
|
fmt.Printf("http-host %s\n", conf.HttpServerHost())
|
|
|
|
fmt.Printf("http-port %d\n", conf.HttpServerPort())
|
|
|
|
fmt.Printf("http-mode %s\n", conf.HttpServerMode())
|
|
|
|
|
2019-06-06 14:44:29 +02:00
|
|
|
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())
|
2018-09-24 09:53:16 +02:00
|
|
|
|
2020-01-13 16:48:32 +01:00
|
|
|
fmt.Printf("detect-nsfw %t\n", conf.DetectNSFW())
|
2019-12-15 17:19:16 +01:00
|
|
|
fmt.Printf("upload-nsfw %t\n", conf.UploadNSFW())
|
2020-01-06 06:59:35 +01:00
|
|
|
fmt.Printf("geocoding-api %s\n", conf.GeoCodingApi())
|
|
|
|
fmt.Printf("thumb-quality %d\n", conf.ThumbQuality())
|
|
|
|
fmt.Printf("thumb-size %d\n", conf.ThumbSize())
|
2020-01-13 11:07:09 +01:00
|
|
|
fmt.Printf("thumb-limit %d\n", conf.ThumbLimit())
|
2020-01-13 13:46:05 +01:00
|
|
|
fmt.Printf("thumb-filter %s\n", conf.ThumbFilter())
|
2019-12-15 17:19:16 +01:00
|
|
|
|
2018-09-24 09:53:16 +02:00
|
|
|
return nil
|
|
|
|
}
|