2023-12-24 11:40:18 +00:00
|
|
|
// Define all Database Models here
|
|
|
|
package db
|
2023-09-10 09:50:08 +00:00
|
|
|
|
|
|
|
import (
|
|
|
|
"gorm.io/gorm"
|
|
|
|
)
|
|
|
|
|
2023-12-24 11:40:18 +00:00
|
|
|
type User struct {
|
|
|
|
gorm.Model
|
|
|
|
Name string `gorm:"unique;index"`
|
|
|
|
PassHash string
|
|
|
|
Email string
|
|
|
|
DisplayName string
|
|
|
|
Groups []Group `gorm:"many2many:user_groups"`
|
|
|
|
Admin bool
|
2023-12-24 12:04:36 +00:00
|
|
|
Agent bool
|
2023-12-24 11:40:18 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
type Group struct {
|
|
|
|
gorm.Model
|
|
|
|
Name string `grom:"unique;index"`
|
|
|
|
DisplayName string
|
|
|
|
Users []User `gorm:"many2many:user_groups"`
|
|
|
|
}
|
|
|
|
|
|
|
|
type Pod struct {
|
|
|
|
gorm.Model
|
|
|
|
Name string `grom:"unique;index"`
|
|
|
|
Type PodType
|
|
|
|
BoundPorts []int
|
|
|
|
}
|
|
|
|
|
|
|
|
type PodType struct {
|
|
|
|
gorm.Model
|
|
|
|
Name string
|
|
|
|
}
|
|
|
|
|
2023-09-10 09:50:08 +00:00
|
|
|
type File struct {
|
|
|
|
gorm.Model
|
|
|
|
Name string
|
|
|
|
Comment *string
|
2024-01-07 14:10:47 +00:00
|
|
|
StatusID uint
|
2023-09-10 09:50:08 +00:00
|
|
|
Blob string
|
|
|
|
Attachments []Attachment
|
|
|
|
Properties FileProperties
|
2024-01-07 14:10:47 +00:00
|
|
|
CreatorID uint
|
|
|
|
AssigneeID uint
|
2023-09-10 09:50:08 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
type Status struct {
|
|
|
|
gorm.Model
|
2023-12-24 11:40:18 +00:00
|
|
|
Name string `grom:"unique;index"`
|
|
|
|
Comment *string
|
2023-09-10 09:50:08 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
type Attachment struct {
|
|
|
|
gorm.Model
|
2023-12-24 11:40:18 +00:00
|
|
|
Name string
|
|
|
|
Comment string
|
|
|
|
Blob string
|
2024-01-05 13:05:58 +00:00
|
|
|
FileID uint
|
2023-09-10 09:50:08 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
type FileProperties struct {
|
|
|
|
gorm.Model
|
|
|
|
Mime string
|
|
|
|
OriginalName string
|
|
|
|
Size int64
|
|
|
|
Sha256 string
|
|
|
|
Sha1 string
|
|
|
|
Md5 string
|
|
|
|
FileCmd string
|
|
|
|
Extension string
|
|
|
|
Url string
|
2024-01-05 13:05:58 +00:00
|
|
|
FileID uint
|
2023-09-10 09:50:08 +00:00
|
|
|
}
|
2023-12-30 14:28:54 +00:00
|
|
|
|
|
|
|
type Container struct {
|
|
|
|
gorm.Model
|
|
|
|
ContainerID string
|
|
|
|
FileID uint
|
|
|
|
Status int
|
|
|
|
Port int
|
|
|
|
User string
|
|
|
|
Password string //This has to be stored somewhere in plain text...
|
|
|
|
ProxyFolder string
|
|
|
|
Image string
|
|
|
|
}
|