🧹: gofmt
parent
d309066def
commit
92fda0070c
|
@ -4,9 +4,9 @@ import (
|
|||
"net/http"
|
||||
"os"
|
||||
|
||||
"github.com/filebrowser/filebrowser/v2/errors"
|
||||
"github.com/filebrowser/filebrowser/v2/settings"
|
||||
"github.com/filebrowser/filebrowser/v2/users"
|
||||
"github.com/filebrowser/filebrowser/v2/errors"
|
||||
)
|
||||
|
||||
// MethodProxyAuth is used to identify no auth.
|
||||
|
|
|
@ -16,10 +16,10 @@ func init() {
|
|||
var importCmd = &cobra.Command{
|
||||
Use: "import",
|
||||
Short: "Imports an old configuration",
|
||||
Long: `Imports an old configuration. This command DOES NOT
|
||||
Long: `Imports an old configuration. This command DOES NOT
|
||||
import share links because they are incompatible with
|
||||
this version.`,
|
||||
Args: cobra.NoArgs,
|
||||
Args: cobra.NoArgs,
|
||||
Run: func(cmd *cobra.Command, args []string) {
|
||||
oldDB := mustGetString(cmd, "old.database")
|
||||
oldConf := mustGetString(cmd, "old.config")
|
||||
|
|
|
@ -20,12 +20,12 @@ func init() {
|
|||
var rulesCmd = &cobra.Command{
|
||||
Use: "rules",
|
||||
Short: "Rules management utility",
|
||||
Long: `On each subcommand you'll have available at least two flags:
|
||||
Long: `On each subcommand you'll have available at least two flags:
|
||||
"username" and "id". You must either set only one of them
|
||||
or none. If you set one of them, the command will apply to
|
||||
an user, otherwise it will be applied to the global set or
|
||||
rules.`,
|
||||
Args: cobra.NoArgs,
|
||||
Args: cobra.NoArgs,
|
||||
Run: func(cmd *cobra.Command, args []string) {
|
||||
cmd.Help()
|
||||
os.Exit(0)
|
||||
|
|
|
@ -17,10 +17,10 @@ import (
|
|||
|
||||
var resourceGetHandler = withUser(func(w http.ResponseWriter, r *http.Request, d *data) (int, error) {
|
||||
file, err := files.NewFileInfo(files.FileOptions{
|
||||
Fs: d.user.Fs,
|
||||
Path: r.URL.Path,
|
||||
Modify: d.user.Perm.Modify,
|
||||
Expand: true,
|
||||
Fs: d.user.Fs,
|
||||
Path: r.URL.Path,
|
||||
Modify: d.user.Perm.Modify,
|
||||
Expand: true,
|
||||
Checker: d,
|
||||
})
|
||||
if err != nil {
|
||||
|
|
|
@ -2,12 +2,12 @@ package http
|
|||
|
||||
import (
|
||||
"encoding/json"
|
||||
"text/template"
|
||||
"log"
|
||||
"net/http"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"strings"
|
||||
"text/template"
|
||||
|
||||
"github.com/GeertJohan/go.rice"
|
||||
"github.com/filebrowser/filebrowser/v2/auth"
|
||||
|
|
|
@ -3,8 +3,8 @@ package runner
|
|||
import (
|
||||
"os/exec"
|
||||
|
||||
"github.com/mholt/caddy"
|
||||
"github.com/filebrowser/filebrowser/v2/settings"
|
||||
"github.com/mholt/caddy"
|
||||
)
|
||||
|
||||
// ParseCommand parses the command taking in account if the current
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
package bolt
|
||||
|
||||
import (
|
||||
"github.com/filebrowser/filebrowser/v2/settings"
|
||||
"github.com/asdine/storm"
|
||||
"github.com/filebrowser/filebrowser/v2/auth"
|
||||
"github.com/filebrowser/filebrowser/v2/settings"
|
||||
"github.com/filebrowser/filebrowser/v2/share"
|
||||
"github.com/filebrowser/filebrowser/v2/storage"
|
||||
"github.com/filebrowser/filebrowser/v2/users"
|
||||
|
@ -13,13 +13,13 @@ import (
|
|||
func NewStorage(db *storm.DB) *storage.Storage {
|
||||
users := users.NewStorage(usersBackend{db: db})
|
||||
share := share.NewStorage(shareBackend{db: db})
|
||||
settings := settings.NewStorage(settingsBackend{ db: db})
|
||||
settings := settings.NewStorage(settingsBackend{db: db})
|
||||
auth := auth.NewStorage(authBackend{db: db}, users)
|
||||
|
||||
return &storage.Storage{
|
||||
Auth: auth,
|
||||
Users: users,
|
||||
Share: share,
|
||||
Auth: auth,
|
||||
Users: users,
|
||||
Share: share,
|
||||
Settings: settings,
|
||||
}
|
||||
}
|
||||
|
|
|
@ -10,8 +10,8 @@ import (
|
|||
// Storage is a storage powered by a Backend whih makes the neccessary
|
||||
// verifications when fetching and saving data to ensure consistency.
|
||||
type Storage struct {
|
||||
Users *users.Storage
|
||||
Share *share.Storage
|
||||
Auth *auth.Storage
|
||||
Users *users.Storage
|
||||
Share *share.Storage
|
||||
Auth *auth.Storage
|
||||
Settings *settings.Storage
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue