Пример #1
0
func apiFlagSet() *flag.FlagSet {
	fs := flag.NewFlagSet("api", flag.ExitOnError)

	// Basic options
	//fs.String("config", "", "path to the config file")
	fs.Bool("version", false, "print version of the api")
	fs.String("log_level", "info", "lowest level of log messages to print")

	// App settings
	fs.String("default_domain", "pgp.st", "Default email domain")
	fs.String("http_address", "0.0.0.0:8000", "Address of the HTTP server")

	// RethinkDB connection
	fs.String("rethinkdb_address", "127.0.0.1:28015", "Address to the RethinkDB server")
	fs.String("rethinkdb_database", "prod", "Name of the database to use")

	// NSQ connection
	fs.String("nsqd_address", "127.0.0.1:4150", "Address of the nsqd server to use")
	fs.String("lookupd_address", "127.0.0.1:4160", "Address of the nsqlookupd server to use")

	// Error reporting
	fs.String("raven_dsn", "", "DSN to use by Raven, the client of Sentry")

	// Two-factor authentication options
	fs.String("yubicloud_id", "", "App ID for the YubiCloud API")
	fs.String("yubicloud_key", "", "Key for the YubiCloud API")

	return fs
}
Пример #2
0
func mailerFlagSet() *flag.FlagSet {
	fs := flag.NewFlagSet("mailer", flag.ExitOnError)

	// Basic options
	fs.String("config", "", "path to the config file")
	fs.Bool("version", false, "print version of the api")
	fs.String("log_level", "info", "lowest level of log messages to print")

	// RethinkDB connection
	fs.String("rethinkdb", "rethinkdb://127.0.0.1:28015/prod", "RethinkDB connection string")

	// NSQ connection
	fs.String("nsqd_address", "127.0.0.1:4150", "Address of the nsqd server to use")
	fs.String("lookupd_address", "127.0.0.1:4160", "Address of the lookupd server to use")

	// Error reporting
	fs.String("raven_dsn", "", "SQN to use by Raven, client of Sentry")

	// Server settings
	fs.String("smtp_address", "0.0.0.0:25", "Address of the SMTP server")
	fs.Bool("smtp_force_tls", false, "Force TLS?")
	fs.String("smtp_tls_cert", "", "Path to the TLS cert to use")
	fs.String("smtp_tls_key", "", "Path to the TLS key to use")

	// Connection parameters
	fs.String("hostname", "pgp.st", "Hostname of the mailer")
	fs.String("welcome_message", "Welcome to pgp.st", "Welcome message sent to the clients connecting to the SMTP server")
	fs.Int("read_timeout", 0, "Connection read timeout in seconds")
	fs.Int("write_timeout", 0, "Connection write timeout in seconds")
	fs.Int("data_timeout", 0, "Data read timeout in seconds")
	fs.Int("max_connections", 0, "Max concurrent connections")
	fs.Int("max_message_size", 0, "Max size of a single envelope in bytes")
	fs.Int("max_recipients", 0, "Max recipients per envelope")

	// Spamd address
	fs.String("spamd_address", "127.0.0.1:783", "Address of the spamd server to use")

	// Outbound email settings
	fs.String("smtpd_address", "127.0.0.1:2525", "Address of the SMTP relay to use")
	fs.Int("dkim_lru_size", 128, "Size of the in-memory DKIM key cache")
	fs.Int("sender_concurrency", 10, "Max concurrency of the email sender")

	return fs
}