diff --git a/.gitignore b/.gitignore index 85c08ca..e080fef 100644 --- a/.gitignore +++ b/.gitignore @@ -4,6 +4,7 @@ router/router user/user user/tmp/ ui/ui +feature_manager/feature_manager ui/bower_components/ ui/node_modules/ backups/backups diff --git a/Godeps b/Godeps index 534683b..b42f5e4 100644 --- a/Godeps +++ b/Godeps @@ -4,5 +4,12 @@ github.com/pivotal-golang/archiver/compressor f598990ddfeda2767a09346acf844a7d21 github.com/mitchellh/goamz/aws caaaea8b30ee15616494ee68abd5d8ebbbef05cf github.com/stacktic/dropbox 2b5a13d88ec9944f36333051fb1f2d912cab54b9 github.com/julienschmidt/httprouter 1920724575a29b4da2ac388ce9dcf2c53e2138c0 - - +github.com/BurntSushi/toml 056c9bc7be7190eaa7715723883caffa5f8fa3e4 +github.com/karlseguin/ccache bfa769c6b6c794afa640d7259ebc270c7da037a7 +github.com/qor/qor 46b14206767518899941a503b2a47060c0ca35f7 +github.com/jinzhu/gorm b3b87d9c45675a00bc8f1bf86c0a59e1c2187f64 +github.com/FoxComm/libs/spree 55339d38ba8e677b115490478c38e61ee0bb0dbe +github.com/kidstuff/mongostore 238d10551ec8da978f2ea7d6657ba1b47a828fdf +github.com/mailgun/oxy/utils 988bfa0d106d2d52ffeb12a0396238e50a7fff41 +github.com/FoxComm/vulcand 7b8bf0e744abc0065eaec74fcfe1b5e760a68613 +github.com/sirupsen/logrus v0.8.7 diff --git a/README.md b/README.md new file mode 100644 index 0000000..8f0f5fe --- /dev/null +++ b/README.md @@ -0,0 +1,30 @@ +# FoxComm Core Services + +## Dependencies + +1. Go 1.5.1: `brew install go` + +2. Vulcand: `go get github.com/FoxComm/vulcand` + +## Setting up your environment + +1. Get GPM: `brew install gpm`; instructions for [Non-OSX setups here.](https://github.com/pote/gpm) + +2. Get dependencies via GPM: `gpm install` + +## Common Issues + +1. `go get github.com/FoxComm/vulcand` produces an error such as `coud not read username for` + +Both gpm and `go get` support using private GitHub repositories! Here's what you need to do in order for a specific machine to be able to access them: + +* Generate a GitHub access token by following [these instructions](https://help.github.com/articles/creating-an-access-token-for-command-line-use/). +* Add the following line to the `~/.netrc` file in your home directory. + +```bash +machine github.com login +``` + +You can now use gpm (and `go get`) to install private repositories to which your user has access! :) + + diff --git a/catalog_cache/controllers/products.go b/catalog_cache/controllers/products.go index 5878914..e2c7bd7 100644 --- a/catalog_cache/controllers/products.go +++ b/catalog_cache/controllers/products.go @@ -2,8 +2,8 @@ package controllers import ( "github.com/FoxComm/core_services/catalog_cache/models" - "github.com/FoxComm/libs/utils" "github.com/gin-gonic/gin" + "github.com/FoxComm/libs/utils" "net/http" "net/url" diff --git a/feature_manager/feature_manager b/feature_manager/feature_manager deleted file mode 100755 index f64648b..0000000 Binary files a/feature_manager/feature_manager and /dev/null differ diff --git a/router/plugins/health_check/health_check.go b/router/plugins/health_check/health_check.go index 0ddfea2..13b2e30 100644 --- a/router/plugins/health_check/health_check.go +++ b/router/plugins/health_check/health_check.go @@ -10,9 +10,9 @@ import ( "github.com/FoxComm/core_services/router/netutils" + "github.com/gin-gonic/gin" _ "github.com/FoxComm/libs/utils/ssl" "github.com/FoxComm/vulcand/engine" - "github.com/gin-gonic/gin" ) type host struct { diff --git a/router/plugins/session/session.go b/router/plugins/session/session.go index 30903af..eacca4a 100644 --- a/router/plugins/session/session.go +++ b/router/plugins/session/session.go @@ -6,11 +6,10 @@ import ( "encoding/gob" "net/http" - "github.com/FoxComm/libs/endpoints" - "github.com/FoxComm/libs/logger" "github.com/FoxComm/core_services/router/common" "github.com/FoxComm/core_services/router/models" "github.com/FoxComm/libs/db/db_switcher" + "github.com/FoxComm/libs/logger" "github.com/gorilla/securecookie" "github.com/gorilla/sessions" "github.com/kidstuff/mongostore" @@ -47,7 +46,7 @@ func (s *SessionMiddleware) ServeHTTP(rw http.ResponseWriter, httpReq *http.Requ } mongo := &db_switcher.Mongo{} - err := mongo.InitializeWithStoreID(common.StoreID(httpReq), "sessions", endpoints.SocialAnalyticsAPI) + err := mongo.InitializeForFeature("sessions", "social_analytics") if err != nil { logger.Error("[session] Can't connect to db_store: %s", err.Error()) return diff --git a/router/plugins/site_activity/site_activity.go b/router/plugins/site_activity/site_activity.go index beba6c6..4080462 100644 --- a/router/plugins/site_activity/site_activity.go +++ b/router/plugins/site_activity/site_activity.go @@ -10,11 +10,11 @@ import ( "strings" "time" - "github.com/FoxComm/libs/logger" "github.com/FoxComm/core_services/router/common" "github.com/FoxComm/core_services/router/models" - "github.com/FoxComm/core_services/router/repositories" netutils "github.com/FoxComm/core_services/router/netutils" + "github.com/FoxComm/core_services/router/repositories" + "github.com/FoxComm/libs/logger" "github.com/FoxComm/libs/utils" "github.com/jmcvetta/napping" oxyutils "github.com/mailgun/oxy/utils" @@ -82,8 +82,7 @@ func NewHistoryWriter(req *http.Request, cookies []*http.Cookie, respBytes []byt func (hw *HistoryWriter) CreateSiteActivity(action models.SiteAction) { r := hw.Request - storeID := common.StoreID(r) - sArepo, err := repositories.NewSiteActivityRepoWithStoreId(storeID) + sArepo, err := repositories.NewSiteActivityRepoForFeature() if err != nil { logger.Error("[SiteActivity] Can't connect to db store: %v\nAction %+v skipped", err, action) return diff --git a/router/repositories/site_activity.go b/router/repositories/site_activity.go index f158244..d95f81c 100644 --- a/router/repositories/site_activity.go +++ b/router/repositories/site_activity.go @@ -5,7 +5,6 @@ import ( "gopkg.in/mgo.v2/bson" - "github.com/FoxComm/libs/endpoints" "github.com/FoxComm/libs/db/db_switcher" ) @@ -22,9 +21,9 @@ func NewSiteActivityRepo(request *http.Request) (*SiteActivityRepo, error) { return &repo, err } -func NewSiteActivityRepoWithStoreId(storeID int) (*SiteActivityRepo, error) { +func NewSiteActivityRepoForFeature() (*SiteActivityRepo, error) { var repo SiteActivityRepo - err := repo.InitializeWithStoreID(storeID, SiteActivityCollection, endpoints.SocialAnalyticsAPI) + err := repo.InitializeForFeature(SiteActivityCollection, "social_analytics") return &repo, err }