Exemplo n.º 1
0
	"fmt"
	"log"
	"os"

	"github.com/getsentry/raven-go"
	"github.com/lavab/flag"
	"github.com/lavab/smtpd"

	"github.com/lavab/mailer/handler"
	"github.com/lavab/mailer/outbound"
	"github.com/lavab/mailer/shared"
)

var (
	// Flags used to enable functionality in the flag package
	configFlag   = flag.String("config", "", "Config file to load")
	etcdAddress  = flag.String("etcd_address", "", "etcd peer addresses split by commas")
	etcdCAFile   = flag.String("etcd_ca_file", "", "etcd path to server cert's ca")
	etcdCertFile = flag.String("etcd_cert_file", "", "etcd path to client cert file")
	etcdKeyFile  = flag.String("etcd_key_file", "", "etcd path to client key file")
	etcdPath     = flag.String("etcd_path", "mailer/", "Path of the keys")

	// General settings
	bindAddress      = flag.String("bind", ":25", "Address used to bind")
	welcomeMessage   = flag.String("welcome", "Lavaboom Mailer ready.", "Welcome message displayed upon connecting to the server")
	hostname         = flag.String("hostname", "localhost", "Server hostname")
	logFormatterType = flag.String("log", "text", "Log formatter type. Either \"json\" or \"text\"")
	forceColors      = flag.Bool("force_colors", false, "Force colored prompt?")

	// RethinkDB connection settings
	rethinkdbAddress = flag.String("rethinkdb_address", func() string {
Exemplo n.º 2
0
	"github.com/Sirupsen/logrus"

	"github.com/lavab/flag"
	"github.com/zenazn/goji/graceful"

	"github.com/lavab/api/env"
	"github.com/lavab/api/setup"
)

// TODO: "Middleware that implements a few quick security wins"
// 		 https://github.com/unrolled/secure

var (
	// Enable namsral/flag functionality
	configFlag = flag.String("config", "", "config file to load")
	// General flags
	bindAddress      = flag.String("bind", ":5000", "Network address used to bind")
	apiVersion       = flag.String("api_version", "v0", "Shown API version")
	logFormatterType = flag.String("log", "text", "Log formatter type. Either \"json\" or \"text\"")
	forceColors      = flag.Bool("force_colors", false, "Force colored prompt?")
	emailDomain      = flag.String("email_domain", "lavaboom.io", "Domain of the default email service")
	// Registration settings
	sessionDuration = flag.Int("session_duration", 72, "Session duration expressed in hours")
	// Cache-related flags
	redisAddress = flag.String("redis_address", func() string {
		address := os.Getenv("REDIS_PORT_6379_TCP_ADDR")
		if address == "" {
			address = "127.0.0.1"
		}
		return address + ":6379"