added more stuff including some of docker support

This commit is contained in:
2025-03-15 21:16:17 +02:00
parent 4b9c30be7e
commit 5f99ec77a0
22 changed files with 1009 additions and 261 deletions

View File

@@ -27,35 +27,44 @@ type OidcAuthConfig struct {
}
type UserPassAuthConfig struct {
HashingAlgorithm string `yaml:"hashing_algorithm"`
Salt string `yaml:"salt"`
Type DatabaseType `yaml:"type"`
Mongo *MongoDBConfig `yaml:"mongo"`
}
type AuthorizationConfig struct {
Type string `yaml:"type"`
type AuthenticationConfig struct {
Type AuthMode `yaml:"type"`
Oidc OidcAuthConfig `yaml:"oidc"`
UserPass UserPassAuthConfig `yaml:"user_pass"`
}
type AuthentikDBConfig struct {
}
type ServersDatabaseConfig struct {
Type string `yaml:"type"`
type UsersDatabaseConfig struct {
Type DatabaseType `yaml:"type"`
Mongo *MongoDBConfig `yaml:"mongo"`
}
type UsersDatabaseConfig struct {
Type string `yaml:"type"`
Mongo *MongoDBConfig `yaml:"mongo"`
Authentik *AuthentikDBConfig `yaml:"authentik"`
type ServersInstanceManagerConfig struct {
Type InstanceManagerType
}
type ServersDatabaseConfig struct {
Type DatabaseType `yaml:"type"`
Mongo *MongoDBConfig `yaml:"mongo"`
}
type ServersAuthorizationDatabaseConfig struct {
Type DatabaseType `yaml:"type"`
Mongo *MongoDBConfig `yaml:"mongo"`
}
type GlobalConfig struct {
Email EmailConfig `yaml:"email"`
Signing SigningConfig `yaml:"signing"`
ServersDatabase ServersDatabaseConfig `yaml:"servers_database"`
UsersDatabase UsersDatabaseConfig `yaml:"users_database"`
Domain string `yaml:"domain"`
Auth AuthorizationConfig `yaml:"auth"`
// Features Configs
Email EmailConfig `yaml:"email"`
Domain string `yaml:"domain"`
Signing SigningConfig `yaml:"signing"`
Authentication AuthenticationConfig `yaml:"authentication"`
// Database Configs
ServersDatabase ServersDatabaseConfig `yaml:"servers_database"`
UsersDatabase UsersDatabaseConfig `yaml:"users_database"`
ServersAuthorizationDatabase ServersAuthorizationDatabaseConfig `yaml:"servers_authorization_database"`
}

View File

@@ -1,41 +1,24 @@
package models
type PortProtocol string
const (
TCP PortProtocol = "TCP"
UDP = "UDP"
)
type Port struct {
Protocol string
Number int
Protocol PortProtocol
PublicPort uint16
ContainerPort uint16
}
type ImageInfo struct {
Name string
Version string
Ports []Port
type Image struct {
Registry string
Tag string
}
type ServerInfo struct {
Id string
OwnerId string
DefaultCommand string
Image ImageInfo
On bool
Nickname string
Ports []Port
Domain string
}
type FileBrowserInfo struct {
Id string
OwnerId string
ConnectedTo ServerInfo
Url string
}
type ServerData struct {
Id string `bson:"Id"`
OwnerId string `bson:"OwnerId"`
Image string `bson:"Image"`
VolumeId string `bson:"VolumeId"`
Nickname string `bson:"Nickname"`
UserPermissions map[string]Permission `bson:"UserPermissions"`
DefaultCommand string `bson:"DefaultCommand"`
DefaultPorts []Port `bson:"DefaultPorts"`
type FileBrowser struct {
Id string
Url string
}

14
models/types.go Normal file
View File

@@ -0,0 +1,14 @@
package models
type DatabaseType string
const (
MONGO DatabaseType = "mongo"
)
type InstanceManagerType string
const (
KUBERNETES InstanceManagerType = "kubernetes"
DOCKER InstanceManagerType = "docker"
)