Minor improvements
This commit is contained in:
@@ -38,7 +38,7 @@ func Load() *config {
|
||||
// Get admin password (Its a single user/admin app so its just fine)
|
||||
adminPassword := os.Getenv("CAOM_ADMIN_PASSWORD")
|
||||
if adminPassword == "" {
|
||||
slog.Error("No admin password provided, using default password 'catsaregood'")
|
||||
slog.Warn("No admin password provided, using default password 'catsaregood'")
|
||||
adminPassword = "catsaregood"
|
||||
}
|
||||
|
||||
|
@@ -5,7 +5,7 @@ type Post struct {
|
||||
Url string `json:"url"`
|
||||
AccountID string // Foreign key field (must match Account.AccId)
|
||||
Account Account `json:"account" gorm:"foreignKey:AccountID;references:AccId"`
|
||||
Attachments []MediaAttachment `json:"media_attachments" gorm:"foreignKey:PostID;references:ID;index:idx_post_attachments"`
|
||||
Attachments []MediaAttachment `json:"media_attachments" gorm:"foreignKey:PostID;references:ID"`
|
||||
}
|
||||
|
||||
type Account struct {
|
||||
|
@@ -14,7 +14,7 @@ func SetupRouter() *gin.Engine {
|
||||
r := gin.Default()
|
||||
|
||||
r.Use(cors.New(cors.Config{
|
||||
AllowOrigins: []string{"https://extra-mama-chiz.surge.sh"}, // Just for test
|
||||
AllowAllOrigins: true,
|
||||
AllowMethods: []string{"POST", "GET", "OPTIONS"},
|
||||
AllowHeaders: []string{"Origin", "Content-Type", "Authorization"},
|
||||
AllowCredentials: true,
|
||||
|
Reference in New Issue
Block a user