Browse Source

Allow configuration from ini-style file

pull/73/head v1.1
andreimarcu 9 years ago
parent
commit
0b37309237
  1. 10
      README.md
  2. 4
      server.go

10
README.md

@ -29,6 +29,16 @@ Get release and run
Usage 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 #### Common options
- ```-bind 127.0.0.1:8080``` -- what to bind to (default is 127.0.0.1:8080) - ```-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) - ```-sitename myLinx``` -- the site name displayed on top (default is linx)

4
server.go

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

Loading…
Cancel
Save