diff --git a/README.md b/README.md index c7c2738..4098305 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,2 @@ -# Memo -[![Build Status](https://travis-ci.org/jmattheis/memo.svg?branch=master)](https://travis-ci.org/jmattheis/memo) [![codecov](https://codecov.io/gh/jmattheis/memo/branch/master/graph/badge.svg)](https://codecov.io/gh/jmattheis/memo) [![Go Report Card](https://goreportcard.com/badge/github.com/jmattheis/memo)](https://goreportcard.com/report/github.com/jmattheis/memo) \ No newline at end of file +# Gotify Server +[![Build Status](https://travis-ci.org/gotify/server.svg?branch=master)](https://travis-ci.org/gotify/server) [![codecov](https://codecov.io/gh/gotify/server/branch/master/graph/badge.svg)](https://codecov.io/gh/gotify/server) [![Go Report Card](https://goreportcard.com/badge/github.com/gotify/server)](https://goreportcard.com/report/github.com/gotify/server) \ No newline at end of file diff --git a/api/message.go b/api/message.go index 86770d1..55f2c83 100644 --- a/api/message.go +++ b/api/message.go @@ -6,8 +6,8 @@ import ( "time" "github.com/gin-gonic/gin" - "github.com/jmattheis/memo/auth" - "github.com/jmattheis/memo/model" + "github.com/gotify/server/auth" + "github.com/gotify/server/model" ) // The MessageDatabase interface for encapsulating database access. diff --git a/api/message_test.go b/api/message_test.go index 477e874..b9ee0e3 100644 --- a/api/message_test.go +++ b/api/message_test.go @@ -9,9 +9,9 @@ import ( "github.com/bouk/monkey" "github.com/gin-gonic/gin" - apimock "github.com/jmattheis/memo/api/mock" - "github.com/jmattheis/memo/auth" - "github.com/jmattheis/memo/model" + apimock "github.com/gotify/server/api/mock" + "github.com/gotify/server/auth" + "github.com/gotify/server/model" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" "github.com/stretchr/testify/suite" diff --git a/api/mock/mock_messagedatabase.go b/api/mock/mock_messagedatabase.go index aecae82..b09f88e 100644 --- a/api/mock/mock_messagedatabase.go +++ b/api/mock/mock_messagedatabase.go @@ -2,7 +2,7 @@ package mock import mock "github.com/stretchr/testify/mock" -import model "github.com/jmattheis/memo/model" +import model "github.com/gotify/server/model" // MockMessageDatabase is an autogenerated mock type for the MessageDatabase type type MockMessageDatabase struct { diff --git a/api/mock/mock_tokendatabase.go b/api/mock/mock_tokendatabase.go index 77be5d7..5f6a874 100644 --- a/api/mock/mock_tokendatabase.go +++ b/api/mock/mock_tokendatabase.go @@ -2,7 +2,7 @@ package mock import mock "github.com/stretchr/testify/mock" -import model "github.com/jmattheis/memo/model" +import model "github.com/gotify/server/model" // MockTokenDatabase is an autogenerated mock type for the TokenDatabase type type MockTokenDatabase struct { diff --git a/api/mock/mock_userdatabase.go b/api/mock/mock_userdatabase.go index e79bc3e..fa69d45 100644 --- a/api/mock/mock_userdatabase.go +++ b/api/mock/mock_userdatabase.go @@ -2,7 +2,7 @@ package mock import mock "github.com/stretchr/testify/mock" -import model "github.com/jmattheis/memo/model" +import model "github.com/gotify/server/model" // MockUserDatabase is an autogenerated mock type for the UserDatabase type type MockUserDatabase struct { diff --git a/api/token.go b/api/token.go index 5554162..a716eca 100644 --- a/api/token.go +++ b/api/token.go @@ -4,8 +4,8 @@ import ( "fmt" "github.com/gin-gonic/gin" - "github.com/jmattheis/memo/auth" - "github.com/jmattheis/memo/model" + "github.com/gotify/server/auth" + "github.com/gotify/server/model" ) // The TokenDatabase interface for encapsulating database access. diff --git a/api/token_test.go b/api/token_test.go index f062bbd..f1760a4 100644 --- a/api/token_test.go +++ b/api/token_test.go @@ -9,8 +9,8 @@ import ( "testing" "github.com/gin-gonic/gin" - apimock "github.com/jmattheis/memo/api/mock" - "github.com/jmattheis/memo/model" + apimock "github.com/gotify/server/api/mock" + "github.com/gotify/server/model" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" "github.com/stretchr/testify/suite" diff --git a/api/user.go b/api/user.go index 32d4ea0..cdb9c7b 100644 --- a/api/user.go +++ b/api/user.go @@ -5,8 +5,8 @@ import ( "strconv" "github.com/gin-gonic/gin" - "github.com/jmattheis/memo/auth" - "github.com/jmattheis/memo/model" + "github.com/gotify/server/auth" + "github.com/gotify/server/model" ) type userResponse struct { diff --git a/api/user_test.go b/api/user_test.go index ceb49c6..eeff6bd 100644 --- a/api/user_test.go +++ b/api/user_test.go @@ -9,9 +9,9 @@ import ( "github.com/bouk/monkey" "github.com/gin-gonic/gin" - apimock "github.com/jmattheis/memo/api/mock" - "github.com/jmattheis/memo/auth" - "github.com/jmattheis/memo/model" + apimock "github.com/gotify/server/api/mock" + "github.com/gotify/server/auth" + "github.com/gotify/server/model" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" "github.com/stretchr/testify/suite" diff --git a/auth/authentication.go b/auth/authentication.go index a13605d..7af91aa 100644 --- a/auth/authentication.go +++ b/auth/authentication.go @@ -5,7 +5,7 @@ import ( "strings" "github.com/gin-gonic/gin" - "github.com/jmattheis/memo/model" + "github.com/gotify/server/model" ) const ( diff --git a/auth/authentication_test.go b/auth/authentication_test.go index e4ed405..3d04f00 100644 --- a/auth/authentication_test.go +++ b/auth/authentication_test.go @@ -8,8 +8,8 @@ import ( "testing" "github.com/gin-gonic/gin" - authmock "github.com/jmattheis/memo/auth/mock" - "github.com/jmattheis/memo/model" + authmock "github.com/gotify/server/auth/mock" + "github.com/gotify/server/model" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" "github.com/stretchr/testify/suite" diff --git a/auth/mock/mock_database.go b/auth/mock/mock_database.go index dc35315..28c43cf 100644 --- a/auth/mock/mock_database.go +++ b/auth/mock/mock_database.go @@ -2,7 +2,7 @@ package mock import mock "github.com/stretchr/testify/mock" -import model "github.com/jmattheis/memo/model" +import model "github.com/gotify/server/model" // MockDatabase is an autogenerated mock type for the Database type type MockDatabase struct { diff --git a/auth/util.go b/auth/util.go index e6468dc..428124c 100644 --- a/auth/util.go +++ b/auth/util.go @@ -2,7 +2,7 @@ package auth import ( "github.com/gin-gonic/gin" - "github.com/jmattheis/memo/model" + "github.com/gotify/server/model" ) // RegisterAuthentication registers the user id, user and or token. diff --git a/auth/util_test.go b/auth/util_test.go index 7789414..811a57c 100644 --- a/auth/util_test.go +++ b/auth/util_test.go @@ -5,7 +5,7 @@ import ( "testing" "github.com/gin-gonic/gin" - "github.com/jmattheis/memo/model" + "github.com/gotify/server/model" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/suite" ) diff --git a/config/config.go b/config/config.go index 2ea9b99..c5e57c7 100644 --- a/config/config.go +++ b/config/config.go @@ -4,10 +4,10 @@ import "github.com/jinzhu/configor" // Configuration is stuff that can be configured externally per env variables or config file (config.yml). type Configuration struct { - Port int `default:"8080"` + Port int `default:"8080"` Database struct { Dialect string `default:"sqlite3"` - Connection string `default:"memo.db"` + Connection string `default:"gotify.db"` } DefaultUser struct { Name string `default:"admin"` @@ -18,6 +18,6 @@ type Configuration struct { // Get returns the configuration extracted from env variables or config file. func Get() *Configuration { conf := new(Configuration) - configor.New(&configor.Config{ENVPrefix: "MEMO"}).Load(conf, "config.yml", "/etc/memo/config.yml") + configor.New(&configor.Config{ENVPrefix: "GOTIFY"}).Load(conf, "config.yml", "/etc/gotify/config.yml") return conf } diff --git a/config/config_test.go b/config/config_test.go index 9266e75..9c82ee7 100644 --- a/config/config_test.go +++ b/config/config_test.go @@ -8,11 +8,11 @@ import ( ) func TestConfigEnv(t *testing.T) { - os.Setenv("MEMO_DEFAULTUSER_NAME", "jmattheis") + os.Setenv("GOTIFY_DEFAULTUSER_NAME", "jmattheis") conf := Get() assert.Equal(t, 8080, conf.Port, "should use defaults") assert.Equal(t, "jmattheis", conf.DefaultUser.Name, "should not use default but env var") - os.Unsetenv("MEMO_DEFAULTUSER_NAME") + os.Unsetenv("GOTIFY_DEFAULTUSER_NAME") } func TestConfigFile(t *testing.T) { diff --git a/database/application.go b/database/application.go index e139ff9..268a208 100644 --- a/database/application.go +++ b/database/application.go @@ -1,7 +1,7 @@ package database import ( - "github.com/jmattheis/memo/model" + "github.com/gotify/server/model" ) // GetApplicationByID returns the application for the given id or nil. diff --git a/database/application_test.go b/database/application_test.go index f26a696..7e326e9 100644 --- a/database/application_test.go +++ b/database/application_test.go @@ -1,7 +1,7 @@ package database import ( - "github.com/jmattheis/memo/model" + "github.com/gotify/server/model" "github.com/stretchr/testify/assert" ) diff --git a/database/client.go b/database/client.go index e4a2de0..24f0097 100644 --- a/database/client.go +++ b/database/client.go @@ -1,6 +1,6 @@ package database -import "github.com/jmattheis/memo/model" +import "github.com/gotify/server/model" // GetClientByID returns the client for the given id or nil. func (d *GormDatabase) GetClientByID(id string) *model.Client { diff --git a/database/client_test.go b/database/client_test.go index 5a3324a..3e7441c 100644 --- a/database/client_test.go +++ b/database/client_test.go @@ -1,7 +1,7 @@ package database import ( - "github.com/jmattheis/memo/model" + "github.com/gotify/server/model" "github.com/stretchr/testify/assert" ) diff --git a/database/database.go b/database/database.go index 7506019..3ef3d03 100644 --- a/database/database.go +++ b/database/database.go @@ -1,12 +1,12 @@ package database import ( + "github.com/gotify/server/auth" + "github.com/gotify/server/model" "github.com/jinzhu/gorm" _ "github.com/jinzhu/gorm/dialects/mysql" // enable the mysql dialect _ "github.com/jinzhu/gorm/dialects/postgres" // enable the postgres dialect _ "github.com/jinzhu/gorm/dialects/sqlite" // enable the sqlite3 dialect - "github.com/jmattheis/memo/auth" - "github.com/jmattheis/memo/model" ) // New creates a new wrapper for the gorm database framework. diff --git a/database/message.go b/database/message.go index 6ecb007..41f5885 100644 --- a/database/message.go +++ b/database/message.go @@ -1,7 +1,7 @@ package database import ( - "github.com/jmattheis/memo/model" + "github.com/gotify/server/model" ) // GetMessageByID returns the messages for the given id or nil. diff --git a/database/message_test.go b/database/message_test.go index 148ad91..29ee4fb 100644 --- a/database/message_test.go +++ b/database/message_test.go @@ -4,7 +4,7 @@ import ( "testing" "time" - "github.com/jmattheis/memo/model" + "github.com/gotify/server/model" "github.com/stretchr/testify/assert" ) diff --git a/database/user.go b/database/user.go index b6dae74..abc966f 100644 --- a/database/user.go +++ b/database/user.go @@ -1,7 +1,7 @@ package database import ( - "github.com/jmattheis/memo/model" + "github.com/gotify/server/model" ) // GetUserByName returns the user by the given name or nil. diff --git a/database/user_test.go b/database/user_test.go index 7116b1c..a6a483a 100644 --- a/database/user_test.go +++ b/database/user_test.go @@ -1,7 +1,7 @@ package database import ( - "github.com/jmattheis/memo/model" + "github.com/gotify/server/model" "github.com/stretchr/testify/assert" ) diff --git a/main/app.go b/main/app.go index 7372c9f..5485518 100644 --- a/main/app.go +++ b/main/app.go @@ -6,9 +6,9 @@ import ( "time" "github.com/gin-gonic/gin" - "github.com/jmattheis/memo/config" - "github.com/jmattheis/memo/database" - "github.com/jmattheis/memo/router" + "github.com/gotify/server/config" + "github.com/gotify/server/database" + "github.com/gotify/server/router" ) func main() { diff --git a/router/router.go b/router/router.go index 71418fc..db4fb06 100644 --- a/router/router.go +++ b/router/router.go @@ -4,11 +4,11 @@ import ( "time" "github.com/gin-gonic/gin" - "github.com/jmattheis/memo/api" - "github.com/jmattheis/memo/auth" - "github.com/jmattheis/memo/database" - "github.com/jmattheis/memo/error" - "github.com/jmattheis/memo/stream" + "github.com/gotify/server/api" + "github.com/gotify/server/auth" + "github.com/gotify/server/database" + "github.com/gotify/server/error" + "github.com/gotify/server/stream" ) // Create creates the gin engine with all routes. diff --git a/router/router_test.go b/router/router_test.go index 1d4b88f..ef9a2a5 100644 --- a/router/router_test.go +++ b/router/router_test.go @@ -11,8 +11,8 @@ import ( "github.com/gin-gonic/gin" "github.com/gin-gonic/gin/json" - "github.com/jmattheis/memo/database" - "github.com/jmattheis/memo/model" + "github.com/gotify/server/database" + "github.com/gotify/server/model" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/suite" ) diff --git a/stream/client.go b/stream/client.go index 529aa74..9c6af9d 100644 --- a/stream/client.go +++ b/stream/client.go @@ -5,7 +5,7 @@ import ( "time" "github.com/gorilla/websocket" - "github.com/jmattheis/memo/model" + "github.com/gotify/server/model" ) const ( diff --git a/stream/stream.go b/stream/stream.go index 4cda014..f5bdc94 100644 --- a/stream/stream.go +++ b/stream/stream.go @@ -6,8 +6,8 @@ import ( "github.com/gin-gonic/gin" "github.com/gorilla/websocket" - "github.com/jmattheis/memo/auth" - "github.com/jmattheis/memo/model" + "github.com/gotify/server/auth" + "github.com/gotify/server/model" ) var upgrader = websocket.Upgrader{ diff --git a/stream/stream_test.go b/stream/stream_test.go index 51f3338..0667e2c 100644 --- a/stream/stream_test.go +++ b/stream/stream_test.go @@ -18,8 +18,8 @@ import ( "github.com/fortytw2/leaktest" "github.com/gin-gonic/gin" "github.com/gorilla/websocket" - "github.com/jmattheis/memo/auth" - "github.com/jmattheis/memo/model" + "github.com/gotify/server/auth" + "github.com/gotify/server/model" "github.com/stretchr/testify/assert" )