Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Go version to 1.15 and several modules to latest #34

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 3 additions & 1 deletion .env.dist
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@ SESSION_COOKIE=.session_id
POSTGRES_USER=postgres
POSTGRES_PASSWORD=<DB_Secret_Password>
POSTGRES_DB=askmedb
POSTGRES_HOST=localhost
POSTGRES_HOST=db
# if you are running using go run main.go, uncomment the following line
# POSTGRES_HOST=localhost

# Okta settings
OKTA_CLIENT_ID=<client_id>
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM golang:1.11
FROM golang:1.15

ENV GOBIN="$GOPATH/bin"
WORKDIR /src
Expand Down
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ services:
# command: ["./wait-for-postgres.sh", "db", "go-askme"]
command: ["./wait-for-it.sh", "db:5432", "--", "go-askme"]
adminer:
image: adminer
image: "adminer:latest"
restart: always
depends_on:
- "db"
Expand Down
2 changes: 1 addition & 1 deletion docker-local.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
version: '3.1'
services:
adminer:
image: adminer
image: "adminer:latest"
restart: always
depends_on:
- "db"
Expand Down
30 changes: 15 additions & 15 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
module github.com/bashmohandes/go-askme

go 1.15

require (
cloud.google.com/go v0.32.0 // indirect
github.com/denisenkom/go-mssqldb v0.0.0-20181014144952-4e0d7dc8888f // indirect
github.com/erikstmartin/go-testdb v0.0.0-20160219214506-8d10e4a1bae5 // indirect
github.com/go-sql-driver/mysql v1.4.0 // indirect
github.com/gobuffalo/packr v1.19.0
github.com/gobuffalo/envy v1.9.0 // indirect
github.com/gobuffalo/packd v1.0.0 // indirect
github.com/gobuffalo/packr v1.30.1
github.com/google/go-cmp v0.2.0 // indirect
github.com/google/uuid v1.0.0
github.com/jinzhu/gorm v1.9.1
github.com/jinzhu/inflection v0.0.0-20180308033659-04140366298a // indirect
github.com/jinzhu/now v0.0.0-20180511015916-ed742868f2ae // indirect
github.com/google/uuid v1.1.2
github.com/jinzhu/gorm v1.9.16
github.com/joho/godotenv v1.3.0
github.com/julienschmidt/httprouter v1.2.0
github.com/lestrrat-go/jwx v0.0.0-20180928232350-0d477e6a1f0e // indirect
github.com/lestrrat-go/pdebug v0.0.0-20180220043849-39f9a71bcabe // indirect
github.com/lib/pq v1.0.0 // indirect
github.com/mattn/go-sqlite3 v1.10.0 // indirect
github.com/okta/okta-jwt-verifier-golang v0.0.0-20180501213203-04702def3e1b
go.uber.org/dig v1.6.0
golang.org/x/crypto v0.0.0-20181106171534-e4dc69e5b2fd
github.com/julienschmidt/httprouter v1.3.0
github.com/lestrrat-go/jwx v1.0.5 // indirect
github.com/lib/pq v1.8.0 // indirect
github.com/markbates/oncer v1.0.0 // indirect
github.com/okta/okta-jwt-verifier-golang v1.0.0
github.com/rogpeppe/go-internal v1.6.2 // indirect
go.uber.org/dig v1.10.0
golang.org/x/crypto v0.0.0-20201016220609-9e8e0b390897
google.golang.org/appengine v1.3.0 // indirect
)
121 changes: 121 additions & 0 deletions go.sum

Large diffs are not rendered by default.

15 changes: 8 additions & 7 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ import (
"strconv"
"time"

"github.com/bashmohandes/go-askme/answer/db"
answer "github.com/bashmohandes/go-askme/answer/db"
"github.com/bashmohandes/go-askme/models"
"github.com/bashmohandes/go-askme/question/db"
question "github.com/bashmohandes/go-askme/question/db"
userRepo "github.com/bashmohandes/go-askme/user/db"
"github.com/bashmohandes/go-askme/user/usecase"
user "github.com/bashmohandes/go-askme/user/usecase"
"github.com/bashmohandes/go-askme/web/askme"
"github.com/bashmohandes/go-askme/web/askme/controllers"
"github.com/bashmohandes/go-askme/web/framework"
Expand Down Expand Up @@ -40,6 +40,7 @@ func main() {
container.Provide(controllers.NewHomeController)
container.Provide(controllers.NewProfileController)
container.Provide(controllers.NewOktaController)
container.Provide(controllers.NewAuthController)
container.Provide(askme.NewApp)
err := container.Invoke(func(app *askme.App) {
err := migrateDB()
Expand Down Expand Up @@ -86,22 +87,22 @@ func newConfig() *framework.Config {
PostgresHost: os.Getenv("POSTGRES_HOST"),
OktaClient: os.Getenv("OKTA_CLIENT_ID"),
OktaSecret: os.Getenv("OKTA_CLIENT_SECRET"),
OktaIssuer: os.Getenv("OKTA_ISSUER"),
}
OktaIssuer: os.Getenv("OKTA_ISSUER"),
}

linkedInIdp := os.Getenv("OKTA_SOCIAL_LINKEDIN_IDP")
facebookIdp := os.Getenv("OKTA_SOCIAL_FACEBOOK_IDP")

if linkedInIdp != "" {
config.OktaSocialIdps = append(config.OktaSocialIdps, framework.OktaSocialIdp{
ID: linkedInIdp,
ID: linkedInIdp,
Name: "LINKEDIN",
})
}

if facebookIdp != "" {
config.OktaSocialIdps = append(config.OktaSocialIdps, framework.OktaSocialIdp{
ID: facebookIdp,
ID: facebookIdp,
Name: "FACEBOOK",
})
}
Expand Down
2 changes: 1 addition & 1 deletion web/askme/ask.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ type App struct {
func NewApp(base framework.App,
hc *controllers.HomeController,
pc *controllers.ProfileController,
ac *controllers.OktaController) *App {
ac *controllers.AuthController) *App {
app := &App{
App: base,
}
Expand Down
6 changes: 3 additions & 3 deletions web/askme/controllers/auth.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"fmt"
"net/http"

"github.com/bashmohandes/go-askme/user/usecase"
user "github.com/bashmohandes/go-askme/user/usecase"
"github.com/bashmohandes/go-askme/web/framework"
"github.com/bashmohandes/go-askme/web/middleware/csrf"
)
Expand Down Expand Up @@ -47,7 +47,7 @@ func (c *AuthController) login(cxt framework.Context) {
cxt.ResponseWriter(),
framework.ViewModel{
BodyTmpl: "standardlogin.body",
Title: "Login", HeadTmpl: "standardlogin.head",
Title: "Login", HeadTmpl: "standardlogin.head",
Bag: framework.Map{
csrf.TemplateTag: csrf.TemplateField(cxt),
}})
Expand Down Expand Up @@ -77,7 +77,7 @@ func (c *AuthController) signup(cxt framework.Context) {
cxt.ResponseWriter(),
framework.ViewModel{
BodyTmpl: "signup.body",
Title: "Signup",
Title: "Signup",
HeadTmpl: "signup.head",
Bag: framework.Map{
csrf.TemplateTag: csrf.TemplateField(cxt),
Expand Down