Remove support for ProxyURLs.
[armadillo.git] / config / config.go
1 //
2 // Armadillo File Manager
3 // Copyright (c) 2010, Robert Sesek <http://www.bluestatic.org>
4 //
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.
8 //
9
10 package config
11
12 import (
13 "encoding/json"
14 "os"
15 )
16
17 type Configuration struct {
18 // The path to which all file operations are restricted.
19 JailRoot string
20
21 // The port on which the server back end runs.
22 Port int
23
24 // Whether to include dotfiles (files that begin with a '.'). Users will still
25 // be able to access directories that begin with a '.', but they will not be
26 // included in the list.
27 IncludeDotfiles bool
28 }
29
30 func ReadFromFile(aPath string, config *Configuration) error {
31 fd, error := os.Open(aPath)
32 if error != nil {
33 return error
34 }
35 defer fd.Close()
36
37 decoder := json.NewDecoder(fd)
38 return decoder.Decode(config)
39 }