mirror of https://github.com/agola-io/agola
Merge pull request #533 from sgotti/services_config_check_valid_sqlite3_db_connstring
services/config: check valid sqlite3 db connstring
This commit is contained in:
commit
babcd6a6fa
|
@ -16,6 +16,7 @@ package config
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"os"
|
"os"
|
||||||
|
"path/filepath"
|
||||||
"slices"
|
"slices"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
|
@ -514,6 +515,12 @@ func validateDB(db *DB) error {
|
||||||
return errors.Errorf("db connection string undefined")
|
return errors.Errorf("db connection string undefined")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if db.Type == sql.Sqlite3 {
|
||||||
|
if !filepath.IsAbs(db.ConnString) {
|
||||||
|
return errors.Errorf("sqlite3 db connection string must be an absolute path")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue