refactor: migrate from rice to embed.FS

This commit is contained in:
Oleg Lobanov committed 2021-03-09 19:09:32 +01:00
1 parent 0fe34ad224
commit fc5506179a
10 files changed
+42 -140

No files matched your search

+8 -1
View File
@@ -3,6 +3,7 @@ package cmd
import (
"crypto/tls"
"errors"
"io/fs"
"io/ioutil"
"log"
"net"
@@ -22,6 +23,7 @@ import (
"github.com/filebrowser/filebrowser/v2/auth"
"github.com/filebrowser/filebrowser/v2/diskcache"
"github.com/filebrowser/filebrowser/v2/frontend"
fbhttp "github.com/filebrowser/filebrowser/v2/http"
"github.com/filebrowser/filebrowser/v2/img"
"github.com/filebrowser/filebrowser/v2/settings"
@@ -168,7 +170,12 @@ user created with the credentials from options "username" and "password".`,
signal.Notify(sigc, os.Interrupt, syscall.SIGTERM)
go cleanupHandler(listener, sigc)
handler, err := fbhttp.NewHandler(imgSvc, fileCache, d.store, server)
assetsFs, err := fs.Sub(frontend.Assets(), "dist")
if err != nil {
panic(err)
}
handler, err := fbhttp.NewHandler(imgSvc, fileCache, d.store, server, assetsFs)
checkErr(err)
defer listener.Close()