chore: add circle ci and use external assets

Former-commit-id: a474183e1779f03ebbf0feacb6c657a7c3f32fb1 [formerly c2c77a210a1a121f6d3ba5331093a8a0b5ed9f1e] [formerly 8cc259f949bcab23ea5bb402c2f551428fa7f22b [formerly 040455b4ac]]
Former-commit-id: e05cf0627cde1ae2266c06851590573e5bdecc6e [formerly 458fc2c269daa31cc18a4132a4c801f748a610af]
Former-commit-id: 946b8ed702254d3c11f1b791c790af606f2a68f4
This commit is contained in:
Henrique Dias
2018-02-01 13:40:37 +00:00
parent 7b58b1fbf6
commit a89701b746
12 changed files with 307 additions and 359 deletions

View File

@@ -118,7 +118,7 @@ type FSBuilder func(scope string) FileSystem
func (m *FileBrowser) Setup() error {
// Creates a new File Manager instance with the Users
// map and Assets box.
m.Assets = rice.MustFindBox("./assets/dist")
m.Assets = rice.MustFindBox("./node_modules/filebrowser-frontend/dist")
m.Cron = cron.New()
// Tries to get the encryption key from the database.
@@ -210,14 +210,6 @@ func (m *FileBrowser) Setup() error {
}
}
// TODO: remove this after 1.5
for _, user := range users {
if user.ViewMode != ListViewMode && user.ViewMode != MosaicViewMode {
user.ViewMode = ListViewMode
m.Store.Users.Update(user, "ViewMode")
}
}
m.DefaultUser.Username = ""
m.DefaultUser.Password = ""
@@ -320,7 +312,7 @@ func (m FileBrowser) Runner(event string, path string, destination string, user
cmd := exec.Command(command, args...)
cmd.Env = append(os.Environ(), fmt.Sprintf("FILE=%s", path))
cmd.Env = append(cmd.Env, fmt.Sprintf("ROOT=%s", string(user.Scope)))
cmd.Env = append(cmd.Env, fmt.Sprintf("ROOT=%s", user.Scope))
cmd.Env = append(cmd.Env, fmt.Sprintf("TRIGGER=%s", event))
cmd.Env = append(cmd.Env, fmt.Sprintf("USERNAME=%s", user.Username))
@@ -372,42 +364,42 @@ type User struct {
// ID is the required primary key with auto increment0
ID int `storm:"id,increment"`
// Username is the user username used to login.
Username string `json:"username" storm:"index,unique"`
// Tells if this user is an admin.
Admin bool `json:"admin"`
// These indicate if the user can perform certain actions.
AllowCommands bool `json:"allowCommands"` // Execute commands
AllowEdit bool `json:"allowEdit"` // Edit/rename files
AllowNew bool `json:"allowNew"` // Create files and folders
AllowPublish bool `json:"allowPublish"` // Publish content (to use with static gen)
// Prevents the user to change its password.
LockPassword bool `json:"lockPassword"`
// Commands is the list of commands the user can execute.
Commands []string `json:"commands"`
// Custom styles for this user.
CSS string `json:"css"`
// FileSystem is the virtual file system the user has access.
FileSystem FileSystem `json:"-"`
// Locale is the language of the user.
Locale string `json:"locale"`
// The hashed password. This never reaches the front-end because it's temporarily
// emptied during JSON marshall.
Password string `json:"password"`
// Tells if this user is an admin.
Admin bool `json:"admin"`
// Rules is an array of access and deny rules.
Rules []*Rule `json:"rules"`
// Scope is the path the user has access to.
Scope string `json:"filesystem"`
// FileSystem is the virtual file system the user has access.
FileSystem FileSystem `json:"-"`
// Rules is an array of access and deny rules.
Rules []*Rule `json:"rules"`
// Custom styles for this user.
CSS string `json:"css"`
// Locale is the language of the user.
Locale string `json:"locale"`
// Prevents the user to change its password.
LockPassword bool `json:"lockPassword"`
// These indicate if the user can perform certain actions.
AllowNew bool `json:"allowNew"` // Create files and folders
AllowEdit bool `json:"allowEdit"` // Edit/rename files
AllowCommands bool `json:"allowCommands"` // Execute commands
AllowPublish bool `json:"allowPublish"` // Publish content (to use with static gen)
// Commands is the list of commands the user can execute.
Commands []string `json:"commands"`
// Username is the user username used to login.
Username string `json:"username" storm:"index,unique"`
// User view mode for files and folders.
ViewMode string `json:"viewMode"`