package requests import ( "errors" "github.com/status-im/status-go/internal/logutils" ) var ( ErrInitializeApplicationInvalidDataDir = errors.New("initialize-centralized-metric: no dataDir") ) type InitializeApplication struct { DataDir string `json:"dataDir"` // MediaServerAddress specifies the URL of the media server used for file storage and retrieval. // The address should be in the format "hostname:port" or a complete URL. If not provided, defaults to "localhost:0". MediaServerAddress *string `json:"mediaServerAddress"` // MediaServerAdvertizeHost sets a different host/port to be advertized in media URLs than the one media server listen on. MediaServerAdvertizeHost string `json:"mediaServerAdvertizeHost"` // MediaServerAdvertizePort sets a different port to be advertized in media URLs than the one media server listen on. MediaServerAdvertizePort int `json:"mediaServerAdvertizePort"` // MediaServerEnableTLS is optional, if not provided, media server will use TLS by default MediaServerEnableTLS *bool `json:"mediaServerEnableTLS"` SentryDSN string `json:"sentryDSN"` // LogDir specifies the directory where logs are stored. // If empty, logs are stored in the `DataDir`. LogDir string `json:"logDir"` // Specify if enable Pre-Login Log LogEnabled bool `json:"logEnabled"` // Specify the Pre-Login log level LogLevel string `json:"logLevel"` APILoggingEnabled bool `json:"apiLoggingEnabled"` MetricsEnabled bool `json:"metricsEnabled"` MetricsAddress string `json:"metricsAddress"` // WakuFleetsConfigFilePath specifies the file path for configuring fleets supported by the app. // File structure must be as params.FleetsMap. // When successfully loaded, overrides all hard-coded fleets with file contents. WakuFleetsConfigFilePath string `json:"wakuFleetsConfigFilePath"` // PushNotificationsConfigFilePath specifies the file path for configuring push notifications servers. // File structure must be as params.PushNotificationsFleet. PushFleetsConfigFilePath string `json:"pushFleetsConfigFilePath"` } func (i *InitializeApplication) Validate() error { if len(i.DataDir) == 0 { return ErrInitializeApplicationInvalidDataDir } if i.LogLevel != "" { if _, err := logutils.LvlFromString(i.LogLevel); err != nil { return err } } return nil }