mirror of
https://codeberg.org/Codeberg/pages-server.git
synced 2025-05-12 08:07:09 +02:00
Drop: pogreb support (#175)
followup of #173 close #95 Reviewed-on: https://codeberg.org/Codeberg/pages-server/pulls/175
This commit is contained in:
parent
272c7ca76f
commit
fd643d15f0
12 changed files with 6 additions and 262 deletions
26
cmd/setup.go
26
cmd/setup.go
|
@ -10,29 +10,9 @@ import (
|
|||
)
|
||||
|
||||
func openCertDB(ctx *cli.Context) (certDB database.CertDB, closeFn func(), err error) {
|
||||
if ctx.String("db-type") != "" {
|
||||
log.Trace().Msg("use xorm mode")
|
||||
certDB, err = database.NewXormDB(ctx.String("db-type"), ctx.String("db-conn"))
|
||||
if err != nil {
|
||||
return nil, nil, fmt.Errorf("could not connect to database: %w", err)
|
||||
}
|
||||
} else {
|
||||
// TODO: remove in next version
|
||||
fmt.Println(`
|
||||
######################
|
||||
## W A R N I N G !!! #
|
||||
######################
|
||||
|
||||
You use "pogreb" witch is deprecated and will be removed in the next version.
|
||||
Please switch to sqlite, mysql or postgres !!!
|
||||
|
||||
The simplest way is, to use './pages certs migrate' and set environment var DB_TYPE to 'sqlite' on next start.`)
|
||||
log.Error().Msg("depricated \"pogreb\" used\n")
|
||||
|
||||
certDB, err = database.NewPogreb(ctx.String("db-pogreb"))
|
||||
if err != nil {
|
||||
return nil, nil, fmt.Errorf("could not create database: %w", err)
|
||||
}
|
||||
certDB, err = database.NewXormDB(ctx.String("db-type"), ctx.String("db-conn"))
|
||||
if err != nil {
|
||||
return nil, nil, fmt.Errorf("could not connect to database: %w", err)
|
||||
}
|
||||
|
||||
closeFn = func() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue