Documentation
¶
Overview ¶
Package glivela defines Petauron's runtime-independent account, access, routing, quota, deployment, and subscription rules for managed Xray entries.
Index ¶
- Constants
- func CompositePublicIP(address netip.Addr) bool
- func Hysteria2LinkForCredential(endpoint HysteriaEndpoint, material CredentialMaterial, name string) (string, error)
- func HysteriaCertificateNotAfter(endpoint HysteriaEndpoint) (time.Time, error)
- func Identity(secret string) string
- func LinkForCredential(endpoint RealityEndpoint, material CredentialMaterial, name string) (string, error)
- func PublicTransportIPv4(value string) bool
- func PublicTransportIPv6(value string) bool
- func RenderLinks(entries []NativeEntry, accountID string, mode PublishingMode, ...) ([]byte, error)
- func RenderXrayConfiguration(plan XrayPlan) ([]byte, error)
- func RouteUser(grantID string) string
- func SealImportMaterial(m ImportMaterial, key []byte, snapshotID string) ([]byte, error)
- func SubscriptionTokenFingerprint(token string) string
- func ValidIdentifier(value string) bool
- func ValidIdentity(value string) bool
- func ValidRealityTargetPin(target, pin string) bool
- func ValidateCompositeExitPair(ipv6, ipv4 RoutePeer) error
- func ValidateCompositePeers(grant RouteGrant, ipv6, ipv4 RoutePeer) error
- func ValidateEndpointImport(material ImportMaterial, endpoints []ImportEndpoint) error
- func VerifyAppliedReceipt(desired DesiredArtifact, receipt AppliedReceipt) error
- type AccessGate
- type Account
- type AccountPlan
- type AppliedReceipt
- type BusinessOwnership
- type ClientChain
- type ClientChainRelay
- type ClientLanding
- type CounterSnapshot
- type Credential
- type CredentialKind
- type CredentialMaterial
- type DesiredArtifact
- type EgressPolicy
- type HysteriaEndpoint
- type ImportAccount
- type ImportApplication
- type ImportEndpoint
- type ImportLandingSelection
- type ImportMaterial
- type ImportNode
- type ImportPlan
- type ImportPublication
- type ImportReferences
- type ImportResetSchedule
- type ImportService
- type ImportTrafficCounters
- type NativeEntry
- type PrivateTransport
- type ProtocolKind
- type PublicSSHPolicy
- type PublishedClientChain
- type PublishedRoute
- type PublishingMode
- type QuotaProjection
- type RealityEndpoint
- type RealityInitialRepair
- type RealityTargetChange
- type RouteGrant
- type RoutePeer
- type SubscriptionItem
- type SubscriptionOrder
- type UsageMember
- type XrayPlan
Constants ¶
const ( MaxIdentifierLength = 128 MaxDisplayNameLength = 512 MaxResetDays = 3650 )
const ( DefaultRealityPort = 443 RealityBackendPort = 10443 DefaultLandingSOCKSPort = 1080 XrayAPIListenPort = 10085 XrayMinimumClient = "0.0.0" )
const IPv4ClientSS2022 = "ipv4-ss2022"
const IPv4ClientSS2022Method = "2022-blake3-aes-256-gcm"
const IPv4RelaySS2022 = "ipv4-relay-ss2022"
IPv4RelaySS2022 is an exact-source client-only relay, independent of the server-forwarding source grants.
const ManagedLocalTLSTarget = "127.0.0.1:24483"
ManagedLocalTLSTarget is the fixed TLS origin published on loopback by Vastora's managed gateway. It is not a general private-target allowance.
const SS2022Method = "2022-blake3-aes-128-gcm"
const XrayRenderVersion uint8 = 15
XrayRenderVersion identifies the deterministic entry configuration format. Bit zero retains the REALITY UDP 443 policy. Bit one removes the retired management-port blacklist. Bit two enables automatic TCP family fallback. Bit three selects IPv6 resolver transport for explicit IPv6-only entries. Versions 0..3 and 7 remain immutable snapshot readers.
Variables ¶
This section is empty.
Functions ¶
func CompositePublicIP ¶
CompositePublicIP validates reported public exit addresses before publication.
func Hysteria2LinkForCredential ¶
func Hysteria2LinkForCredential(endpoint HysteriaEndpoint, material CredentialMaterial, name string) (string, error)
func HysteriaCertificateNotAfter ¶
func HysteriaCertificateNotAfter(endpoint HysteriaEndpoint) (time.Time, error)
func LinkForCredential ¶
func LinkForCredential(endpoint RealityEndpoint, material CredentialMaterial, name string) (string, error)
func PublicTransportIPv4 ¶
PublicTransportIPv4 permits a single canonical unicast endpoint, never a subnet, wildcard, private management address or DNS-dependent destination.
func PublicTransportIPv6 ¶
PublicTransportIPv6 accepts only a canonical, non-transition global unicast address. Transport endpoints and authorized sources are exact addresses, never prefixes or names resolved by a different network namespace.
func RenderLinks ¶
func RenderLinks(entries []NativeEntry, accountID string, mode PublishingMode, routes []PublishedRoute, order []string, encoded bool) ([]byte, error)
func RenderXrayConfiguration ¶
func SealImportMaterial ¶
func SealImportMaterial(m ImportMaterial, key []byte, snapshotID string) ([]byte, error)
SealImportMaterial uses standard authenticated encryption with an externally supplied 256-bit transfer key. Nonces come from Go's GCM implementation. The authenticated snapshot identifier prevents swapping material between exports. Successful decryption is not evidence that the legacy writer is fenced.
func ValidIdentifier ¶
func ValidIdentity ¶
func ValidRealityTargetPin ¶
ValidRealityTargetPin checks the durable hostname/port and reviewed address. The only non-public destination is the managed same-host TLS origin.
func ValidateCompositePeers ¶
func ValidateCompositePeers(grant RouteGrant, ipv6, ipv4 RoutePeer) error
Composite routes keep one client credential and one quota membership. The private transport family is independent of each exit's final public family.
func ValidateEndpointImport ¶
func ValidateEndpointImport(material ImportMaterial, endpoints []ImportEndpoint) error
ValidateEndpointImport covers every credential's existing entry, not just entries selected for the first landing migration. Empty account inventories may legitimately coexist with configured endpoints and vice versa.
func VerifyAppliedReceipt ¶
func VerifyAppliedReceipt(desired DesiredArtifact, receipt AppliedReceipt) error
Types ¶
type AccessGate ¶
type Account ¶
type Account struct {
ID string `json:"id"`
DisplayName string `json:"displayName"`
Plan AccountPlan `json:"plan"`
DesiredRevision uint64 `json:"desiredRevision"`
AppliedRevision uint64 `json:"appliedRevision"`
}
type AccountPlan ¶
type AccountPlan struct {
TotalBytes int64 `json:"totalBytes"`
ExpiryTime int64 `json:"expiryTime"`
ResetDays int `json:"resetDays"`
Enabled bool `json:"enabled"`
}
func (AccountPlan) Validate ¶
func (p AccountPlan) Validate() error
type AppliedReceipt ¶
type BusinessOwnership ¶
type BusinessOwnership struct {
Origin string `json:"origin,omitempty"`
SourceSHA256 string `json:"sourceSha256"`
CaptureSHA256 string `json:"captureSha256"`
PreviousWriterID string `json:"previousWriterId"`
StoppedAt string `json:"stoppedAt"`
CapturedAt string `json:"capturedAt"`
}
BusinessOwnership is sealed with the business data by the one-time offline handover tool after it verifies the final backup and stopped old writer. It records data authority, never current process/route health. The previous writer identity is opaque to the controller, not a host capability contract.
func (BusinessOwnership) Validate ¶
func (o BusinessOwnership) Validate(sourceSHA256 string) error
type ClientChain ¶
type ClientChain struct {
EgressIP string `json:"egressIp,omitempty"`
Relay *ClientChainRelay `json:"relay,omitempty"`
// IPv6SS2022 chains carry separately authorized, exact transport addresses.
// Empty transport fields identify existing IPv4 client chains.
Transport string `json:"transport,omitempty"`
SourceIPv6 string `json:"sourceIpv6,omitempty"`
ServerIPv6 string `json:"serverIpv6,omitempty"`
EntryCertificateID string `json:"entryCertificateId,omitempty"`
LandingCertificateID string `json:"landingCertificateId,omitempty"`
ID string `json:"id"`
AccountID string `json:"accountId"`
EntryID string `json:"entryId"`
EgressID string `json:"egressId"`
Name string `json:"name"`
Port int `json:"port"`
Key string `json:"key"`
Enabled bool `json:"enabled"`
}
ClientChain contains a dedicated user credential, never the server transport key. It is stored only inside the encrypted business material.
func (ClientChain) Validate ¶
func (c ClientChain) Validate() error
type ClientChainRelay ¶
type ClientChainRelay struct {
NodeID string `json:"nodeId"`
CertificateID string `json:"certificateId"`
Transport string `json:"transport,omitempty"`
SourceIPv4 string `json:"sourceIpv4,omitempty"`
ServerIPv4 string `json:"serverIpv4,omitempty"`
SourceIPv6 string `json:"sourceIpv6"`
ServerIPv6 string `json:"serverIpv6"`
Port int `json:"port"`
Key string `json:"key"`
}
ClientChainRelay holds a separate credential for the intermediate hop. As with the final landing credential, it remains encrypted at rest.
type ClientLanding ¶
ClientLanding is a client-only credential owned by one account. Original per-chain configuration stays retained for explicit forward recovery.
type CounterSnapshot ¶
type CounterSnapshot struct {
CredentialID string `json:"credentialId"`
UpBytes int64 `json:"upBytes"`
DownBytes int64 `json:"downBytes"`
}
func ParseXrayUserCounters ¶
func ParseXrayUserCounters(materials []CredentialMaterial, payload []byte) ([]CounterSnapshot, error)
ParseXrayUserCounters accepts the bounded result of Xray's StatsService query. Names are matched against the complete expected name, so an imported user label containing Xray's delimiter remains unambiguous.
func (CounterSnapshot) TotalBytes ¶
func (s CounterSnapshot) TotalBytes() int64
type Credential ¶
type Credential struct {
ID string `json:"id"`
AccountID string `json:"accountId"`
Kind CredentialKind `json:"kind"`
User string `json:"user"`
Identity string `json:"identity"`
EntryID string `json:"entryId"`
EgressID string `json:"egressId,omitempty"`
Enabled bool `json:"enabled"`
}
func (Credential) Validate ¶
func (c Credential) Validate() error
type CredentialKind ¶
type CredentialKind string
const ( NativeCredential CredentialKind = "native" RouteCredential CredentialKind = "route" )
type CredentialMaterial ¶
type CredentialMaterial struct {
Credential Credential `json:"credential"`
ProtocolID string `json:"protocolId"`
HysteriaAuth string `json:"hysteriaAuth,omitempty"`
HysteriaIdentity string `json:"hysteriaIdentity,omitempty"`
}
func (CredentialMaterial) Validate ¶
func (m CredentialMaterial) Validate() error
type DesiredArtifact ¶
type DesiredArtifact struct {
Revision uint64 `json:"revision"`
Config []byte `json:"config"`
ConfigSHA256 string `json:"configSha256"`
}
func BuildDesiredArtifact ¶
func BuildDesiredArtifact(plan XrayPlan) (DesiredArtifact, error)
func BuildDesiredArtifactVersion ¶
func BuildDesiredArtifactVersion(plan XrayPlan, version uint8) (DesiredArtifact, error)
BuildDesiredArtifactVersion verifies persisted entry snapshots using their exact rendering format. Callers creating new desired state use the current version; loading a snapshot never rewrites its bytes, digest or revision.
func (DesiredArtifact) Validate ¶
func (a DesiredArtifact) Validate() error
type EgressPolicy ¶
type EgressPolicy string
EgressPolicy controls the final destination family of native traffic. Fixed routes keep their SOCKS transport and the landing's own egress policy.
const ( EgressAuto EgressPolicy = "auto" EgressIPv4Only EgressPolicy = "ipv4_only" EgressIPv6Only EgressPolicy = "ipv6_only" )
func (EgressPolicy) Validate ¶
func (p EgressPolicy) Validate() error
The zero value keeps automatic family selection, not the host/control-plane resolver. Every native policy uses Glivela's explicit business DNS.
type HysteriaEndpoint ¶
type HysteriaEndpoint struct {
ID string `json:"id"`
EntryID string `json:"entryId"`
InboundTag string `json:"inboundTag"`
ListenPort int `json:"listenPort"`
AdvertiseHost string `json:"advertiseHost"`
AdvertisePort int `json:"advertisePort"`
ServerName string `json:"serverName"`
CertificatePEM string `json:"certificatePem"`
PrivateKeyPEM string `json:"privateKeyPem"`
}
func (HysteriaEndpoint) Validate ¶
func (e HysteriaEndpoint) Validate() error
type ImportAccount ¶
type ImportAccount struct {
Account Account `json:"account"`
SubscriptionTokenFingerprint string `json:"subscriptionTokenFingerprint"`
Credentials []Credential `json:"credentials"`
HysteriaIdentities map[string]string `json:"hysteriaIdentities,omitempty"`
Grants []RouteGrant `json:"grants"`
Usage []UsageMember `json:"usage"`
}
type ImportApplication ¶
type ImportEndpoint ¶
type ImportEndpoint struct {
// PreviousAdvertiseHost authorizes recovery of the latest metadata-only
// subscription address change, without accepting unrelated runtime drift.
PreviousAdvertiseHost string `json:"previousAdvertiseHost,omitempty"`
RealityChanges []RealityTargetChange `json:"realityChanges,omitempty"`
Reality RealityEndpoint `json:"reality"`
Hysteria *HysteriaEndpoint `json:"hysteria,omitempty"`
ServiceID string `json:"serviceId"`
RuntimeCertificateID string `json:"runtimeCertificateId,omitempty"`
RuntimeConfigSHA256 string `json:"runtimeConfigSha256,omitempty"`
TargetIP string `json:"targetIp"`
VLESSEnabled bool `json:"vlessEnabled"`
HysteriaEnabled bool `json:"hysteriaEnabled"`
TotalBytes int64 `json:"totalBytes"`
UsedBytes int64 `json:"usedBytes"`
QuotaAppliedEnabled bool `json:"quotaAppliedEnabled"`
ResetDay int `json:"resetDay"`
ResetSchedule ImportResetSchedule `json:"resetSchedule"`
DesiredRevision uint64 `json:"desiredRevision"`
AppliedRevision uint64 `json:"appliedRevision"`
HistoricalHealthy bool `json:"historicalHealthy"`
PreviousStatus string `json:"previousStatus"`
PreviousError string `json:"previousError"`
LegacyRetired bool `json:"legacyRetired"`
// Retired is the current endpoint policy. LegacyRetired above only
// records retirement of the old implementation, not this endpoint.
Retired bool `json:"retired"`
SourcePeerJSON json.RawMessage `json:"sourcePeer"`
CertificateNotAfter string `json:"certificateNotAfter"`
CreatedAt string `json:"createdAt"`
UpdatedAt string `json:"updatedAt"`
}
ImportEndpoint retains the existing proxy configuration and historical observations. None of PreviousStatus, AppliedRevision or HistoricalHealthy is fresh runtime evidence for the newly enrolled controller.
func (ImportEndpoint) Validate ¶
func (e ImportEndpoint) Validate() error
type ImportLandingSelection ¶
type ImportLandingSelection struct {
NodeIDs []string `json:"nodeIds"`
LandingRegionCodes map[string]string `json:"landingRegionCodes,omitempty"`
LandingNameSuffixes map[string]string `json:"landingNameSuffixes,omitempty"`
RetiringNodeIDs []string `json:"retiringNodeIds,omitempty"`
Revision uint64 `json:"revision"`
}
type ImportMaterial ¶
type ImportMaterial struct {
SubscriptionOrders map[string]SubscriptionOrder `json:"subscriptionOrders,omitempty"`
// Deleted entries remain disabled and retained for identity and accounting history.
DeletedRoutes map[string]bool `json:"deletedRoutes,omitempty"`
DeletedClientChains map[string]bool `json:"deletedClientChains,omitempty"`
ClientLandings map[string]ClientLanding `json:"clientLandings,omitempty"`
ClientChains []ClientChain `json:"clientChains,omitempty"`
SourceSHA256 string `json:"sourceSha256"`
RetainedSource json.RawMessage `json:"retainedSource"`
Endpoints []ImportEndpoint `json:"endpoints"`
References ImportReferences `json:"references"`
Plan ImportPlan `json:"plan"`
SubscriptionTokens map[string]string `json:"subscriptionTokens"`
ProtocolSecrets map[string]string `json:"protocolSecrets"`
HysteriaSecrets map[string]string `json:"hysteriaSecrets"`
ResetSchedules map[string]ImportResetSchedule `json:"resetSchedules"`
TrafficCounters map[string]ImportTrafficCounters `json:"trafficCounters"`
Ownership *BusinessOwnership `json:"ownership,omitempty"`
}
ImportMaterial is one atomic, sensitive handover checkpoint. RetainedSource is immutable migration evidence/history, never a second live configuration source. Do not send this material in a node receipt or publish it in logs.
func OpenImportMaterial ¶
func OpenImportMaterial(sealed, key []byte, snapshotID string) (ImportMaterial, error)
func (ImportMaterial) EffectiveClientChain ¶
func (m ImportMaterial) EffectiveClientChain(c ClientChain) (ClientChain, error)
func (ImportMaterial) Validate ¶
func (m ImportMaterial) Validate() error
type ImportNode ¶
type ImportNode struct {
Name string `json:"name"`
PreviousStatus string `json:"previousStatus"`
ServiceAddress string `json:"serviceAddress"`
PrivateAddress string `json:"privateAddress"`
PeerJSON json.RawMessage `json:"peer,omitempty"`
EgressAddressesJSON json.RawMessage `json:"egressAddresses,omitempty"`
}
type ImportPlan ¶
type ImportPlan struct {
Accounts []ImportAccount `json:"accounts"`
SHA256 string `json:"sha256"`
}
func PlanImport ¶
func PlanImport(accounts []ImportAccount) (ImportPlan, error)
PlanImport validates a complete one-time authority transfer before a caller writes any state. It carries only the subscription-token fingerprint; the caller must move the raw token directly between encrypted stores.
type ImportPublication ¶
type ImportPublication struct {
ServiceID string `json:"serviceId"`
EntryNodeID string `json:"entryNodeId"`
Kind string `json:"kind"`
IngressOwner string `json:"ingressOwner"`
Hostname string `json:"hostname"`
SNIHostname string `json:"sniHostname"`
DNSProvider string `json:"dnsProvider"`
DNSRecordID string `json:"dnsRecordId"`
AccessApplicationID string `json:"accessApplicationId"`
TLSEnabled bool `json:"tlsEnabled"`
DesiredRevision uint64 `json:"desiredRevision"`
AppliedRevision uint64 `json:"appliedRevision"`
PreviousStatus string `json:"previousStatus"`
PreviousError string `json:"previousError"`
ActionRequired bool `json:"actionRequired"`
CleanupPending bool `json:"cleanupPending"`
CleanupAttempt int64 `json:"cleanupAttempt"`
CleanupRetryAt string `json:"cleanupRetryAt"`
CreatedAt string `json:"createdAt"`
UpdatedAt string `json:"updatedAt"`
}
type ImportReferences ¶
type ImportReferences struct {
Nodes map[string]ImportNode `json:"nodes"`
Applications map[string]ImportApplication `json:"applications"`
Services map[string]ImportService `json:"services"`
Publications map[string]ImportPublication `json:"publications"`
LandingSelection *ImportLandingSelection `json:"landingSelection,omitempty"`
}
ImportReferences preserves object identities and display/publication data. PreviousStatus and saved network observations are not current reachability or write authority. No platform credentials/capability matrix are imported.
type ImportResetSchedule ¶
type ImportResetSchedule struct {
NextResetAt string `json:"nextResetAt"`
LastResetAt string `json:"lastResetAt"`
}
Preserve the recorded schedule, not a newly calculated cycle from import time. Strings retain the source timestamp's precision and offset verbatim.
type ImportService ¶
type ImportService struct {
Timezone string `json:"timezone"`
ApplicationID string `json:"applicationId"`
Name string `json:"name"`
DisplayName string `json:"displayName"`
RegionCode string `json:"regionCode"`
Protocol string `json:"protocol"`
ApplicationProtocol string `json:"applicationProtocol"`
ContainerPort int `json:"containerPort"`
HostPort int `json:"hostPort"`
Endpoint string `json:"endpoint"`
PreviousStatus string `json:"previousStatus"`
}
type ImportTrafficCounters ¶
type ImportTrafficCounters struct {
UploadBytes int64 `json:"uploadBytes"`
DownloadBytes int64 `json:"downloadBytes"`
RawUploadBytes int64 `json:"rawUploadBytes"`
RawDownloadBytes int64 `json:"rawDownloadBytes"`
StartedAt string `json:"startedAt"`
ObservedAt string `json:"observedAt"`
WatermarkObservedAt string `json:"watermarkObservedAt"`
}
Directional totals and raw counter watermarks have different meanings from the account quota baseline. Neither may be reconstructed from their sum.
type NativeEntry ¶
type NativeEntry struct {
Material CredentialMaterial `json:"material"`
Protocol ProtocolKind `json:"protocol"`
Link string `json:"link"`
}
type PrivateTransport ¶
type PrivateTransport struct {
Protocol string `json:"protocol,omitempty"`
Key string `json:"key,omitempty"`
PublicAddress string `json:"publicAddress,omitempty"`
}
PrivateTransport belongs only to the entry-to-landing connection. Its key must never be included in public subscriptions or diagnostic output. Empty values describe the retained pre-migration SOCKS configuration, not fallback.
func (PrivateTransport) Endpoint ¶
func (t PrivateTransport) Endpoint(privateAddress string) string
func (PrivateTransport) Validate ¶
func (t PrivateTransport) Validate() error
type ProtocolKind ¶
type ProtocolKind string
const ( VLESSReality ProtocolKind = "vless-reality" Hysteria2 ProtocolKind = "hysteria2" )
func (ProtocolKind) Valid ¶
func (p ProtocolKind) Valid() bool
type PublicSSHPolicy ¶
type PublicSSHPolicy struct {
HostPublicAddresses []string `json:"hostPublicAddresses"`
AddressesComplete bool `json:"addressesComplete"`
}
PublicSSHPolicy decodes the retired optional SSH policy in immutable historical artifacts and exact firewall cleanup only. New desired builders remove it; there is no management API or maintenance command that enables this policy.
func (*PublicSSHPolicy) Clone ¶
func (p *PublicSSHPolicy) Clone() *PublicSSHPolicy
func (*PublicSSHPolicy) RequireHost ¶
func (p *PublicSSHPolicy) RequireHost(value string) error
RequireHost catches omissions of already-known public literals. Hostnames and private NAT interfaces do not prove a complete external mapping.
func (*PublicSSHPolicy) Validate ¶
func (p *PublicSSHPolicy) Validate() error
type PublishedClientChain ¶
type PublishedClientChain struct {
Chain ClientChain
Base NativeEntry
Server string
EgressRegionPrefix string
EgressNameSuffix string
}
type PublishedRoute ¶
type PublishedRoute struct {
Grant RouteGrant `json:"grant"`
Protocol ProtocolKind `json:"protocol"`
EntryName string `json:"entryName"`
EgressNameSuffix string `json:"egressNameSuffix,omitempty"`
EgressRegionPrefix string `json:"egressRegionPrefix,omitempty"`
IPv4EgressRegionPrefix string `json:"ipv4EgressRegionPrefix,omitempty"`
BaseLink string `json:"baseLink"`
RouteLink string `json:"routeLink"`
BaseProtocolIdentity string `json:"baseProtocolIdentity"`
RouteProtocolIdentity string `json:"routeProtocolIdentity"`
}
type PublishingMode ¶
type PublishingMode string
const FixedMode PublishingMode = "fixed"
func (PublishingMode) Valid ¶
func (m PublishingMode) Valid() bool
type QuotaProjection ¶
type QuotaProjection struct {
UsedBytes int64 `json:"usedBytes"`
Enabled bool `json:"enabled"`
Gates []AccessGate `json:"gates"`
}
func ProjectQuota ¶
func ProjectQuota(plan AccountPlan, members []UsageMember) (QuotaProjection, error)
ProjectQuota computes one account-wide usage value and projects only an on/off gate to each credential. It never splits the remaining quota between credentials, which would duplicate the plan or rewrite Xray on every sample.
type RealityEndpoint ¶
type RealityEndpoint struct {
ID string `json:"id"`
EntryID string `json:"entryId"`
InboundTag string `json:"inboundTag"`
ListenAddress string `json:"listenAddress"`
ListenPort int `json:"listenPort"`
AdvertiseHost string `json:"advertiseHost"`
AdvertisePort int `json:"advertisePort"`
Target string `json:"target"`
ServerNames []string `json:"serverNames"`
PrivateKey string `json:"privateKey"`
PublicKey string `json:"publicKey"`
ShortIDs []string `json:"shortIds"`
Fingerprint string `json:"fingerprint"`
}
func (RealityEndpoint) Validate ¶
func (e RealityEndpoint) Validate() error
type RealityInitialRepair ¶
type RealityInitialRepair struct {
CertificateID string `json:"certificateId"`
ConfigSHA256 string `json:"configSha256"`
EvidenceSHA256 string `json:"evidenceSha256"`
VerifiedAt string `json:"verifiedAt"`
}
RealityInitialRepair records an administrator attestation, not a node receipt or public-client acceptance. The full evidence stays outside business state.
type RealityTargetChange ¶
type RealityTargetChange struct {
InitialRepair *RealityInitialRepair `json:"initialRepair,omitempty"`
RevertedAt string `json:"revertedAt,omitempty"`
Reason string `json:"reason,omitempty"`
PreviousTarget string `json:"previousTarget"`
PreviousTargetIP string `json:"previousTargetIp"`
PreviousServerNames []string `json:"previousServerNames"`
Target string `json:"target"`
TargetIP string `json:"targetIp"`
ServerName string `json:"serverName"`
State string `json:"state"`
ChangedAt string `json:"changedAt"`
EvidenceSHA256 string `json:"evidenceSha256,omitempty"`
VerifiedAt string `json:"verifiedAt,omitempty"`
}
RealityTargetChange retains only fields needed for forward recovery. It never snapshots account secrets, quotas or traffic ledgers.
type RouteGrant ¶
type RouteGrant struct {
ID string `json:"id"`
AccountID string `json:"accountId"`
EntryID string `json:"entryId"`
EgressID string `json:"egressId"`
IPv4EgressID string `json:"ipv4EgressId,omitempty"`
InboundTag string `json:"inboundTag"`
Base Credential `json:"base"`
Route Credential `json:"route"`
Mode PublishingMode `json:"mode"`
Enabled bool `json:"enabled"`
HideNative bool `json:"hideNative"`
DesiredRev uint64 `json:"desiredRevision"`
AppliedRev uint64 `json:"appliedRevision"`
RuntimeGood bool `json:"runtimeHealthy"`
}
func (RouteGrant) Deployable ¶
func (g RouteGrant) Deployable() bool
Deployable reports whether the desired grant belongs in the next Xray projection. AppliedRev and RuntimeGood describe the previous receipt, so they deliberately do not gate creation of a newer desired configuration.
func (RouteGrant) Publishable ¶
func (g RouteGrant) Publishable() bool
Publishable follows configured authorization; runtime observations are advisory.
func (RouteGrant) Validate ¶
func (g RouteGrant) Validate() error
type RoutePeer ¶
type RoutePeer struct {
Transport PrivateTransport `json:"transport,omitzero"`
EgressID string `json:"egressId"`
Address string `json:"address"`
Port int `json:"port"`
ExitFamily EgressPolicy `json:"exitFamily,omitempty"`
Ready bool `json:"ready,omitempty"`
}
type SubscriptionItem ¶
type SubscriptionItem struct {
ID string `json:"id"`
Kind string `json:"kind"`
Name string `json:"name"`
Protocol ProtocolKind `json:"protocol"`
}
SubscriptionItem identifies an actual selectable output without its credential.
func RenderMihomo ¶
func RenderMihomo(entries []NativeEntry, accountID string, mode PublishingMode, routes []PublishedRoute, order []string, chains ...PublishedClientChain) ([]byte, []SubscriptionItem, error)
type SubscriptionOrder ¶
type SubscriptionOrder struct {
Revision uint64 `json:"revision,string"`
IDs []string `json:"ids"`
}
SubscriptionOrder is presentation-only account data in the encrypted business source. Its revision is independent of node configurations and traffic.
func (SubscriptionOrder) Validate ¶
func (o SubscriptionOrder) Validate() error
type UsageMember ¶
type UsageMember struct {
CredentialID string `json:"credentialId"`
Baseline int64 `json:"baseline"`
Observed int64 `json:"observed"`
Active bool `json:"active"`
}
func ObserveUsage ¶
func ObserveUsage(members []UsageMember, counters map[string]int64) ([]UsageMember, error)
func ResetUsage ¶
func ResetUsage(members []UsageMember) []UsageMember
type XrayPlan ¶
type XrayPlan struct {
PublicSSH *PublicSSHPolicy `json:"publicSSH,omitempty"`
Revision uint64 `json:"revision"`
NativeEgress EgressPolicy `json:"nativeEgress,omitempty"`
RealityEndpoints []RealityEndpoint `json:"realityEndpoints,omitempty"`
HysteriaEndpoints []HysteriaEndpoint `json:"hysteriaEndpoints,omitempty"`
Credentials []CredentialMaterial `json:"credentials"`
Grants []RouteGrant `json:"grants"`
Peers []RoutePeer `json:"peers"`
}
Source Files
¶
- business_ownership.go
- client_chain.go
- composite.go
- composite_xray.go
- deployment.go
- doc.go
- egress.go
- import_account_state.go
- import_endpoint.go
- import_material.go
- import_references.go
- link.go
- migration.go
- model.go
- private_transport.go
- public_ssh.go
- quota.go
- reality_target.go
- subscription.go
- subscription_order.go
- xray.go
Directories
¶
| Path | Synopsis |
|---|---|
|
cmd
|
|
|
glivela
command
Glivela owns node communication; the installer only supplies bootstrap files.
|
Glivela owns node communication; the installer only supplies bootstrap files. |
|
Package control implements Glivela's direct, authenticated node channel.
|
Package control implements Glivela's direct, authenticated node channel. |
|
internal
|
|
|
Package ipquality defines the bounded, public subset of an IPQuality report.
|
Package ipquality defines the bounded, public subset of an IPQuality report. |
|
Package landing contains the node-local boundary for optional SOCKS5 egress.
|
Package landing contains the node-local boundary for optional SOCKS5 egress. |
|
tools
|
|
|
alpine-acceptance
command
Isolated native-runtime acceptance fixture.
|
Isolated native-runtime acceptance fixture. |