Skip to content

Commit

Permalink
more config work
Browse files Browse the repository at this point in the history
  • Loading branch information
rhinoman committed Feb 20, 2016
1 parent ee9122b commit 4ef961a
Show file tree
Hide file tree
Showing 14 changed files with 48 additions and 351 deletions.
54 changes: 0 additions & 54 deletions auth/config.ini.example

This file was deleted.

8 changes: 0 additions & 8 deletions auth/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,6 @@ import (
)

func main() {
//defaultConfig, err := util.DefaultConfigLocation()
//if err != nil {
// log.Fatalf("Error setting config file: %v", err)
//}
// Get command line arguments
//configFile := flag.String("config", defaultConfig, "config file to load")
//flag.Parse()

//Parse the command line parameters
config.ParseCmdParams(config.DefaultCmdLine{
HostName: "localhost",
Expand Down
3 changes: 3 additions & 0 deletions clean_build.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
#!/bin/sh

cd config
go clean; go build -o wikifeat-config
cd ..
cd auth
go clean; go build -o wikifeat-auth
cd ..
Expand Down
1 change: 0 additions & 1 deletion common/config/config_etcd.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ var RegistryConfigLocation = ConfigPrefix + "registry/"
// Fetch configuration from etcd
// Because golang has no generics, this makes heavy use of reflection :|
func FetchConfig() {
LoadDefaults()
log.Printf("\nFetching Configuration from %v\n", Service.RegistryLocation)
// Get an etcd Client
etcdCfg := etcd.Config{
Expand Down
2 changes: 2 additions & 0 deletions config/config_loader/config_loader.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,8 @@ func InitDatabase() {

//Load the configuration into etcd
func SetConfig() {
log.Println("Setting service registry config")
setConfigItems(config.ServiceRegistry, config.RegistryConfigLocation)
log.Println("Setting database config")
setConfigItems(config.Database, config.DbConfigLocation)
log.Println("Setting logger config")
Expand Down
61 changes: 0 additions & 61 deletions frontend/config.ini.example

This file was deleted.

22 changes: 11 additions & 11 deletions frontend/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,27 +32,27 @@
package main

import (
"flag"
"github.com/rhinoman/wikifeat/Godeps/_workspace/src/gopkg.in/natefinch/lumberjack.v2"
"github.com/rhinoman/wikifeat/common/config"
"github.com/rhinoman/wikifeat/common/database"
"github.com/rhinoman/wikifeat/common/registry"
"github.com/rhinoman/wikifeat/common/util"
"github.com/rhinoman/wikifeat/frontend/fserv"
"github.com/rhinoman/wikifeat/frontend/routing"
"log"
)

func main() {
defaultConfig, err := util.DefaultConfigLocation()
if err != nil {
log.Fatalf("Error settting config file: %v", err)
}
// Get Command line arguments
configFile := flag.String("config", defaultConfig, "config file to load")
flag.Parse()
// Load configuration
config.LoadConfig(*configFile)
//Parse the command line parameters
config.ParseCmdParams(config.DefaultCmdLine{
HostName: "localhost",
NodeId: "fe1",
Port: "8081",
UseSSL: false,
RegistryLocation: "http://localhost:2379",
})
// Fetch Configuration from etcd
config.FetchConfig()
// Load plugin ini
fserv.LoadPluginData(config.Frontend.PluginDir + "/plugins.ini")
database.InitDb()
// Set up the core logger
Expand Down
73 changes: 0 additions & 73 deletions notifications/config.ini.example

This file was deleted.

21 changes: 10 additions & 11 deletions notifications/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,28 +32,27 @@
package main

import (
"flag"
"github.com/rhinoman/wikifeat/Godeps/_workspace/src/github.com/emicklei/go-restful"
"github.com/rhinoman/wikifeat/Godeps/_workspace/src/gopkg.in/natefinch/lumberjack.v2"
"github.com/rhinoman/wikifeat/common/config"
"github.com/rhinoman/wikifeat/common/database"
"github.com/rhinoman/wikifeat/common/registry"
"github.com/rhinoman/wikifeat/common/util"
"github.com/rhinoman/wikifeat/notifications/notification_service"
"log"
"net/http"
)

func main() {
defaultConfig, err := util.DefaultConfigLocation()
if err != nil {
log.Fatalf("Error setting config file: %v", err)
}
// Get command line arguments
configFile := flag.String("config", defaultConfig, "config file to load")
flag.Parse()
// Load Configuration
config.LoadConfig(*configFile)
//Parse the command line parameters
config.ParseCmdParams(config.DefaultCmdLine{
HostName: "localhost",
NodeId: "ns1",
Port: "4120",
UseSSL: false,
RegistryLocation: "http://localhost:2379",
})
// Fetch Configuration from etcd
config.FetchConfig()
// Set up Logger
log.SetOutput(&lumberjack.Logger{
Filename: config.Logger.LogFile,
Expand Down
58 changes: 0 additions & 58 deletions users/config.ini.example

This file was deleted.

Loading

0 comments on commit 4ef961a

Please sign in to comment.