2 // Armadillo File Manager
3 // Copyright (c) 2010, Robert Sesek <http://www.bluestatic.org>
5 // This program is free software: you can redistribute it and/or modify it under
6 // the terms of the GNU General Public License as published by the Free Software
7 // Foundation, either version 3 of the License, or any later version.
17 type Configuration struct {
18 // The path to which all file operations are restricted.
21 // The port on which the server back end runs.
24 // An array of URLs that the /proxy service will for which the back-end will
25 // forward GET requests and return the result.
28 // A map of usernames to MD5-encoded passwords that will be allowed to log in
29 // via a .htaccess style realm.
30 Users map[string]string
32 // Whether to include dotfiles (files that begin with a '.'). Users will still
33 // be able to access directories that begin with a '.', but they will not be
34 // included in the list.
38 func ReadFromFile(aPath string, config *Configuration) os.Error {
39 fd, error := os.Open(aPath)
43 decoder := json.NewDecoder(fd)
44 return decoder.Decode(config)