set file permissions to 0600 for the sqlite database (#579)
Some checks failed
Docker / Build and Push (push) Has been cancelled
github-pages / deploy (push) Has been cancelled
Docker / release (push) Has been cancelled

This commit is contained in:
Christoph
2025-11-23 20:33:04 +01:00
parent 364f7b3a5b
commit a1fcce6fde

View File

@@ -166,6 +166,9 @@ func NewDatabase(cfg config.DatabaseConfig) (*gorm.DB, error) {
if err != nil {
return nil, fmt.Errorf("failed to open sqlite database: %w", err)
}
if err := os.Chmod(cfg.DSN, 0600); err != nil {
return nil, fmt.Errorf("failed to set permissions on sqlite database: %w", err)
}
sqlDB, _ := gormDb.DB()
sqlDB.SetMaxOpenConns(1)
}