Allow configuration from ini-style file

This commit is contained in:
andreimarcu 2015-10-25 14:04:38 -04:00
parent c53c909165
commit 0b37309237
2 changed files with 13 additions and 1 deletions

View File

@ -29,6 +29,16 @@ Get release and run
Usage
-----
#### Configuration
All configuration options are accepted either as arguments or can be placed in an ini-style file as such:
```ini
sitename = "my linx"
siteurl = "https://linx.example.com"
remoteuploads = true
# etc
```
...and then invoke ```linx-server -config path/to/config.ini```
#### Common options
- ```-bind 127.0.0.1:8080``` -- what to bind to (default is 127.0.0.1:8080)
- ```-sitename myLinx``` -- the site name displayed on top (default is linx)

View File

@ -13,6 +13,7 @@ import (
"github.com/GeertJohan/go.rice"
"github.com/flosch/pongo2"
"github.com/vharitonsky/iniflags"
"github.com/zenazn/goji/graceful"
"github.com/zenazn/goji/web"
"github.com/zenazn/goji/web/middleware"
@ -194,7 +195,8 @@ func main() {
"value of Content-Security-Policy header for file access")
flag.StringVar(&Config.xFrameOptions, "xframeoptions", "SAMEORIGIN",
"value of X-Frame-Options header")
flag.Parse()
iniflags.Parse()
mux := setup()