Skip to content

Commit

Permalink
Merge pull request #143 from jaredbischof/master
Browse files Browse the repository at this point in the history
Updating config file.
  • Loading branch information
jaredbischof committed Jan 30, 2014
2 parents 3400ee0 + 74bd77c commit 5a5be69
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 31 deletions.
43 changes: 20 additions & 23 deletions shock-server.conf.template
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
[Address]
# IP and port for api
# Note: use of port 80 may require root access
# 0.0.0.0 will bind Shock to all IP's
api-ip=0.0.0.0
api-port=7445

[Admin]
[email protected]

Expand All @@ -10,32 +17,17 @@ create-user=false

[Auth]
# defaults to local user management with basis auth
basic_auth=true
basic=true
# comment line above and uncomment below to use Globus Online as auth provider
#globus_token_url=https://nexus.api.globusonline.org/goauth/token?grant_type=client_credentials
#globus_profile_url=https://nexus.api.globusonline.org/users

[Directories]
# See documentation for details of deploying Shock
site=/usr/local/shock/site
data=/usr/local/shock
logs=/var/log/shock

# Comma delimited search path available for remote path uploads. Only remote paths that prefix
# match one of the following will be allowed. Note: poor choices can result in security concerns.
local_paths=N/A

[External]
site-url=http://localhost

[Log]
perf_log=false

[SSL]
enable=false
#key=<path_to_key_file>
#cert=<path_to_cert_file>

[Mongodb]
# Mongodb configuration
# Hostnames and ports hosts=host1[,host2:port,...,hostN]
Expand All @@ -49,13 +41,18 @@ password=
# key=unique:true/false[,dropDups:true/false][,sparse:true/false]
id=unique:true

[Address]
# IP and port for api
# Note: use of port 80 may require root access
# 0.0.0.0 will bind Shock to all IP's
api-ip=0.0.0.0
api-port=7445
[Paths]
# See documentation for details of deploying Shock
site=/usr/local/shock/site
data=/usr/local/shock
logs=/var/log/shock
local_paths=
pidfile=

[Runtime]
GOMAXPROCS=
pidfile=

[SSL]
enable=false
#key=<path_to_key_file>
#cert=<path_to_cert_file>
14 changes: 6 additions & 8 deletions shock-server/conf/conf.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,17 +73,16 @@ func Initialize() {

// Admin
Conf["admin-email"], _ = c.String("Admin", "email")
Conf["admin-secret"], _ = c.String("Admin", "secretkey")

// Directories
Conf["site-path"], _ = c.String("Directories", "site")
Conf["data-path"], _ = c.String("Directories", "data")
Conf["logs-path"], _ = c.String("Directories", "logs")
Conf["local-paths"], _ = c.String("Directories", "local_paths")
// Paths
Conf["site-path"], _ = c.String("Paths", "site")
Conf["data-path"], _ = c.String("Paths", "data")
Conf["logs-path"], _ = c.String("Paths", "logs")
Conf["local-paths"], _ = c.String("Paths", "local_paths")
Conf["pidfile"], _ = c.String("Paths", "pidfile")

// Runtime
Conf["GOMAXPROCS"], _ = c.String("Runtime", "GOMAXPROCS")
Conf["pidfile"], _ = c.String("Runtime", "pidfile")

// Mongodb
Conf["mongodb-hosts"], _ = c.String("Mongodb", "hosts")
Expand Down Expand Up @@ -136,7 +135,6 @@ func Bool(s string) bool {

// Print prints the configuration loads to stdout
func Print() {
fmt.Printf("##### Admin #####\nemail:\t%s\nsecretkey:\t%s\n\n", Conf["admin-email"], Conf["admin-secret"])
fmt.Printf("####### Anonymous ######\nread:\t%s\nwrite:\t%s\ncreate-user:\t%s\n\n", Conf["anon-read"], Conf["anon-write"], Conf["anon-user"])
if Conf["auth-type"] == "basic" {
fmt.Printf("##### Auth #####\ntype:\tbasic\n\n")
Expand Down

0 comments on commit 5a5be69

Please sign in to comment.