76 lines
2 KiB
Go
76 lines
2 KiB
Go
package app
|
|
|
|
import (
|
|
"database/sql"
|
|
"time"
|
|
)
|
|
|
|
type Config struct {
|
|
DatabaseURL string
|
|
ListenAddr string
|
|
UnixSocketPath string
|
|
DevMode bool
|
|
DemoUser string
|
|
DemoEmail string
|
|
AuthHeaderUser string
|
|
AuthHeaderEmail string
|
|
ForgejoBaseURL string
|
|
ForgejoToken string
|
|
ForgejoGitUsername string
|
|
ForgejoOrg string
|
|
DBProvisionAdminURL string
|
|
DBProvisionEnabled bool
|
|
CaddyAdminURL string
|
|
CaddyServerID string
|
|
CaddyDomainSuffix string
|
|
CaddyRouteEnabled bool
|
|
WebhookBaseURL string
|
|
}
|
|
|
|
type App struct {
|
|
cfg Config
|
|
db *sql.DB
|
|
}
|
|
|
|
type User struct {
|
|
Username string `json:"username"`
|
|
Email string `json:"email"`
|
|
}
|
|
|
|
type Project struct {
|
|
ID int64 `json:"id"`
|
|
UserID string `json:"-"`
|
|
Name string `json:"name"`
|
|
Slug string `json:"slug"`
|
|
Description string `json:"description"`
|
|
RepoURL string `json:"repo_url"`
|
|
RepoPrivate bool `json:"repo_private"`
|
|
ServiceName string `json:"service_name"`
|
|
RouteHost string `json:"route_host"`
|
|
TargetPort int `json:"target_port"`
|
|
WorkspaceID int64 `json:"workspace_id"`
|
|
Workspace string `json:"workspace"`
|
|
UnixUser string `json:"unix_user"`
|
|
WebhookURL string `json:"webhook_url"`
|
|
DeployToken string `json:"-"`
|
|
ProvisionState string `json:"provision_state"`
|
|
ProvisionError string `json:"provision_error,omitempty"`
|
|
DBName string `json:"db_name,omitempty"`
|
|
DBUser string `json:"db_user,omitempty"`
|
|
DBPassword string `json:"-"`
|
|
CreatedAt time.Time `json:"created_at"`
|
|
}
|
|
|
|
type EnvVar struct {
|
|
ID int64 `json:"id"`
|
|
ProjectID int64 `json:"project_id"`
|
|
Key string `json:"key"`
|
|
Value string `json:"value"`
|
|
}
|
|
|
|
type Workspace struct {
|
|
ID int64 `json:"id"`
|
|
UserID string `json:"-"`
|
|
Name string `json:"name"`
|
|
UnixUser string `json:"unix_user"`
|
|
}
|