Documentation
¶
Index ¶
- Variables
- func API_ConnectToExisting(w http.ResponseWriter, req *http.Request)
- func API_GetConfig(w http.ResponseWriter, req *http.Request)
- func API_GetLogs(w http.ResponseWriter, req *http.Request)
- func API_GetNextIP(w http.ResponseWriter, req *http.Request)
- func API_NewConstellation(w http.ResponseWriter, req *http.Request)
- func API_Ping(w http.ResponseWriter, req *http.Request)
- func API_Reset(w http.ResponseWriter, req *http.Request)
- func API_Restart(w http.ResponseWriter, req *http.Request)
- func AdjustDNS(logBuffer *lumberjack.Logger) error
- func CheckConstellationToken(req *http.Request) error
- func ClientConnectToJS() error
- func ClientHeartbeatInit()
- func CloseNATSClient()
- func ConstellationAPIDevices(w http.ResponseWriter, req *http.Request)
- func ConstellationConnected() bool
- func DeviceBlock(w http.ResponseWriter, req *http.Request)
- func DeviceCreate_API(w http.ResponseWriter, req *http.Request)
- func DeviceEdit_API(w http.ResponseWriter, req *http.Request)
- func DeviceList(w http.ResponseWriter, req *http.Request)
- func DevicePing(w http.ResponseWriter, req *http.Request)
- func DevicePublicList(w http.ResponseWriter, req *http.Request)
- func ExportDefaultConfigToYAML(outputPath string) error
- func ExportLighthouseFromDB() error
- func GetAllDevices() ([]utils.ConstellationDevice, error)
- func GetAllDevicesEvenBlocked() ([]utils.ConstellationDevice, error)
- func GetAllLightHouses() ([]utils.ConstellationDevice, error)
- func GetAllLighthouseIPFromTempConfig() ([]string, error)
- func GetAllTunneledRoutes() []utils.ProxyRouteConfig
- func GetCertFingerprint(certPath string) (string, error)
- func GetClusterIPs() ([]*url.URL, error)
- func GetConfigAttribute(configPath string, attr string) (string, error)
- func GetCurrentDevice() (utils.ConstellationDevice, error)
- func GetCurrentDeviceAPIKey() (string, error)
- func GetCurrentDeviceHostname() (string, error)
- func GetCurrentDeviceIP() (string, error)
- func GetCurrentDeviceIsExitNode() (bool, error)
- func GetCurrentDeviceIsLoadbalancer() (bool, error)
- func GetCurrentDeviceIsRelay() (bool, error)
- func GetCurrentDeviceName() (string, error)
- func GetDefaultHostnames() []string
- func GetDeviceIp(device string) string
- func GetLocalTunnelCache() []utils.ConstellationTunnel
- func GetNATSCredentials() (string, string, error)
- func GetNextAvailableIP(cidr string) string
- func Init()
- func InitConfig()
- func InitDNS()
- func InitHostname()
- func InitNATSClient() error
- func InitPingLighthouses()
- func IsClientConnected() bool
- func IsConstellationIP(ip string) bool
- func IsTunneled(route utils.ProxyRouteConfig) bool
- func MakeSyncPayload(rawPayload string) string
- func MasterNATSClientRouter()
- func PingLighthouses()
- func PingNATSClient() bool
- func PublicDeviceListNATS(m *nats.Msg)
- func PublishNATSMessage(topic string, payload string) error
- func ReceiveSyncPayload(rawPayload string) bool
- func ResetNebula() error
- func RestartNebula()
- func SendNATSMessage(topic string, payload string) (string, error)
- func SendNATSMessageAllReply(topic string, payload string, timeout time.Duration, ...) error
- func SendNewDBSyncMessage()
- func SendRequestSyncMessage()
- func StartNATS()
- func StopHeartbeat()
- func StopNATS()
- func SyncNATSClientRouter(nc *nats.Conn)
- func TunnelList(w http.ResponseWriter, req *http.Request)
- func UpdateFirewallBlockedClients() error
- func UpdateLocalTunnelCache()
- func ValidateStaticHosts(logBuffer *lumberjack.Logger) error
- type DeviceBlockRequestJSON
- type DeviceCreateRequestJSON
- type DeviceEditRequestJSON
- type NodeHeartbeat
- type PublicDeviceInfo
- type SyncDNSPayload
- type SyncPayload
- type SyncRequestPayload
Constants ¶
This section is empty.
Variables ¶
View Source
var CachedDeviceNames = map[string]string{}
View Source
var CachedDevices = map[string]utils.ConstellationDevice{}
View Source
var DNSBlacklist = map[string]bool{}
View Source
var DNSStarted = false
View Source
var NATSClientTopic = ""
View Source
var NebulaDefaultConfig utils.NebulaConfig
View Source
var NebulaHasStarted = false
View Source
var NebulaStarted = false
View Source
var (
ProcessMux sync.Mutex
)
Functions ¶
func API_ConnectToExisting ¶
func API_ConnectToExisting(w http.ResponseWriter, req *http.Request)
func API_GetConfig ¶
func API_GetConfig(w http.ResponseWriter, req *http.Request)
func API_GetLogs ¶
func API_GetLogs(w http.ResponseWriter, req *http.Request)
func API_GetNextIP ¶ added in v0.21.0
func API_GetNextIP(w http.ResponseWriter, req *http.Request)
func API_NewConstellation ¶ added in v0.21.0
func API_NewConstellation(w http.ResponseWriter, req *http.Request)
func API_Restart ¶
func API_Restart(w http.ResponseWriter, req *http.Request)
func AdjustDNS ¶ added in v0.19.0
func AdjustDNS(logBuffer *lumberjack.Logger) error
func CheckConstellationToken ¶ added in v0.16.0
TODO: Cache this
func ClientConnectToJS ¶ added in v0.21.0
func ClientConnectToJS() error
func ClientHeartbeatInit ¶ added in v0.21.0
func ClientHeartbeatInit()
func CloseNATSClient ¶ added in v0.16.0
func CloseNATSClient()
func ConstellationAPIDevices ¶
func ConstellationAPIDevices(w http.ResponseWriter, req *http.Request)
func ConstellationConnected ¶ added in v0.21.0
func ConstellationConnected() bool
func DeviceBlock ¶
func DeviceBlock(w http.ResponseWriter, req *http.Request)
func DeviceCreate_API ¶ added in v0.21.0
func DeviceCreate_API(w http.ResponseWriter, req *http.Request)
func DeviceEdit_API ¶ added in v0.21.0
func DeviceEdit_API(w http.ResponseWriter, req *http.Request)
func DeviceList ¶
func DeviceList(w http.ResponseWriter, req *http.Request)
func DevicePing ¶ added in v0.19.0
func DevicePing(w http.ResponseWriter, req *http.Request)
func DevicePublicList ¶ added in v0.19.0
func DevicePublicList(w http.ResponseWriter, req *http.Request)
func ExportDefaultConfigToYAML ¶ added in v0.21.0
func ExportLighthouseFromDB ¶ added in v0.21.0
func ExportLighthouseFromDB() error
func GetAllDevices ¶ added in v0.21.0
func GetAllDevices() ([]utils.ConstellationDevice, error)
func GetAllDevicesEvenBlocked ¶ added in v0.21.0
func GetAllDevicesEvenBlocked() ([]utils.ConstellationDevice, error)
func GetAllLightHouses ¶
func GetAllLightHouses() ([]utils.ConstellationDevice, error)
func GetAllLighthouseIPFromTempConfig ¶ added in v0.21.0
func GetAllTunneledRoutes ¶ added in v0.21.0
func GetAllTunneledRoutes() []utils.ProxyRouteConfig
func GetCertFingerprint ¶
func GetClusterIPs ¶ added in v0.21.0
func GetConfigAttribute ¶ added in v0.18.0
func GetCurrentDevice ¶ added in v0.21.0
func GetCurrentDevice() (utils.ConstellationDevice, error)
func GetCurrentDeviceAPIKey ¶ added in v0.21.0
func GetCurrentDeviceHostname ¶ added in v0.21.0
func GetCurrentDeviceIP ¶ added in v0.21.0
func GetCurrentDeviceIsExitNode ¶ added in v0.21.0
func GetCurrentDeviceIsLoadbalancer ¶ added in v0.21.0
func GetCurrentDeviceIsRelay ¶ added in v0.21.0
func GetCurrentDeviceName ¶ added in v0.21.0
func GetDefaultHostnames ¶ added in v0.21.0
func GetDefaultHostnames() []string
func GetDeviceIp ¶ added in v0.16.0
func GetLocalTunnelCache ¶ added in v0.21.0
func GetLocalTunnelCache() []utils.ConstellationTunnel
func GetNATSCredentials ¶ added in v0.16.0
func GetNextAvailableIP ¶ added in v0.21.0
GetNextAvailableIP fetches all used IPs from the database and returns the next available IP in the given CIDR range
func InitConfig ¶
func InitConfig()
func InitHostname ¶ added in v0.21.0
func InitHostname()
func InitNATSClient ¶ added in v0.16.0
func InitNATSClient() error
func InitPingLighthouses ¶ added in v0.19.0
func InitPingLighthouses()
func IsClientConnected ¶ added in v0.16.0
func IsClientConnected() bool
func IsConstellationIP ¶ added in v0.21.0
func IsTunneled ¶ added in v0.21.0
func IsTunneled(route utils.ProxyRouteConfig) bool
func MakeSyncPayload ¶ added in v0.16.0
func MasterNATSClientRouter ¶ added in v0.16.0
func MasterNATSClientRouter()
func PingLighthouses ¶ added in v0.19.0
func PingLighthouses()
func PingNATSClient ¶ added in v0.16.0
func PingNATSClient() bool
func PublicDeviceListNATS ¶ added in v0.21.0
func PublishNATSMessage ¶ added in v0.16.0
func ReceiveSyncPayload ¶ added in v0.16.0
func ResetNebula ¶
func ResetNebula() error
func RestartNebula ¶
func RestartNebula()
func SendNATSMessage ¶ added in v0.16.0
func SendNATSMessageAllReply ¶ added in v0.21.0
func SendNewDBSyncMessage ¶ added in v0.21.0
func SendNewDBSyncMessage()
func SendRequestSyncMessage ¶ added in v0.21.0
func SendRequestSyncMessage()
func StopHeartbeat ¶ added in v0.21.0
func StopHeartbeat()
func SyncNATSClientRouter ¶ added in v0.21.0
func TunnelList ¶ added in v0.21.0
func TunnelList(w http.ResponseWriter, req *http.Request)
func UpdateFirewallBlockedClients ¶ added in v0.19.0
func UpdateFirewallBlockedClients() error
func UpdateLocalTunnelCache ¶ added in v0.21.0
func UpdateLocalTunnelCache()
func ValidateStaticHosts ¶ added in v0.19.0
func ValidateStaticHosts(logBuffer *lumberjack.Logger) error
Types ¶
type DeviceBlockRequestJSON ¶
type DeviceCreateRequestJSON ¶
type DeviceCreateRequestJSON struct {
DeviceName string `json:"deviceName",validate:"required,min=3,max=32,alphanum"`
IP string `json:"ip",validate:"required,ipv4"`
PublicKey string `json:"publicKey",omitempty`
// for devices only
Nickname string `json:"nickname",validate:"max=32,alphanum",omitempty`
Invisible bool `json:"invisible",omitempty`
// for lighthouse only
IsLighthouse bool `json:"isLighthouse",omitempty`
CosmosNode int `json:"cosmosNode",omitempty`
IsRelay bool `json:"isRelay",omitempty`
IsLoadBalancer bool `json:"isLoadBalancer",omitempty`
IsExitNode bool `json:"isExitNode",omitempty`
PublicHostname string `json:"PublicHostname",omitempty`
Port string `json:"port",omitempty`
// internal
APIKey string `json:"-"`
}
func DeviceCreate ¶
func DeviceCreate(request DeviceCreateRequestJSON) (string, string, string, DeviceCreateRequestJSON, error)
type DeviceEditRequestJSON ¶ added in v0.21.0
type NodeHeartbeat ¶ added in v0.21.0
type PublicDeviceInfo ¶ added in v0.19.0
type PublicDeviceInfo struct {
DeviceID string `json:"id"`
DeviceName string `json:"name"`
User string `json:"user"`
IP string `json:"ip"`
IsLighthouse bool `json:"isLighthouse"`
CosmosNode int `json:"cosmosNode"`
IsRelay bool `json:"isRelay"`
IsExitNode bool `json:"isExitNode"`
PublicHostname string `json:"publicHostname"`
Port string `json:"port"`
}
PublicDeviceInfo represents the limited device information exposed to the public API
type SyncDNSPayload ¶ added in v0.21.0
type SyncPayload ¶ added in v0.16.0
type SyncRequestPayload ¶ added in v0.21.0
type SyncRequestPayload struct {
EditedAt int64 `json:"editedAt"`
}
Source Files
¶
- DNS.go
- NATS.go
- api_devices_block.go
- api_devices_config.go
- api_devices_create.go
- api_devices_edit.go
- api_devices_index.go
- api_devices_list.go
- api_devices_ping.go
- api_devices_public.go
- api_get_ip.go
- api_nebula.go
- api_nebula_connect.go
- api_tunnels.go
- config-manip.go
- index.go
- nebula.go
- nebula_default.go
- sync.go
- tunnels.go
Click to show internal directories.
Click to hide internal directories.