|
|
@@ -1,9 +1,5 @@
|
|
|
package structs
|
|
|
|
|
|
-import (
|
|
|
- "time"
|
|
|
-)
|
|
|
-
|
|
|
// incoming websocket payloads
|
|
|
type WsPayload struct {
|
|
|
Type string `json:"type"`
|
|
|
@@ -27,304 +23,8 @@ type ContainerState struct {
|
|
|
CreatedAt string
|
|
|
}
|
|
|
|
|
|
-// authenticated browser sessions
|
|
|
-type SessionInfo struct {
|
|
|
- Hash string `json:"hash"`
|
|
|
- Created string `json:"created"`
|
|
|
-}
|
|
|
-
|
|
|
-// system.json config struct
|
|
|
-type SysConfig struct {
|
|
|
- Setup string `json:"setup"`
|
|
|
- EndpointUrl string `json:"endpointUrl"`
|
|
|
- ApiVersion string `json:"apiVersion"`
|
|
|
- Piers []string `json:"piers"`
|
|
|
- NetCheck string `json:"netCheck"`
|
|
|
- UpdateMode string `json:"updateMode"`
|
|
|
- UpdateUrl string `json:"updateUrl"`
|
|
|
- UpdateBranch string `json:"updateBranch"`
|
|
|
- SwapVal int `json:"swapVal"`
|
|
|
- SwapFile string `json:"swapFile"`
|
|
|
- KeyFile string `json:"keyFile"`
|
|
|
- Sessions struct {
|
|
|
- Authorized map[string]SessionInfo `json:"authorized"`
|
|
|
- Unauthorized map[string]SessionInfo `json:"unauthorized"`
|
|
|
- } `json:"sessions"`
|
|
|
- LinuxUpdates struct {
|
|
|
- Value int `json:"value"`
|
|
|
- Interval string `json:"interval"`
|
|
|
- Previous bool `json:"previous"`
|
|
|
- } `json:"linuxUpdates"`
|
|
|
- DockerData string `json:"dockerData"`
|
|
|
- WgOn bool `json:"wgOn"`
|
|
|
- WgRegistered bool `json:"wgRegistered"`
|
|
|
- PwHash string `json:"pwHash"`
|
|
|
- C2cInterval int `json:"c2cInterval"`
|
|
|
- FirstBoot bool `json:"firstBoot"`
|
|
|
- WgRegisterd bool `json:"wgRegisterd"`
|
|
|
- GsVersion string `json:"gsVersion"`
|
|
|
- CfgDir string `json:"CFG_DIR"`
|
|
|
- UpdateInterval int `json:"updateInterval"`
|
|
|
- BinHash string `json:"binHash"`
|
|
|
- Pubkey string `json:"pubkey"`
|
|
|
- Privkey string `json:"privkey"`
|
|
|
- Salt string `json:"salt"`
|
|
|
-}
|
|
|
-
|
|
|
-// broadcast subobject
|
|
|
-type LoginStatus struct {
|
|
|
- Locked bool
|
|
|
- End time.Time
|
|
|
- Attempts int
|
|
|
-}
|
|
|
-
|
|
|
-// broadcast subobject
|
|
|
-type LoginKeys struct {
|
|
|
- Old struct {
|
|
|
- Pub string
|
|
|
- Priv string
|
|
|
- }
|
|
|
- Cur struct {
|
|
|
- Pub string
|
|
|
- Priv string
|
|
|
- }
|
|
|
-}
|
|
|
|
|
|
-// version server payload root struct
|
|
|
-type Version struct {
|
|
|
- Groundseg map[string]Channel `json:"groundseg"`
|
|
|
-}
|
|
|
|
|
|
-// version server payload substruct
|
|
|
-type Channel struct {
|
|
|
- Groundseg VersionDetails `json:"groundseg"`
|
|
|
- Manual VersionDetails `json:"manual"`
|
|
|
- Minio VersionDetails `json:"minio"`
|
|
|
- Miniomc VersionDetails `json:"miniomc"`
|
|
|
- Netdata VersionDetails `json:"netdata"`
|
|
|
- Vere VersionDetails `json:"vere"`
|
|
|
- Webui VersionDetails `json:"webui"`
|
|
|
- Wireguard VersionDetails `json:"wireguard"`
|
|
|
-}
|
|
|
|
|
|
-// version server payload substruct
|
|
|
-type VersionDetails struct {
|
|
|
- Amd64Sha256 string `json:"amd64_sha256"`
|
|
|
- Amd64URL string `json:"amd64_url,omitempty"`
|
|
|
- Arm64Sha256 string `json:"arm64_sha256"`
|
|
|
- Arm64URL string `json:"arm64_url,omitempty"`
|
|
|
- Major int `json:"major,omitempty"`
|
|
|
- Minor int `json:"minor,omitempty"`
|
|
|
- Patch int `json:"patch,omitempty"`
|
|
|
- Repo string `json:"repo,omitempty"`
|
|
|
- Tag string `json:"tag,omitempty"`
|
|
|
-}
|
|
|
|
|
|
-// broadcast payload object struct
|
|
|
-type AuthBroadcast struct {
|
|
|
- Type string `json:"type"`
|
|
|
- AuthLevel string `json:"auth_level"`
|
|
|
- Upload Upload `json:"upload"`
|
|
|
- Logs Logs `json:"logs"`
|
|
|
- System SystemInfo `json:"system"`
|
|
|
- Profile Profile `json:"profile"`
|
|
|
- Urbits map[string]Urbit `json:"urbits"`
|
|
|
-}
|
|
|
|
|
|
-// broadcast payload subobject
|
|
|
-type SystemUsage struct {
|
|
|
- RAM []uint64 `json:"ram"`
|
|
|
- CPU int `json:"cpu"`
|
|
|
- CPUTemp float64 `json:"cpu_temp"`
|
|
|
- Disk []uint64 `json:"disk"`
|
|
|
- SwapFile int `json:"swap"`
|
|
|
-}
|
|
|
-
|
|
|
-// broadcast payload subobject
|
|
|
-type SystemUpdates struct {
|
|
|
- Linux struct {
|
|
|
- State string `json:"state"`
|
|
|
- Upgrade int `json:"upgrade"`
|
|
|
- New int `json:"new"`
|
|
|
- Remove int `json:"remove"`
|
|
|
- Ignore int `json:"ignore"`
|
|
|
- } `json:"linux"`
|
|
|
-}
|
|
|
-
|
|
|
-// broadcast payload subobject
|
|
|
-type SystemWifi struct {
|
|
|
- Status string `json:"status"`
|
|
|
- Active string `json:"active"`
|
|
|
- Networks []string `json:"networks"`
|
|
|
-}
|
|
|
-
|
|
|
-// broadcast payload subobject
|
|
|
-type SystemInfo struct {
|
|
|
- Usage SystemUsage `json:"usage"`
|
|
|
- Updates SystemUpdates `json:"updates"`
|
|
|
- Wifi SystemWifi `json:"wifi"`
|
|
|
-}
|
|
|
-
|
|
|
-// broadcast payload subobject
|
|
|
-type Profile struct {
|
|
|
- Startram Startram `json:"startram"`
|
|
|
-}
|
|
|
-
|
|
|
-// broadcast payload subobject
|
|
|
-type Startram struct {
|
|
|
- Info struct {
|
|
|
- Registered bool `json:"registered"`
|
|
|
- Running bool `json:"running"`
|
|
|
- Region any `json:"region"`
|
|
|
- Expiry any `json:"expiry"`
|
|
|
- Renew bool `json:"renew"`
|
|
|
- Endpoint string `json:"endpoint"`
|
|
|
- Regions map[string]StartramRegion `json:"regions"`
|
|
|
- } `json:"info"`
|
|
|
- Transition struct {
|
|
|
- Register any `json:"register"`
|
|
|
- Toggle any `json:"toggle"`
|
|
|
- } `json:"transition"`
|
|
|
-}
|
|
|
-
|
|
|
-// broadcast payload subobject
|
|
|
-type Urbit struct {
|
|
|
- Info struct {
|
|
|
- Network string `json:"network"`
|
|
|
- Running bool `json:"running"`
|
|
|
- URL string `json:"url"`
|
|
|
- UrbAlias bool `json:"urbAlias"`
|
|
|
- MemUsage uint64 `json:"memUsage"`
|
|
|
- DiskUsage int64 `json:"diskUsage"`
|
|
|
- LoomSize int `json:"loomSize"`
|
|
|
- DevMode bool `json:"devMode"`
|
|
|
- DetectBootStatus bool `json:"detectBootStatus"`
|
|
|
- Remote bool `json:"remote"`
|
|
|
- Vere any `json:"vere"`
|
|
|
- } `json:"info"`
|
|
|
- Transition struct {
|
|
|
- Meld any `json:"meld"`
|
|
|
- ServiceRegistrationStatus string `json:"serviceRegistrationStatus"`
|
|
|
- TogglePower any `json:"togglePower"`
|
|
|
- DeleteShip any `json:"deleteShip"`
|
|
|
- } `json:"transition"`
|
|
|
-}
|
|
|
-
|
|
|
-// used to construct broadcast pier info subobject
|
|
|
-type ContainerStats struct {
|
|
|
- MemoryUsage uint64
|
|
|
- DiskUsage int64
|
|
|
-}
|
|
|
-
|
|
|
-// broadcast payload subobject
|
|
|
-type Logs struct {
|
|
|
- Containers struct {
|
|
|
- Wireguard struct {
|
|
|
- Logs []any `json:"logs"`
|
|
|
- } `json:"wireguard"`
|
|
|
- } `json:"containers"`
|
|
|
- System struct {
|
|
|
- Stream bool `json:"stream"`
|
|
|
- Logs []any `json:"logs"`
|
|
|
- } `json:"system"`
|
|
|
-}
|
|
|
-
|
|
|
-// broadcast payload subobject
|
|
|
-type Upload struct {
|
|
|
- Status string `json:"status"`
|
|
|
- Size int `json:"size"`
|
|
|
- Uploaded int `json:"uploaded"`
|
|
|
- Patp any `json:"patp"`
|
|
|
-}
|
|
|
-
|
|
|
-// broadcast payload subobject
|
|
|
-type UnauthBroadcast struct {
|
|
|
- Type string `json:"type"`
|
|
|
- AuthLevel string `json:"auth_level"`
|
|
|
- Login struct {
|
|
|
- Remainder int `json:"remainder"`
|
|
|
- } `json:"login"`
|
|
|
-}
|
|
|
-
|
|
|
-// broadcast payload subobject
|
|
|
-type SetupBroadcast struct {
|
|
|
- Type string `json:"type"`
|
|
|
- AuthLevel string `json:"auth_level"`
|
|
|
- Stage string `json:"stage"`
|
|
|
- Page string `json:"page"`
|
|
|
- Regions map[string]StartramRegion `json:"regions"`
|
|
|
-}
|
|
|
-
|
|
|
-// startram region server subobject
|
|
|
-type StartramRegion struct {
|
|
|
- Country string `json:"country"`
|
|
|
- Desc string `json:"desc"`
|
|
|
-}
|
|
|
-
|
|
|
-// pier json struct
|
|
|
-type UrbitDocker struct {
|
|
|
- PierName string `json:"pier_name"`
|
|
|
- HTTPPort int `json:"http_port"`
|
|
|
- AmesPort int `json:"ames_port"`
|
|
|
- LoomSize int `json:"loom_size"`
|
|
|
- UrbitVersion string `json:"urbit_version"`
|
|
|
- MinioVersion string `json:"minio_version"`
|
|
|
- UrbitRepo string `json:"urbit_repo"`
|
|
|
- MinioRepo string `json:"minio_repo"`
|
|
|
- UrbitAmd64Sha256 string `json:"urbit_amd64_sha256"`
|
|
|
- UrbitArm64Sha256 string `json:"urbit_arm64_sha256"`
|
|
|
- MinioAmd64Sha256 string `json:"minio_amd64_sha256"`
|
|
|
- MinioArm64Sha256 string `json:"minio_arm64_sha256"`
|
|
|
- MinioPassword string `json:"minio_password"`
|
|
|
- Network string `json:"network"`
|
|
|
- WgURL string `json:"wg_url"`
|
|
|
- WgHTTPPort int `json:"wg_http_port"`
|
|
|
- WgAmesPort int `json:"wg_ames_port"`
|
|
|
- WgS3Port int `json:"wg_s3_port"`
|
|
|
- WgConsolePort int `json:"wg_console_port"`
|
|
|
- MeldSchedule bool `json:"meld_schedule"`
|
|
|
- MeldFrequency int `json:"meld_frequency"`
|
|
|
- MeldTime string `json:"meld_time"`
|
|
|
- MeldLast string `json:"meld_last"`
|
|
|
- MeldNext string `json:"meld_next"`
|
|
|
- BootStatus string `json:"boot_status"`
|
|
|
- CustomUrbitWeb string `json:"custom_urbit_web"`
|
|
|
- CustomS3Web string `json:"custom_s3_web"`
|
|
|
- ShowUrbitWeb string `json:"show_urbit_web"`
|
|
|
- DevMode bool `json:"dev_mode"`
|
|
|
- Click bool `json:"click"`
|
|
|
-}
|
|
|
-
|
|
|
-type WgConfig struct {
|
|
|
- WireguardName string `json:"wireguard_name"`
|
|
|
- WireguardVersion string `json:"wireguard_version"`
|
|
|
- Repo string `json:"repo"`
|
|
|
- Amd64Sha256 string `json:"amd64_sha256"`
|
|
|
- Arm64Sha256 string `json:"arm64_sha256"`
|
|
|
- CapAdd []string `json:"cap_add"`
|
|
|
- Volumes []string `json:"volumes"`
|
|
|
- Sysctls struct {
|
|
|
- NetIpv4ConfAllSrcValidMark int `json:"net.ipv4.conf.all.src_valid_mark"`
|
|
|
- } `json:"sysctls"`
|
|
|
-}
|
|
|
-
|
|
|
-type McConfig struct {
|
|
|
- McName string `json:"mc_name"`
|
|
|
- McVersion string `json:"mc_version"`
|
|
|
- Repo string `json:"repo"`
|
|
|
- Amd64Sha256 string `json:"amd64_sha256"`
|
|
|
- Arm64Sha256 string `json:"arm64_sha256"`
|
|
|
-}
|
|
|
-
|
|
|
-type NetdataConfig struct {
|
|
|
- NetdataName string `json:"netdata_name"`
|
|
|
- Repo string `json:"repo"`
|
|
|
- NetdataVersion string `json:"netdata_version"`
|
|
|
- Amd64Sha256 string `json:"amd64_sha256"`
|
|
|
- Arm64Sha256 string `json:"arm64_sha256"`
|
|
|
- CapAdd []string `json:"cap_add"`
|
|
|
- Port int `json:"port"`
|
|
|
- Restart string `json:"restart"`
|
|
|
- SecurityOpt string `json:"security_opt"`
|
|
|
- Volumes []string `json:"volumes"`
|
|
|
-}
|