Added imagekit optimization support
This commit is contained in:
@@ -22,6 +22,8 @@ type config struct {
|
||||
DBUser string
|
||||
DBPassword string
|
||||
DBName string
|
||||
|
||||
ImageKitId string
|
||||
}
|
||||
|
||||
var Config *config
|
||||
@@ -65,7 +67,6 @@ func Load() *config {
|
||||
audience = "CatsOfMastodonBotGo"
|
||||
}
|
||||
|
||||
|
||||
dbEngine := os.Getenv("CAOM_DB_ENGINE")
|
||||
dbHost := os.Getenv("CAOM_DB_HOST")
|
||||
dbPort := os.Getenv("CAOM_DB_PORT")
|
||||
@@ -82,6 +83,11 @@ func Load() *config {
|
||||
dbPassword = ""
|
||||
dbName = "caom.db"
|
||||
}
|
||||
|
||||
imageKitId := os.Getenv("CAOM_IMAGEKIT_ID")
|
||||
if imageKitId == "" {
|
||||
slog.Info("No imagekit id provided, not using imagekit")
|
||||
}
|
||||
// Inititlize AppContext
|
||||
var appContext = &config{
|
||||
AdminPassword: adminPassword,
|
||||
@@ -98,6 +104,8 @@ func Load() *config {
|
||||
DBUser: dbUser,
|
||||
DBPassword: dbPassword,
|
||||
DBName: dbName,
|
||||
|
||||
ImageKitId: imageKitId,
|
||||
}
|
||||
return appContext
|
||||
|
||||
|
Reference in New Issue
Block a user