// Pipeviz uses two separate HTTP ports - one for input into the logic // machine, and one for graph data consumption. This is done primarily // because security/firewall concerns are completely different, and having // separate ports makes it much easier to implement separate policies. // Differing semantics are a contributing, but lesser consideration. const ( DefaultIngestionPort int = 2309 // 2309, because Cayte DefaultAppPort = 8008 MaxMessageSize = 5 << 20 // Max input message size is 5MB ) var ( bindAll = pflag.BoolP("bind-all", "b", false, "Listen on all interfaces. Applies both to ingestor and webapp.") dbPath = pflag.StringP("data-dir", "d", ".", "The base directory to use for all persistent storage.") useSyslog = pflag.Bool("syslog", false, "Write log output to syslog.") ingestKey = pflag.String("ingest-key", "", "Path to an x509 key to use for TLS on the ingestion port. If no cert is provided, unsecured HTTP will be used.") ingestCert = pflag.String("ingest-cert", "", "Path to an x509 certificate to use for TLS on the ingestion port. If key is provided, will try to find a certificate of the same name plus .crt extension.") webappKey = pflag.String("webapp-key", "", "Path to an x509 key to use for TLS on the webapp port. If no cert is provided, unsecured HTTP will be used.") webappCert = pflag.String("webapp-cert", "", "Path to an x509 certificate to use for TLS on the webapp port. If key is provided, will try to find a certificate of the same name plus .crt extension.") mlstore = pflag.StringP("mlog-storage", "", "bolt", "Storage backend to use for the message log. Valid options: 'memory' or 'bolt'. Defaults to bolt.") ) func main() { pflag.Parse() setUpLogging() src, err := schema.Master() if err != nil { log.WithFields(log.Fields{ "system": "main",
// Pipeviz uses two separate HTTP ports - one for input into the logic // machine, and one for graph data consumption. This is done primarily // because security/firewall concerns are completely different, and having // separate ports makes it much easier to implement separate policies. // Differing semantics are a contributing, but lesser consideration. const ( DefaultIngestionPort int = 2309 // 2309, because Cayte DefaultAppPort = 8008 MaxMessageSize = 5 << 20 // Max input message size is 5MB ) var ( vflag = pflag.BoolP("version", "v", false, "Print version") bindAll = pflag.BoolP("bind-all", "b", false, "Listen on all interfaces. Applies both to ingestor and webapp.") dbPath = pflag.StringP("data-dir", "d", ".", "The base directory to use for all persistent storage.") useSyslog = pflag.Bool("syslog", false, "Write log output to syslog.") ingestKey = pflag.String("ingest-key", "", "Path to an x509 key to use for TLS on the ingestion port. If no cert is provided, unsecured HTTP will be used.") ingestCert = pflag.String("ingest-cert", "", "Path to an x509 certificate to use for TLS on the ingestion port. If key is provided, will try to find a certificate of the same name plus .crt extension.") webappKey = pflag.String("webapp-key", "", "Path to an x509 key to use for TLS on the webapp port. If no cert is provided, unsecured HTTP will be used.") webappCert = pflag.String("webapp-cert", "", "Path to an x509 certificate to use for TLS on the webapp port. If key is provided, will try to find a certificate of the same name plus .crt extension.") mlstore = pflag.String("mlog-storage", "bolt", "Storage backend to use for the message log. Valid options: 'memory' or 'bolt'. Defaults to bolt.") publicDir = pflag.String("webapp-dir", "webapp/public", "Path to the 'public' directory containing javascript application files.") showVersion = pflag.Bool("webapp-version", false, "Report the version of the pipeviz server via response headers") ) func main() { pflag.Parse() if *vflag { fmt.Println("pipeviz version", version.Version()) return }