Skip to content

Commit

Permalink
web: misc fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
dsseng committed Apr 21, 2024
1 parent d6839bd commit c9077b3
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
1 change: 1 addition & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,5 @@ FROM scratch
WORKDIR /
COPY --from=build /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
COPY --from=build /wiso /wiso
ENV GIN_MODE=release
ENTRYPOINT ["/wiso", "web", "-c", "/conf/config.yaml"]
3 changes: 3 additions & 0 deletions cmd/web.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,9 @@ var webCmd = &cobra.Command{
}
}

app.DB.AutoMigrate(&users.DeviceSession{})
app.DB.AutoMigrate(&users.User{})

go (func() {
users.CleanupOutdatedSessions(app.DB)
for range time.Tick(app.CleanupInterval) {
Expand Down
4 changes: 0 additions & 4 deletions pkg/web/web.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import (

"github.com/dsseng/wiso/pkg/ldap"
"github.com/dsseng/wiso/pkg/oidc"
"github.com/dsseng/wiso/pkg/users"
"github.com/gin-contrib/gzip"
"github.com/gin-gonic/gin"
"gorm.io/gorm"
Expand Down Expand Up @@ -132,9 +131,6 @@ func (a App) setupRouter() (*gin.Engine, error) {
}

func (a App) Start() error {
a.DB.AutoMigrate(&users.DeviceSession{})
a.DB.AutoMigrate(&users.User{})

r, err := a.setupRouter()
if err != nil {
return err
Expand Down

0 comments on commit c9077b3

Please sign in to comment.