Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ router/router
user/user
user/tmp/
ui/ui
feature_manager/feature_manager
ui/bower_components/
ui/node_modules/
backups/backups
Expand Down
11 changes: 9 additions & 2 deletions Godeps
Original file line number Diff line number Diff line change
Expand Up @@ -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
30 changes: 30 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -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 <token>
```

You can now use gpm (and `go get`) to install private repositories to which your user has access! :)


2 changes: 1 addition & 1 deletion catalog_cache/controllers/products.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
Binary file removed feature_manager/feature_manager
Binary file not shown.
2 changes: 1 addition & 1 deletion router/plugins/health_check/health_check.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
5 changes: 2 additions & 3 deletions router/plugins/session/session.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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
Expand Down
7 changes: 3 additions & 4 deletions router/plugins/site_activity/site_activity.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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
Expand Down
5 changes: 2 additions & 3 deletions router/repositories/site_activity.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import (

"gopkg.in/mgo.v2/bson"

"github.com/FoxComm/libs/endpoints"
"github.com/FoxComm/libs/db/db_switcher"
)

Expand All @@ -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
}

Expand Down