Add settings for SMTP

This commit is contained in:
paul 2019-12-14 07:32:33 +01:00
parent 007b2a375f
commit cde37d1679
2 changed files with 20 additions and 8 deletions

View file

@ -1 +1,10 @@
DATABASE_DSN="postgres://user:password@127.0.0.1:5432/database?sslmode=disable" DATABASE_DSN="postgres://user:password@127.0.0.1:5432/database?sslmode=disable"
S3_ENDPOINT="https://sfo2.spaces.digitalocean.com"
S3_KEY="URVEXAMPLETOKENN/IAWG3"
S3_SECRET="9examplewbvxsvobzunvqwdenvhws"
S3_LOCATION="sfo2"
S3_SSL=true
S3_BUCKET="bucket"
SMTP_SERVER="smtp.example.com"
SMTP_USER="user@example.com"
SMTP_PASS="password"

View file

@ -4,12 +4,12 @@ import (
"net/http" "net/http"
"sync" "sync"
"github.com/caarlos0/env"
"github.com/jmoiron/sqlx"
"bitmask.me/skeleton/assets" "bitmask.me/skeleton/assets"
"bitmask.me/skeleton/internal/database" "bitmask.me/skeleton/internal/database"
"bitmask.me/skeleton/internal/storage" "bitmask.me/skeleton/internal/storage"
"bitmask.me/skeleton/internal/templates" "bitmask.me/skeleton/internal/templates"
"github.com/caarlos0/env"
"github.com/jmoiron/sqlx"
) )
// Config contains all neccessary configuration for the App // Config contains all neccessary configuration for the App
@ -22,6 +22,9 @@ type Config struct {
S3Endpoint string `env:"S3_ENDPOINT"` S3Endpoint string `env:"S3_ENDPOINT"`
S3SSL bool `env:"S3_SSL"` S3SSL bool `env:"S3_SSL"`
S3Bucket string `env:"S3_BUCKET"` S3Bucket string `env:"S3_BUCKET"`
SMTPServer string `env:"SMTP_SERVER"`
SMTPUser string `env:"SMTP_USER"`
SMTPPassword string `env:"SMTP_PASS"`
} }
// ConfigFromEnv loads the configuration from environment variables // ConfigFromEnv loads the configuration from environment variables