Open platform to collect and prioritize feedback
moved to wechy
goenningeb23c402da2a
diff --git a/.gitignore b/.gitignoreindex 81ede87b8..180c0e21a 100644--- a/.gitignore+++ b/.gitignore@@ -4,8 +4,8 @@ tmp/node_modules/*.coverprofile-wchy-wchy.exe+wechy+wechy.exegin-bingin-bin.exegin-bin.exe~diff --git a/.test.env b/.test.envindex 2e8618365..b5ffbe8de 100644--- a/.test.env+++ b/.test.env@@ -1,5 +1,5 @@GO_ENV=test-DATABASE_URL=postgres://wchy:wchy-pw@localhost:5555/wchy?sslmode=disable+DATABASE_URL=postgres://wechy:wechy-pw@localhost:5555/wechy?sslmode=disableAUTH_ENDPOINT=http://login.test.canhearyou.com:3000JWT_SECRET='I1$$MplJ-007A8]G#RE"0VVfvv:I~o6+2yA0@)>2|{K$Z1628z9;'w7lAsZdiff --git a/.vscode/settings.json b/.vscode/settings.jsonindex f7240faea..66464901f 100644--- a/.vscode/settings.json+++ b/.vscode/settings.json@@ -9,8 +9,8 @@"gin-bin": true,"gin-bin.exe": true,"gin-bin.exe~": true,- "wchy": true,- "wchy.exe": true,+ "wechy": true,+ "wechy.exe": true,"tmp": true,"vendor": true,"node_modules": truediff --git a/Dockerfile b/Dockerfileindex a972a7320..b49e59f88 100644--- a/Dockerfile+++ b/Dockerfile@@ -1,5 +1,5 @@FROM scratch-ADD wchy /+ADD wechy /ENV PORT 8080-CMD ["/wchy"]+CMD ["/wechy"]EXPOSE 8080\ No newline at end of filediff --git a/Makefile b/Makefileindex b00dfbcc2..ad2037fce 100644--- a/Makefile+++ b/Makefile@@ -24,14 +24,14 @@ goveralls:dockerize:ifeq ($(TRAVIS_PULL_REQUEST), false)CGO_ENABLED=0 GOOS=linux GOARCH=amd64 make build- docker build -f Dockerfile -t wecanhearyou/wchy .- $(call tag_docker, wecanhearyou/wchy)- docker push wecanhearyou/wchy+ docker build -f Dockerfile -t WeCanHearYou/wechy .+ $(call tag_docker, WeCanHearYou/wechy)+ docker push WeCanHearYou/wechyendifmigrate:ifeq ($(GO_ENV), development)- migrate -url postgres://wchy:wchy-pw@localhost:5555/wchy?sslmode=disable -path ./migrations up+ migrate -url postgres://wechy:wechy-pw@localhost:5555/wechy?sslmode=disable -path ./migrations upelsemigrate -url ${DATABASE_URL} -path ./migrations upendif@@ -43,6 +43,6 @@ watch:gin --buildArgs "-ldflags='-X main.buildtime=${BUILD_TIME}'"run:- wchy+ wechy.DEFAULT_GOAL := builddiff --git a/README.md b/README.mdindex 198566477..3409ead14 100644--- a/README.md+++ b/README.md@@ -2,7 +2,7 @@Branch | Build | Coverage------------ | ------------- | --------------master | [](https://travis-ci.org/WeCanHearYou/wchy) | [](https://coveralls.io/github/WeCanHearYou/wchy?branch=master)-dev | [](https://travis-ci.org/WeCanHearYou/wchy) | [](https://coveralls.io/github/WeCanHearYou/wchy?branch=dev)+master | [](https://travis-ci.org/WeCanHearYou/wechy) | [](https://coveralls.io/github/WeCanHearYou/wechy?branch=master)+dev | [](https://travis-ci.org/WeCanHearYou/wechy) | [](https://coveralls.io/github/WeCanHearYou/wechy?branch=dev)For more info, please visit http://we.canhearyou.comdiff --git a/app/handler.go b/app/handler.goindex dd795ed07..7afca4f18 100644--- a/app/handler.go+++ b/app/handler.go@@ -10,11 +10,11 @@ import (type statusHandler struct {healthService HealthCheckService- settings *WchySettings+ settings *WechySettings}// Status creates a new Status HTTP handler-func Status(healthService HealthCheckService, settings *WchySettings) echo.HandlerFunc {+func Status(healthService HealthCheckService, settings *WechySettings) echo.HandlerFunc {return statusHandler{healthService, settings}.get()}diff --git a/app/handler_test.go b/app/handler_test.goindex 736f6e610..879f84175 100644--- a/app/handler_test.go+++ b/app/handler_test.go@@ -3,8 +3,8 @@ package app_testimport ("testing"- "github.com/WeCanHearYou/wchy/app"- "github.com/WeCanHearYou/wchy/mock"+ "github.com/WeCanHearYou/wechy/app"+ "github.com/WeCanHearYou/wechy/mock". "github.com/onsi/gomega")@@ -18,7 +18,7 @@ func TestStatusHandler(t *testing.T) {RegisterTestingT(t)service := &falsyHealthCheckService{}- settings := &app.WchySettings{+ settings := &app.WechySettings{BuildTime: "today",}diff --git a/app/renderer.go b/app/renderer.goindex 64bf3f234..4e0dc306f 100644--- a/app/renderer.go+++ b/app/renderer.go@@ -9,8 +9,8 @@ import ("os"- "github.com/WeCanHearYou/wchy/identity"- "github.com/WeCanHearYou/wchy/toolbox/env"+ "github.com/WeCanHearYou/wechy/identity"+ "github.com/WeCanHearYou/wechy/toolbox/env""github.com/labstack/echo")@@ -29,7 +29,7 @@ func NewHTMLRenderer(logger echo.Logger) *HTMLRenderer {path = "views/"if env.IsTest() {- path = os.Getenv("GOPATH") + "/src/github.com/WeCanHearYou/wchy/" + path+ path = os.Getenv("GOPATH") + "/src/github.com/WeCanHearYou/wechy/" + path}//TODO: load all templates automatically@@ -69,7 +69,7 @@ func (r *HTMLRenderer) Render(w io.Writer, name string, data interface{}, c echo//TODO: refactor (and move somewhere else?)m := data.(echo.Map)- claims, ok := c.Get("Claims").(*identity.WchyClaims)+ claims, ok := c.Get("Claims").(*identity.WechyClaims)m["AuthEndpoint"] = os.Getenv("AUTH_ENDPOINT")if ok {diff --git a/app/router.go b/app/router.goindex 1dabc790b..7df499fda 100644--- a/app/router.go+++ b/app/router.go@@ -5,27 +5,27 @@ import ("strings"- "github.com/WeCanHearYou/wchy/feedback"- "github.com/WeCanHearYou/wchy/identity"- "github.com/WeCanHearYou/wchy/toolbox/env"+ "github.com/WeCanHearYou/wechy/feedback"+ "github.com/WeCanHearYou/wechy/identity"+ "github.com/WeCanHearYou/wechy/toolbox/env""github.com/labstack/echo""github.com/labstack/gommon/log")-// WchySettings is an application-wide settings-type WchySettings struct {+// WechySettings is an application-wide settings+type WechySettings struct {BuildTime stringAuthEndpoint string}-// WchyServices holds reference to all WCHY services-type WchyServices struct {+// WechyServices holds reference to all Wechy services+type WechyServices struct {OAuth identity.OAuthServiceUser identity.UserServiceTenant identity.TenantServiceIdea feedback.IdeaServiceHealth HealthCheckService- Settings *WchySettings+ Settings *WechySettings}func errorHandler(e error, c echo.Context) {@@ -51,7 +51,7 @@ func createLogger() echo.Logger {}// GetMainEngine returns main HTTP engine-func GetMainEngine(ctx *WchyServices) *echo.Echo {+func GetMainEngine(ctx *WechyServices) *echo.Echo {router := echo.New()router.Logger = createLogger()diff --git a/app/router_test.go b/app/router_test.goindex 7b0a05f4f..6772b1e75 100644--- a/app/router_test.go+++ b/app/router_test.go@@ -3,14 +3,14 @@ package app_testimport ("testing"- "github.com/WeCanHearYou/wchy/app"+ "github.com/WeCanHearYou/wechy/app". "github.com/onsi/gomega")func TestRouter(t *testing.T) {RegisterTestingT(t)- ctx := &app.WchyServices{}+ ctx := &app.WechyServices{}r := app.GetMainEngine(ctx)Expect(r).ToNot(BeNil())}diff --git a/docker-compose.yml b/docker-compose.ymlindex 3468e5f59..3880282fd 100644--- a/docker-compose.yml+++ b/docker-compose.yml@@ -8,5 +8,5 @@ services:ports:- "5555:5432"environment:- POSTGRES_USER: wchy- POSTGRES_PASSWORD: wchy-pw\ No newline at end of file+ POSTGRES_USER: wechy+ POSTGRES_PASSWORD: wechy-pw\ No newline at end of filediff --git a/feedback/handler.go b/feedback/handler.goindex 5bc08b860..78c35c81d 100644--- a/feedback/handler.go+++ b/feedback/handler.go@@ -1,7 +1,7 @@package feedbackimport (- "github.com/WeCanHearYou/wchy/identity"+ "github.com/WeCanHearYou/wechy/identity""github.com/labstack/echo")diff --git a/feedback/handler_test.go b/feedback/handler_test.goindex 233aad67e..4f61cf7e5 100644--- a/feedback/handler_test.go+++ b/feedback/handler_test.go@@ -3,9 +3,9 @@ package feedback_testimport ("testing"- "github.com/WeCanHearYou/wchy/feedback"- "github.com/WeCanHearYou/wchy/identity"- "github.com/WeCanHearYou/wchy/mock"+ "github.com/WeCanHearYou/wechy/feedback"+ "github.com/WeCanHearYou/wechy/identity"+ "github.com/WeCanHearYou/wechy/mock". "github.com/onsi/gomega")diff --git a/identity/handler.go b/identity/handler.goindex a34b10af9..ff5897609 100644--- a/identity/handler.go+++ b/identity/handler.go@@ -70,7 +70,7 @@ func (h OAuthHandlers) Callback(provider string) echo.HandlerFunc {}}- claims := &WchyClaims{+ claims := &WechyClaims{UserID: user.ID,UserName: user.Name,UserEmail: user.Email,diff --git a/identity/handler_test.go b/identity/handler_test.goindex 56f77c584..1587e3cdb 100644--- a/identity/handler_test.go+++ b/identity/handler_test.go@@ -5,8 +5,8 @@ import ("net/http"- "github.com/WeCanHearYou/wchy/identity"- "github.com/WeCanHearYou/wchy/mock"+ "github.com/WeCanHearYou/wechy/identity"+ "github.com/WeCanHearYou/wechy/mock". "github.com/onsi/gomega")diff --git a/identity/jwt.go b/identity/jwt.goindex 5730231a3..547b4b513 100644--- a/identity/jwt.go+++ b/identity/jwt.go@@ -1,12 +1,12 @@package identityimport (- "github.com/WeCanHearYou/wchy/toolbox/env"+ "github.com/WeCanHearYou/wechy/toolbox/env"jwt "github.com/dgrijalva/jwt-go")-//WchyClaims represents what goes into JWT tokens-type WchyClaims struct {+//WechyClaims represents what goes into JWT tokens+type WechyClaims struct {UserID int64 `json:"user/id"`UserName string `json:"user/name"`UserEmail string `json:"user/email"`@@ -16,14 +16,14 @@ type WchyClaims struct {var jwtSecret = env.MustGet("JWT_SECRET")//Encode creates new JWT tokens with given claims-func Encode(claims *WchyClaims) (string, error) {+func Encode(claims *WechyClaims) (string, error) {jwtToken := jwt.NewWithClaims(jwt.GetSigningMethod("HS256"), claims)return jwtToken.SignedString([]byte(jwtSecret))}//Decode extract claims from JWT tokens-func Decode(token string) (*WchyClaims, error) {- claims := &WchyClaims{}+func Decode(token string) (*WechyClaims, error) {+ claims := &WechyClaims{}jwtToken, err := jwt.ParseWithClaims(token, claims, func(t *jwt.Token) (interface{}, error) {return []byte(jwtSecret), nil})diff --git a/identity/jwt_test.go b/identity/jwt_test.goindex c6f7140e5..7a1ad0c1c 100644--- a/identity/jwt_test.go+++ b/identity/jwt_test.go@@ -3,14 +3,14 @@ package identity_testimport ("testing"- "github.com/WeCanHearYou/wchy/identity"+ "github.com/WeCanHearYou/wechy/identity". "github.com/onsi/gomega")func TestJWT_Encode(t *testing.T) {RegisterTestingT(t)- claims := &identity.WchyClaims{+ claims := &identity.WechyClaims{UserID: 424,UserName: "Jon Snow",UserEmail: "[email protected]",@@ -24,7 +24,7 @@ func TestJWT_Encode(t *testing.T) {func TestJWT_Decode(t *testing.T) {RegisterTestingT(t)- claims := &identity.WchyClaims{+ claims := &identity.WechyClaims{UserID: 424,UserName: "Jon Snow",UserEmail: "[email protected]",diff --git a/identity/middleware_test.go b/identity/middleware_test.goindex a0620d4bf..4a1b26b97 100644--- a/identity/middleware_test.go+++ b/identity/middleware_test.go@@ -5,7 +5,7 @@ import ("net/http/httptest""testing"- "github.com/WeCanHearYou/wchy/identity"+ "github.com/WeCanHearYou/wechy/identity""github.com/labstack/echo". "github.com/onsi/gomega")@@ -108,7 +108,7 @@ func TestJwtGetter_NoCookie(t *testing.T) {func TestJwtGetter_WithCookie(t *testing.T) {RegisterTestingT(t)- token, _ := identity.Encode(&identity.WchyClaims{+ token, _ := identity.Encode(&identity.WechyClaims{UserName: "Jon Snow",})@@ -123,7 +123,7 @@ func TestJwtGetter_WithCookie(t *testing.T) {mw := identity.JwtGetter()mw(echo.HandlerFunc(func(c echo.Context) error {- claims := c.Get("Claims").(*identity.WchyClaims)+ claims := c.Get("Claims").(*identity.WechyClaims)return c.String(http.StatusOK, claims.UserName)}))(c)@@ -151,7 +151,7 @@ func TestJwtSetter_WithoutJwt(t *testing.T) {func TestJwtSetter_WithJwt_WithoutParameter(t *testing.T) {RegisterTestingT(t)- token, _ := identity.Encode(&identity.WchyClaims{+ token, _ := identity.Encode(&identity.WechyClaims{UserName: "Jon Snow",})@@ -173,7 +173,7 @@ func TestJwtSetter_WithJwt_WithoutParameter(t *testing.T) {func TestJwtSetter_WithJwt_WithParameter(t *testing.T) {RegisterTestingT(t)- token, _ := identity.Encode(&identity.WchyClaims{+ token, _ := identity.Encode(&identity.WechyClaims{UserName: "Jon Snow",})diff --git a/main.go b/main.goindex 1c284dcae..0f90300da 100644--- a/main.go+++ b/main.go@@ -3,10 +3,10 @@ package mainimport ("database/sql"- "github.com/WeCanHearYou/wchy/app"- "github.com/WeCanHearYou/wchy/identity"- "github.com/WeCanHearYou/wchy/postgres"- "github.com/WeCanHearYou/wchy/toolbox/env"+ "github.com/WeCanHearYou/wechy/app"+ "github.com/WeCanHearYou/wechy/identity"+ "github.com/WeCanHearYou/wechy/postgres"+ "github.com/WeCanHearYou/wechy/toolbox/env"_ "github.com/lib/pq""fmt"@@ -25,13 +25,13 @@ func main() {panic(err)}- ctx := &app.WchyServices{+ ctx := &app.WechyServices{OAuth: &identity.HTTPOAuthService{},Health: &postgres.HealthCheckService{DB: db},Idea: &postgres.IdeaService{DB: db},User: &postgres.UserService{DB: db},Tenant: &postgres.TenantService{DB: db},- Settings: &app.WchySettings{+ Settings: &app.WechySettings{BuildTime: buildtime,AuthEndpoint: env.MustGet("AUTH_ENDPOINT"),},diff --git a/mock/server.go b/mock/server.goindex 96afdde8b..272718dc8 100644--- a/mock/server.go+++ b/mock/server.go@@ -7,7 +7,7 @@ import ("strings"- "github.com/WeCanHearYou/wchy/app"+ "github.com/WeCanHearYou/wechy/app""github.com/jmoiron/jsonq""github.com/labstack/echo")diff --git a/package.json b/package.jsonindex 27e8047a7..4073c461c 100644--- a/package.json+++ b/package.json@@ -1,8 +1,8 @@{- "name": "wchy",+ "name": "wechy","description": "WeCanHearYou is an open source, cross platform and free to use feedback system for companies and products.","version": "0.0.0",- "repository": "https://github.com/WeCanHearYou/wchy",+ "repository": "https://github.com/WeCanHearYou/wechy","license": "GPL-3.0","dependencies": {"semantic-ui-css": "^2.2.4"diff --git a/postgres/app_test.go b/postgres/app_test.goindex 96420670a..850ae2ac6 100644--- a/postgres/app_test.go+++ b/postgres/app_test.go@@ -6,7 +6,7 @@ import (sqlmock "gopkg.in/DATA-DOG/go-sqlmock.v1"- "github.com/WeCanHearYou/wchy/postgres"+ "github.com/WeCanHearYou/wechy/postgres". "github.com/onsi/gomega")diff --git a/postgres/feedback.go b/postgres/feedback.goindex 81aade495..37207db72 100644--- a/postgres/feedback.go+++ b/postgres/feedback.go@@ -3,7 +3,7 @@ package postgresimport ("database/sql"- "github.com/WeCanHearYou/wchy/feedback"+ "github.com/WeCanHearYou/wechy/feedback")// IdeaService contains read and write operations for ideasdiff --git a/postgres/feedback_test.go b/postgres/feedback_test.goindex 91f101014..88c324334 100644--- a/postgres/feedback_test.go+++ b/postgres/feedback_test.go@@ -6,8 +6,8 @@ import (sqlmock "gopkg.in/DATA-DOG/go-sqlmock.v1"- "github.com/WeCanHearYou/wchy/feedback"- "github.com/WeCanHearYou/wchy/postgres"+ "github.com/WeCanHearYou/wechy/feedback"+ "github.com/WeCanHearYou/wechy/postgres". "github.com/onsi/gomega")diff --git a/postgres/identity.go b/postgres/identity.goindex 174616cf2..e4431c0f9 100644--- a/postgres/identity.go+++ b/postgres/identity.go@@ -4,8 +4,8 @@ import ("database/sql""strings"- "github.com/WeCanHearYou/wchy/identity"- "github.com/WeCanHearYou/wchy/toolbox/env"+ "github.com/WeCanHearYou/wechy/identity"+ "github.com/WeCanHearYou/wechy/toolbox/env")// UserService is used for user operations using a Postgres databasediff --git a/postgres/identity_test.go b/postgres/identity_test.goindex 9ed57c93e..9657601be 100644--- a/postgres/identity_test.go+++ b/postgres/identity_test.go@@ -7,8 +7,8 @@ import (sqlmock "gopkg.in/DATA-DOG/go-sqlmock.v1"- "github.com/WeCanHearYou/wchy/identity"- "github.com/WeCanHearYou/wchy/postgres"+ "github.com/WeCanHearYou/wechy/identity"+ "github.com/WeCanHearYou/wechy/postgres". "github.com/onsi/gomega")diff --git a/toolbox/env/env.go b/toolbox/env/env.goindex 0c5709598..c0f7bf5a5 100644--- a/toolbox/env/env.go+++ b/toolbox/env/env.go@@ -22,7 +22,7 @@ func MustGet(name string) string {return value}-// GetCurrentDomain returns WCHY domain based on current environment variables+// GetCurrentDomain returns Wechy domain based on current environment variablesfunc GetCurrentDomain() string {env := os.Getenv("GO_ENV")switch env {@@ -37,7 +37,7 @@ func GetCurrentDomain() string {}-// Current returns current WCHY environment+// Current returns current Wechy environmentfunc Current() string {env := os.Getenv("GO_ENV")switch env {@@ -51,22 +51,22 @@ func Current() string {return "development"}-// IsProduction returns true on WCHY production environment+// IsProduction returns true on Wechy production environmentfunc IsProduction() bool {return Current() == "production"}-// IsStaging returns true on WCHY production environment+// IsStaging returns true on Wechy production environmentfunc IsStaging() bool {return Current() == "staging"}-// IsTest returns true on WCHY production environment+// IsTest returns true on Wechy production environmentfunc IsTest() bool {return Current() == "test"}-// IsDevelopment returns true on WCHY production environment+// IsDevelopment returns true on Wechy production environmentfunc IsDevelopment() bool {return Current() == "development"}diff --git a/toolbox/env/env_test.go b/toolbox/env/env_test.goindex 6534fa0c0..a06c98270 100644--- a/toolbox/env/env_test.go+++ b/toolbox/env/env_test.go@@ -4,7 +4,7 @@ import ("os""testing"- "github.com/WeCanHearYou/wchy/toolbox/env"+ "github.com/WeCanHearYou/wechy/toolbox/env". "github.com/onsi/gomega")diff --git a/wchy b/wchynew file mode 100755index 000000000..881c2deeeBinary files /dev/null and b/wchy differ