init from gitlab
This commit is contained in:
22
internal/models/auth.go
Normal file
22
internal/models/auth.go
Normal file
@@ -0,0 +1,22 @@
|
||||
package models
|
||||
|
||||
import "gorm.io/gorm"
|
||||
|
||||
type User struct {
|
||||
gorm.Model
|
||||
Name string `gorm:"unique"`
|
||||
Source string
|
||||
SSHKeys []SSHKey
|
||||
|
||||
PasswordHash []byte
|
||||
TotpEnabled bool
|
||||
TotpSecret string
|
||||
RecoveryCode string
|
||||
}
|
||||
|
||||
type SSHKey struct {
|
||||
gorm.Model
|
||||
UserID uint
|
||||
GithubID int64 `gorm:"unique"`
|
||||
Key string
|
||||
}
|
||||
28
internal/models/dokku.go
Normal file
28
internal/models/dokku.go
Normal file
@@ -0,0 +1,28 @@
|
||||
package models
|
||||
|
||||
import "gorm.io/gorm"
|
||||
|
||||
type App struct {
|
||||
gorm.Model
|
||||
Name string
|
||||
IsSetup bool
|
||||
SetupMethod string
|
||||
}
|
||||
|
||||
type AppSetupConfig struct {
|
||||
gorm.Model
|
||||
AppID uint
|
||||
DeployBranch string
|
||||
RepoURL string
|
||||
RepoGitRef string
|
||||
Image string
|
||||
}
|
||||
|
||||
type Service struct {
|
||||
gorm.Model
|
||||
Name string
|
||||
Type string
|
||||
BackupAuthSet bool
|
||||
BackupEncryptionSet bool
|
||||
BackupBucket string
|
||||
}
|
||||
21
internal/models/github.go
Normal file
21
internal/models/github.go
Normal file
@@ -0,0 +1,21 @@
|
||||
package models
|
||||
|
||||
import (
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
type GithubApp struct {
|
||||
gorm.Model
|
||||
AppId int64
|
||||
NodeId string
|
||||
ClientId string
|
||||
Name string
|
||||
Slug string
|
||||
ClientSecret string
|
||||
WebhookSecret string
|
||||
PEM string
|
||||
}
|
||||
|
||||
func (GithubApp) TableName() string {
|
||||
return "github_app"
|
||||
}
|
||||
25
internal/models/server.go
Normal file
25
internal/models/server.go
Normal file
@@ -0,0 +1,25 @@
|
||||
package models
|
||||
|
||||
import (
|
||||
"gitlab.com/texm/shokku/internal/server/auth"
|
||||
"gorm.io/gorm"
|
||||
"time"
|
||||
)
|
||||
|
||||
type Server struct {
|
||||
gorm.Model
|
||||
IsSetup bool
|
||||
SetupKey string
|
||||
AuthMethod auth.Method
|
||||
LastSync time.Time
|
||||
}
|
||||
|
||||
func (Server) TableName() string {
|
||||
return "server"
|
||||
}
|
||||
|
||||
type ServerSecrets struct {
|
||||
gorm.Model
|
||||
DokkuSSHKeyGob []byte
|
||||
SigningKey []byte
|
||||
}
|
||||
Reference in New Issue
Block a user