added support for config files, openbsd, pledge and unveil
This commit is contained in:
parent
62543e44da
commit
375933c7bc
14 changed files with 138 additions and 49 deletions
|
|
@ -4,6 +4,7 @@ package index
|
|||
|
||||
import (
|
||||
"errors"
|
||||
"git.giftfish.de/ston1th/godrop/v2"
|
||||
"git.giftfish.de/ston1th/gowiki/pkg/core"
|
||||
"github.com/blevesearch/bleve"
|
||||
"html/template"
|
||||
|
|
@ -24,6 +25,10 @@ type Index struct {
|
|||
|
||||
func NewIndex(path string) (i *Index, err error) {
|
||||
var bi bleve.Index
|
||||
err = godrop.Unveil(path, "rwc")
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
if _, err = os.Stat(path); os.IsNotExist(err) {
|
||||
mapping := bleve.NewIndexMapping()
|
||||
bi, err = bleve.New(path, mapping)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue