allow email recipient to be configurable

This commit is contained in:
Max Erenberg 2022-06-21 08:47:56 -04:00
parent 347ea07be5
commit 46a2a9ff49
2 changed files with 9 additions and 3 deletions

View File

@ -36,6 +36,7 @@ func New() *Config {
DistrosToCheck: strings.Split(os.Getenv("DISTROS_TO_CHECK"), ","),
UploadDirectory: os.Getenv("UPLOAD_DIRECTORY"),
UploadBaseUrl: os.Getenv("UPLOAD_BASE_URL"),
EmailRecipient: os.Getenv("EMAIL_RECIPIENT"),
}
if cfg.CloudstackApiKey == "" {
panic("CLOUDSTACK_API_KEY is empty or not set")
@ -52,6 +53,9 @@ func New() *Config {
if cfg.UploadBaseUrl == "" {
panic("UPLOAD_BASE_URL is empty or not set")
}
if cfg.EmailRecipient == "" {
panic("EMAIL_RECIPIENT is empty or not set")
}
// These should never change
cfg.CloudstackApiBaseUrl = "https://cloud.csclub.uwaterloo.ca/client/api"
@ -62,8 +66,6 @@ func New() *Config {
cfg.EmailServer = "mail.csclub.uwaterloo.ca:25"
cfg.EmailSender = "cloudbuild@csclub.uwaterloo.ca"
cfg.EmailSenderName = "cloudbuild"
// TODO: change recipient to syscom
cfg.EmailRecipient = "merenber@csclub.uwaterloo.ca"
cfg.EmailReplyTo = "no-reply@csclub.uwaterloo.ca"
return cfg
}

View File

@ -48,7 +48,8 @@ is_installed() {
[ $? -eq 0 ] && [ "$status" = installed ]
}
mkdir -p guestfs/deps
DEPS_DIR=guestfs/deps
mkdir -p $DEPS_DIR
cd guestfs
for dep in "${dependencies[@]}"; do
@ -57,6 +58,9 @@ for dep in "${dependencies[@]}"; do
dpkg -x ${dep}_*.deb deps
set +x
done
set -x
rm *.deb
cp $DEPS_DIR/usr/share/gocode/src/libguestfs.org/guestfs/guestfs.go .
cp $DEPS_DIR/usr/include/guestfs.h .
go mod init guestfs