package config

import "os"

type (
	Config struct {
		DatabaseURL        string
		VpubDatabaseURL    string
		VpubAESKey         string
		SessionKey         string
		Env                string
		CertFile           string
		KeyFile            string
		AssetsDir          string
		EmailUsername      string
		EmailPassword      string
		EmailHost          string
		EmailHostAddr      string
		ManualRegistration bool
		EmojiFolder        string
	}
)

func New() *Config {
	return &Config{
		DatabaseURL:        os.Getenv("DATABASE_URL"),
		VpubDatabaseURL:    os.Getenv("VPUB_DATABASE_URL"),
		VpubAESKey:         os.Getenv("VPUB_AES_KEY"),
		SessionKey:         os.Getenv("SESSION_KEY"),
		Env:                os.Getenv("ENV"),
		CertFile:           os.Getenv("CERT_FILE"),
		KeyFile:            os.Getenv("CERT_KEY_FILE"),
		AssetsDir:          os.Getenv("ASSETS_DIR"),
		ManualRegistration: len(os.Getenv("MANUAL_REGISTRATION")) > 0,
		EmojiFolder:        os.Getenv("EMOJI_FOLDER"),
	}
}
