2021-09-09 00:04:08 +01:00
|
|
|
package instance
|
2021-09-07 22:55:52 +01:00
|
|
|
|
2021-09-09 00:04:08 +01:00
|
|
|
// Instance is the whole configuration for the forge platform deployment.
|
|
|
|
type Instance struct {
|
|
|
|
Project string `json:"project"`
|
2021-09-07 22:55:52 +01:00
|
|
|
Domain string `json:"domain"`
|
|
|
|
SharedGroupId int `json:"sharedGroupId"`
|
|
|
|
Docker DockerConfig `json:"docker"`
|
|
|
|
Services ServicesConfig `json:"services"`
|
|
|
|
}
|
|
|
|
|
|
|
|
// DockerConfig contains the configuration for docker specific components.
|
|
|
|
type DockerConfig struct {
|
|
|
|
Network DockerNetworkConfig `json:"network"`
|
|
|
|
SharedVolume DockerSharedVolumeConfig `json:"sharedVolume"`
|
|
|
|
}
|
|
|
|
|
|
|
|
// DockerNetworkConfig contains configuration for creating the docker network.
|
|
|
|
type DockerNetworkConfig struct {
|
|
|
|
Name string `json:"name"`
|
|
|
|
Subnet string `json:"subnet"`
|
|
|
|
Driver string `json:"driver"`
|
|
|
|
}
|
|
|
|
|
|
|
|
// DockerSharedVolumeConfig contains configuration for creating the shared volume.
|
|
|
|
type DockerSharedVolumeConfig struct {
|
|
|
|
Name string `json:"name"`
|
|
|
|
MountPath string `json:"mountPath"`
|
|
|
|
}
|
|
|
|
|
|
|
|
// Services contains a list of services and their configuration.
|
|
|
|
type ServicesConfig struct {
|
|
|
|
Traefik TraefikConfig `json:"traefik"`
|
|
|
|
Gitea GiteaConfig `json:"gitea"`
|
|
|
|
}
|
|
|
|
|
|
|
|
// TraefikConfig contains configuration for the Traefik container.
|
|
|
|
type TraefikConfig struct {
|
|
|
|
CheckNewVersion bool `json:"checkNewVersion"`
|
|
|
|
SendAnonymousUsage bool `json:"sendAnonymousUsage"`
|
|
|
|
GroupId int
|
|
|
|
ContainerIp string `json:"containerIp"`
|
|
|
|
Domain string
|
|
|
|
LogLevel string `json:"logLevel"`
|
|
|
|
Version string `json:"version"`
|
|
|
|
}
|
|
|
|
|
|
|
|
// GiteaConfig contains configuration for the Gitea container.
|
|
|
|
type GiteaConfig struct {
|
|
|
|
AppName string `json:"appName"`
|
|
|
|
BaseUri string `json:"baseUri"`
|
|
|
|
ContainerIp string `json:"containerIp"`
|
|
|
|
ContainerDataDirectory string `json:"containerDataDirectory"`
|
|
|
|
ContainerTemporaryDirectory string `json:"containerTemporaryDirectory"`
|
|
|
|
Domain string
|
|
|
|
HostDataDirectory string `json:"hostDataDirectory"`
|
|
|
|
HttpPort int `json:"httpPort"`
|
|
|
|
InternalToken string `json:"internalToken"`
|
|
|
|
LogLevel string `json:"logLevel"`
|
|
|
|
RootUrl string `json:"rootUrl"`
|
|
|
|
RunMode string `json:"runMode"`
|
|
|
|
SecretKey string `json:"secretKey"`
|
|
|
|
SshDomain string
|
|
|
|
SshPort int `json:"sshPort"`
|
|
|
|
UserId int `json:"userId"`
|
|
|
|
GroupId int
|
|
|
|
Version string `json:"version"`
|
|
|
|
}
|