glivela

package module
v0.1.0-alpha.74 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 28, 2026 License: Apache-2.0 Imports: 26 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

Petauron Glivela

The Vastora panel access flow opens the independent Glivela panel directly. See also node network optimization.

For existing entry target/SNI changes and forward cancellation, see REALITY target changes.

Public SSH requires an explicit protected host-address inventory; see public SSH egress configuration for the source-only implementation and its verification/deployment boundaries.

Current route lifecycle: startup-only readiness. This supersedes the historical periodic-health lease behavior described below.

For native entry-to-landing public SS2022, see the public data-path cutover procedure. Management identities remain on the private network; public listeners accept only explicitly assigned source addresses and retain the existing egress policy.

Landing ownership migration (#54, in progress)

For per-node retained cutover acceptance and old-writer retirement, follow the landing handover procedure. Its acceptance step uses the existing full route inventory and never deletes retained old data. Explicit temporary availability can defer a known exhausted/maintenance source without deleting its authorization or claiming that its route passed. Recovery requires fresh evidence.

The target boundary is a Glivela controller communicating directly with a Glivela node process. Glivela owns proxy configuration, component compatibility, migration and business health. Vastora installs, updates and uninstalls the application; it is not a command broker for this channel. No generic host hook or application capability negotiation is introduced.

control/ implements the first isolated part of this migration: mutually authenticated HTTPS exchanges, certificate-bound node isolation, revision/hash receipts, private durable controller state and bounded node reconciliation. It uses Go's TLS/HTTP implementation and existing Glivela artifact contracts. Certificate enrollment is a Glivela management operation, not a node API. Run only one controller per state directory; use a private, operator-owned directory and independently provisioned CA/server/node identities.

cmd/glivela now supplies controller/node modes from a private bootstrap JSON file. Both hold a kernel-backed exclusive state-directory lease. The node uses the native runtime journal and the hash-pinned Xray/systemd adapter, validating before activation, preserving revisioned configuration backups and recovering an interrupted or failed activation before polling. A failed health check of an unchanged revision does not restart the service. The controller bootstrap contains transport/storage settings and an administrators list of SHA-256 leaf-certificate fingerprints. It does not contain node business state. Existing nodes.json remains authoritative across restarts; the obsolete bootstrap nodes field is rejected, not replayed over managed updates.

The offline legacy importer accepts reviewed Center schemas 113–116 and 120, including native glivela-entry references and pilot process-counter baselines without changing account ledgers or identities.

For a staged legacy import, controller bootstrap must also reference its independent raw 32-byte storage key using businessKey (an absolute private file path, never the key contents). Controller startup decrypts and validates the complete business.pending.json under the existing directory lease before opening its listener. A missing/wrong/unsafe key or corrupt checkpoint aborts startup instead of creating an empty inventory. Node and verifier bootstraps cannot select a business key. With no checkpoint and no key, a new controller starts empty. Loading does not rewrite the checkpoint or activate subscriptions.

An enrolled administrator can POST {} to /v1/admin/business on the same private mTLS listener to inspect the original accounts, reset schedules, quota watermarks, directional counters and endpoint/node bindings. This detached view excludes protocol secrets, subscription tokens, private keys and the raw source archive. 64-bit quota, revision and traffic values use decimal strings in this API to avoid browser-number rounding; persisted typed values remain unchanged. Staged data remains awaiting-handover: historical status and successful decryption do not prove that the old business writer is fenced, that final usage is reconciled, or that all routes passed. This read-only slice is not the complete business UI/API replacement or permission to clear migration/health alerts.

The separate one-time offline tool can commit data ownership from the final stopped-writer snapshot (adopt-final; see its README). It creates encrypted business.json as the sole current business source while retaining the staged checkpoint only for private recovery. The controller reports owned-unverified, not ready/healthy. Owned-state corruption never falls back to staging, and reimport cannot overwrite owned accounts or ledger values. This does not yet complete the runtime/business UI migration or authorize restoring an old proxy writer; runtime acceptance and removal of replaced paths remain required.

The controller may configure a separate subscriptionsListen private HTTP origin behind the installer's existing generic HTTPS ingress. It never shares the node/admin mTLS listener or accepts forwarded administrative identities. Wildcard/public origins, node/verifier mode and a missing controller business key are rejected. Failure of either listener stops the pair. The only public application route is GET/HEAD /sub/{original-token}; base64 links and ?target=clash/?format=mihomo preserve the original credential identities and shared account quota header. Responses and failures are non-cacheable and do not log tokens or internal configuration.

Staging alone cannot publish. Owned subscriptions require enabled, unexpired, unexhausted accounts, active credentials, exact applied entry configuration and fresh runtime evidence. Routed credentials additionally require the matching fresh peer lease and an independent, current route check bound to this owned snapshot and configured target/exit. Unrelated failed entries do not hide a verified route. Hidden-native policy never falls back to publishing the direct credential when the double hop is unavailable. Downloads do not rewrite quota, reset cycles, history or ownership. This is the Glivela-owned download path, not complete live business mutation/UI, external DNS/ingress acceptance, catalog publication, traffic collection or final installed handover evidence.

An enrolled administrator can POST /v1/admin/account-plan with accountId, expectedRevision (decimal string) and a complete plan containing totalBytes/expiryTime (decimal strings), resetDays and enabled. A staged import cannot accept edits. Optimistic revision checks reject conflicting stale writers; an identical lost-response retry neither reseals data nor increments revisions again. This operation preserves the original subscription/protocol identities, ledger baselines, current reset schedule, immutable history and ownership. Changing reset-days does not silently restart the current imported cycle.

The encrypted owned business file is the single source of account policy. Known enrolled entry configurations are derived from it on save, startup and authenticated node exchange; unknown identities are refused, not overwritten. Quota/expiry/enable gates affect only that account's authentication users; disabled grants retain their original private peer/route identity for a later explicit re-enable but are absent from active Xray routes. No client identity is regenerated. Unchanged effective configurations do not restart nodes.

If saving business succeeds but persisting a derived node plan fails, the API returns failure, preserves the newer owned data and resumes projection on retry or restart. It never replays the old staged snapshot. Independent authenticated read-back resolves a write whose rename may have succeeded before an error; unknown external changes fence further business publication/reconciliation until explicit recovery. HTTP 202 means saved/reconciling, not successful route acceptance. entry-runtime-verified is scoped to independently reported entry application only; old account applied revisions and route alarms are not manufactured as successful by this API. Actual worker authentication denial, traffic collection/reset execution and the complete management UI remain separate acceptance requirements.

On the same private mTLS listener, a separately authorized management identity can POST /v1/admin/landings with id, certificateId, plan and routeEntries (entry ID to {certificateId,address}). A configured entry inventory must cover every exact source in the landing plan, with distinct entry certificates. Provisioning without that inventory cannot pass route acceptance. Glivela validates the plan and generates the exact Xray artifact itself. The response is HTTP 202 with revision and configSha256, not a health success. Node identities cannot use management endpoints; management identities cannot submit node or verifier reports. This API is not yet a replacement business UI or a complete legacy-data importer.

The same administrator can POST /v1/admin/entries with id, certificateId, a Glivela XrayPlan as plan, and explicit network policy. Here id is the existing entry application ID; its physical host relationship stays in the business references. Exactly one entry application may appear in its endpoints, credentials and grants. REALITY private/public keys must form the same X25519 pair. The controller renders and binds the configuration/revision itself; arbitrary standalone core configuration is not accepted. Entry and landing plans are mutually exclusive, and an enrolled identity cannot silently change role. Entry certificates may also verify that same entry, but cannot obtain another node configuration or administrative access. Rotation updates the linked verifier identity atomically and invalidates route proofs. Desired entry configuration is sensitive: keep the private nodes.json and runtime journals out of public logs and artifacts.

network is an EntryNetwork, not a platform capability description. A pure native entry supplies an empty object and does not need a private-link monitor. A routed entry supplies its recorded private source identity and exactly the peers used by its routes (including an existing composite route's second exit). Each peer binds egressId separately from its private node ID/key/address, plus a controlled HTTPS target and public expectedExit. The actual SOCKS address and port must agree with the generated plan; duplicate, missing, unrelated, self-targeting or wrong-family peers are rejected. No identity is inferred from an IP or a display name. These records still require fresh node-local evidence before any gate may open.

Changes to source/peer identity, probe target or expected exit require a new revision even when the Xray configuration bytes/hash are unchanged. A previous runtime receipt cannot acknowledge that new policy; it must go through actual application/verification. Real mTLS/journal regression covers this delivery and deduplication boundary with a test worker, not an actual container or gate.

Entry desired state can now use the direct channel and the shared revision/ recovery journal. Installed entry takeover and integration are still incomplete. The existing node bootstrap uses the native landing/systemd driver, which explicitly refuses entry plans before service start/stop. Do not deploy an entry enrollment through that driver or claim these tests prove container takeover. Entry execution must retain the current Docker read-only mount/user/network ownership and peer firewall boundaries; it must not become an easier native replacement or a blind container restart. In particular, actual 26.7.28 post-resolution/address-family enforcement still needs installed acceptance; successful parsing does not prove that newer JSON options are honored.

The Glivela-owned landing.TrafficGate and Monitor preserve peer-scoped runtime fencing for host-GID and retained-bridge entry containers. Each new revision starts closed. Only fresh, identity-bound direct transport checks around a successful business probe for the exact expected exit can renew a 15-second maximum kernel lease. Cancellation, failed checks and expired proof close that peer only; the monitor has no shared Xray process lifecycle methods. Xray UDP relay ports are per-association, so UDP fencing binds the dedicated runtime GID/bridge and exact private peer rather than Dante's old fixed range. Policy read-back, expiry, closed-revision cleanup and unrelated-peer preservation are tested separately. The configuration driver below now uses these primitives; the installed boot fence and complete entry acceptance still do not authorize deployment.

Native entry Freedom outbounds use the pinned core's own ForceIP strategy (ForceIPv4/ForceIPv6 for explicit family policy), not a socket-only strategy whose earlier preflight can still use host DNS. Business DNS is tagged and scoped to 1.1.1.1/1.0.0.1 port 53 through a separate closed resolver outbound; the host/control-plane resolver is not changed. Existing composite selection's local DoH policy remains separate. Final destination rules block reserved/ private IPs and the disallowed literal/resolved family without an allow bypass. These features exist in 26.7.28; a later-version comment is not capability proof.

The isolated native-core fixture deliberately gives system hosts a private answer while the business resolver returns the public test target. It exercises actual resolver queries, public-to-private rebinding and public recovery in the same worker, plus domain/literal family controls. This is native-core policy acceptance, not installed Docker/UID/firewall/boot or application UDP proof. Inspect the exact-head CI result rather than treating unit JSON assertions or macOS cross-compilation as execution of these Linux-only cases.

control.EntryContainer adds read-only ownership checks for the new owned entry profile: immutable full container/image IDs, the pinned official image, exact command/entrypoint/environment, a single read-only private config mount, minimal capabilities and private PID/IPC isolation. Host mode binds the dedicated GID; retained bridge mode binds the exact network ID and bridge name, not a reusable display name. Inspection uses only the fixed local Docker socket, with bounded output/time and no inherited Docker context or diagnostic dumps. Old Vastora labels do not count as ownership. This read-only type is not itself a legacy adopter; frozen inventory conversion and installed takeover remain. The current tests mutate anonymous inspect snapshots; they do not create a real container or prove actual installed Docker acceptance.

control.EntryDriver implements configuration activation/stop/observation for one already-owned container behind the durable runtime journal. Candidate core validation and unknown-config rejection precede mutation intent. The worker gets a separate private read-only config directory with its existing UID, never the node's journal/backups. Failed or interrupted activation restores the previous journaled config into that mount. This does not create/adopt containers or replace images; those resource transitions remain unfinished.

Readiness code checks the mounted config through the actual PID, its UID/GID, no-new-privileges/capability status and exact TCP/API/authorized-UDP listener inodes held by that process. It rechecks Docker process identity afterwards. Unchanged core/transport can resume monitoring after a node-program restart or probe-only update without stopping Xray. Ordinary peer probe failure closes only that peer. Fatal gate-ownership loss instead quarantines the exact owned worker without an automatic restart; unknown firewall policy is never repaired by health polling.

Local recovery tests use real files/journals with simulated Docker/process acceptance. Linux namespace CI additionally exercises real gates with simulated Docker/private-link failure and verifies unchanged-worker resume. These do not prove real container or successful-route acceptance. RuntimeReady describes the owned process/gates/monitor liveness, not all peers being reachable. Private source checks surround business probes. Direct authenticated observations carry the complete assigned peer inventory and conservative kernel lease deadlines. Controller acceptance requires both the matching fresh peer proof and a separate current route challenge; process readiness alone cannot clear a route warning. Health transitions rotate only that entry's challenge, preserving unrelated entries on a shared landing. Snapshot timestamps and a persisted controller watermark reject delayed old success after failure; synchronized node/controller clocks are required and future reports fail closed. Pre-cutover checks for newly enabled peers, image replacement, installer/boot integration and actual native destination/ family safety acceptance remain required before exposing this driver via CLI.

The verifier mode runs on an enrolled entry using its own private bootstrap, state-directory lease and mTLS identity. It polls /v1/route-checks, performs one bounded SOCKS/TLS/observed-exit check at a time, and reports success or failure directly to Glivela. It cannot enroll nodes, listen for commands or control Xray. Management can POST the complete checks batch to /v1/admin/route-checks, then POST landingId, snapshotId, revision and configSha256 to /v1/admin/route-acceptance for a read-only decision. These checks must match the independently enrolled entry inventory in full; submitting only passing entries or reusing one entry certificate for another is refused. Changing the enrolled inventory invalidates the old route proofs. These endpoints do not commit a migration or remove backups. Each retry has a new attempt ID; reports are bound to that attempt, snapshot, entry certificate, landing and desired revision/hash. Completed reports are durable, and a lost acknowledgement does not cause the entry to repeat a completed attempt. This channel does not by itself complete legacy ownership transfer or authorize clearing a runtime-health alert.

Once an entry is enrolled as an owned runtime, route acceptance also requires its current applied receipt. Diagnostics may still test a reachable route while that receipt is missing: network observations are not blocked or promoted to runtime success. Entry configuration/certificate changes and readiness transitions invalidate linked route proofs, so a check performed before a new entry configuration was applied cannot later clear its warning.

landing/ renders the official Xray 26.10.21 SOCKS configuration and dedicated UID-scoped nftables policy from one explicit plan. The node channel binds this plan to the exact configuration digest. The runtime journals both together, stops the worker during rule replacement, installs/read-backs the new rules before starting, and retains the previous complete plan for recovery. Changes to the local worker UID or mesh interface require explicit handover. Only exact authorized mesh sources are granted access; TCP-only grants stay TCP-only.

Local readiness checks the service and rules; it does not mean an end-to-end route passed. The local process is not allowed to bypass source restrictions to probe its own SOCKS listener. Authorized entry-side route acceptance is still required before exposing a route as healthy.

On a Linux landing host, the root-only local preparation command glivela backup-legacy-landing -node-id <existing-id> -directory <private-directory> reads only the fixed previous managed installation and writes a fresh recovery checkpoint into an existing private directory. It validates ownership and file digests, retains the exact recovery executable, then reopens and verifies the checkpoint and compares it with the current source. Its JSON result is explicitly backup-only, never a migration or health success. It does not stop services, change firewall rules, fence writers or activate Xray. Failed partial checkpoints are retained for diagnosis. The private output path and checkpoint contents must not be published. A subsequent cutover still requires a writer fence and fresh validation; this read-only source snapshot is not that fence.

The root-only offline command glivela switch-legacy-landing -config <node-bootstrap> -node-id <existing-id> -checkpoint <snapshot.json> requires an unused native runtime and a persistently stopped/masked old Agent. It revalidates the backup, exact old firewall, source/interface policy, installed candidate service and official Xray configuration before stopping Dante. A durable pending record precedes service changes. The old service is disabled for boot, its exact firewall is withdrawn, and the native runtime activates the candidate. Failure attempts bounded recovery through the retained executable; failed recovery retains its pending record. Node startup handles interrupted first switches before normal runtime recovery. A rolled-back switch blocks automatic retries. The command returns awaiting-routes; later revisions remain blocked until complete-legacy-landing verifies the current runtime and all required entry routes through the landing's authenticated controller channel. The supporting Vastora release must then retire the old landing execution authority before its Agent can resume. Follow the per-node handover procedure; preserve old data and backups, and do not treat compilation or process readiness as deployment proof.

The signed native package must provision the dedicated Xray unit and its enforced firewall dependency; this code refuses an unknown unit rather than installing an unsafe substitute. The optional official-binary test verifies actual Xray configuration validation and SOCKS/TLS forwarding on loopback, including certificate rejection and HTTP 404 handling. Runtime recovery tests use a fake systemd driver. Real Linux nftables lifecycle tests cover IPv4/IPv6 install/read-back/remove, idempotence, drift rejection and unrelated-table preservation in an isolated network namespace, and run in CI. Packet-level enforcement tests additionally cover actual rendered IPv4/IPv6 DNS/TLS policy and literal-IPv4 SOCKS UDP request/reply, target-observed egress and source/UID denials with the official core. Full migration systemd recovery, QUIC and independent kernel ingress isolation for dynamic UDP sockets remain unaccepted. Do not declare a migration complete or close #54 based on these tests. Each selected host still requires real runtime and route acceptance before proceeding.

Formerly Meridian. See the in-place brand migration for stable installation identities and coordinated release steps.

Glivela is Petauron's access and subscription domain for managed proxy entries. It owns account plans, stable access credentials, route grants, shared usage accounting, and deterministic subscription rendering.

Glivela is not a general-purpose proxy panel and does not fork 3x-ui. Vastora remains the desired-state control plane and its Agent remains responsible for validating and atomically applying Xray configurations on managed nodes. Glivela supplies the authoritative, runtime-independent domain rules that both sides share.

Product boundary

  • Vastora deploys applications, selects nodes, authorizes operations, and records desired/applied revisions.
  • Glivela defines accounts, credentials, route grants, shared quotas, and subscription output.
  • Vastora Agent applies the resulting Xray identities and routes, reports monotonic counters, and confirms runtime health.
  • Senulun observes infrastructure health.

There is one writer for each credential. A migration may import an existing 3x-ui identity once, but released runtime code must not retain dual reads, dual writes, aliases, or a 3x-ui fallback after cutover.

Protocol scope

The first complete vertical slice supports managed VLESS/REALITY and native Hysteria2/TLS entries, VLESS fixed entry-to-egress route credentials, conventional base64 subscriptions, Mihomo YAML, and one shared account quota across both protocols and all route credentials. A native Glivela credential owns a VLESS UUID and, when Hysteria2 is enabled for the entry, a separate Hysteria2 authentication secret. Both runtime clients use the same Xray user label, so their counters contribute to the same account ledger instead of creating a second account or quota. Routed credentials remain VLESS-only: current Xray Hysteria inbounds do not provide a trustworthy per-user routing boundary, so Glivela never publishes a routed Hysteria credential that could silently escape through the native exit.

Managed VLESS/REALITY entries explicitly reject proxied destination UDP 443 before direct or routed forwarding. TCP HTTPS and other UDP permissions remain unchanged; server-side double-hop routes and client chains remain TCP-only. This policy does not change host-wide firewall rules or Hysteria2 traffic. QUIC-only applications can fail; clients that support TCP fallback may use it. This is not a guarantee against blocking.

Entry snapshots record their rendering version. Pre-policy snapshots without that field retain their exact configuration, digest, revision and receipts; loading them does not silently rewrite execution state or accounting history. They are still checked against the complete owned plan using their original format. Newly created desired states use the UDP 443 policy and follow the normal monotonic revision and node application workflow. Upgrading the controller alone is not proof that existing nodes have applied this policy.

Plain VLESS links cannot express a destination-port rejection policy. Mihomo's Vision behavior also does not imply client-side UDP 443 rejection, so the server enforces it. Glivela does not add a global Mihomo rejection rule to a mixed-protocol subscription or disable all UDP on direct VLESS nodes. See the Xray VLESS documentation and Mihomo VLESS documentation.

The APIs are pure and deterministic so callers can persist state in their own forward-only schema and compare desired output before applying a runtime revision.

Security model

Persisted domain records refer to credential fingerprints and caller-owned encrypted secrets. Xray rendering necessarily receives decrypted protocol credentials, the REALITY private key, and the Hysteria2 TLS key for the duration of one in-process projection; these secret-bearing values must stay in encrypted task/state envelopes and are never included in errors, receipts, or event text. Raw subscription links are accepted only as bounded renderer input and are never suitable for logs. Subscription rendering rejects cross-account routes, duplicate identities, ambiguous names, unsupported transports, and mismatched protocol material.

Core API

  • PlanImport validates and fingerprints a complete one-time authority transfer before callers mutate durable state. A legacy VLESS identity may be preserved across different entries, while duplicate VLESS identities within one entry remain invalid. Hysteria2 authentication identities follow the same boundary: they must be unique inside one entry runtime, while a migrated account may preserve the same authentication secret on independent entries. An empty account inventory is valid when an installation has entry runtimes but no subscribers yet.
  • ProjectQuota applies one shared account allowance across native and routed credentials without splitting or duplicating the allowance.
  • RenderLinks and RenderMihomo produce deterministic subscriptions from applied, healthy route receipts.
  • BuildDesiredArtifact creates a complete Xray candidate and binds it to a revision and SHA-256 digest.
  • VerifyAppliedReceipt prevents a stale or different runtime from being reported as the desired state.
  • ParseXrayUserCounters maps exact Xray user counters back to credential IDs without relying on delimiter splitting.

Vastora's migration adapter rejects legacy per-entry traffic ceilings and per-client simultaneous-IP limits before import. Those policies do not have an equivalent in Glivela's account-wide quota model and current Xray runtime, so they must never be silently weakened during replacement.

Status

This public module is the reusable Glivela domain authority. Vastora is its first control-plane integration and owns persistence, operator APIs, UI, and Agent orchestration; no separate mutable panel or node-side service is part of the architecture. The first release remains in pre-release integration until the forward cutover and runtime receipts have been verified on the managed fleet.

OpenClash client chains

The independent Glivela controller offers two subscription modes. Existing server-forwarded grants retain their credentials and configuration. New client chains select one enrolled entry and one public landing; the account must own a native VLESS credential on that entry. Use the Mihomo subscription format in OpenClash with its Mihomo core. Plain link subscriptions omit client chains.

A client chain adds a dedicated TCP-only aes-256-gcm Shadowsocks listener on the selected landing (allocated from 24000–24999), with a separate random user key and exact enrolled entry-source restriction in both Xray and nftables. The existing server-to-server SS2022 key, listener, sources and egress are preserved. The subscription includes the native VLESS entry dependency and a Shadowsocks proxy referring to it with dialer-proxy; only the completed chain is added to the selector. No relay group, alternate-entry fallback or bandwidth bonding is created. Client-chain names use the same landing-region, configured landing label (for example 家宽, otherwise 双跳), and compact entry name as server routes, followed by ·链 to distinguish them from retained server-forwarded routes (for example 🇺🇸 美国|家宽·MX-CN2①·链). Display names omit internal IDs and verbose transport descriptions. Only remaining name collisions receive a short numeric suffix; dependency names and dialer-proxy references are generated together. Shared entry credentials reuse one dependency.

The encrypted owned business ledger stores chains. Disabling a chain removes its listener; disabling/expiring/exhausting its account also removes listeners through the existing reconciliation. Traffic is counted at the existing native entry credential, once, not again at the landing. Cached client configurations must be refreshed after changes. Enabling a saved chain reuses its own retained credential, never another account's or the server transport credential.

Upgrade participating Glivela programs before configuring a chain. This UI requires completed independent business ownership, like the existing account and route controls. Only already enrolled public landing sources are eligible; this feature does not add nodes, change source NAT, open provider firewalls or modify host-owned firewall tables. The provider/host policy must permit the allocated TCP port from that same exact source. Configuration and listener readiness do not prove client connectivity: verify an actual Mihomo HTTPS request and the intended exit before treating a new combination as usable. Existing service-forwarded routes continue to be generated independently.

Entry-to-landing latency

The independent route configuration page shows TCP connection latency from the entry to each enrolled landing endpoint, separately from TLS/HTTP route acceptance. Opening the visible page requests three bounded TCP connects per entry/landing/port; the page requests a new sample every 60 seconds and supports manual refresh (shared 10-second minimum interval). It polls for results without duplicating measurements per account, and stops requests when hidden or unmounted. New route selectors show the enrolled transport port's reference latency; existing client chains measure their own dedicated listener port. IPv4 alternative landings have separate measurements.

The entry polls one diagnostic at a time through its existing mTLS connection. Each connect times out after two seconds. Only current, certificate-bound enrolled IP/port pairs can be assigned; administrators cannot submit arbitrary probe destinations. Results are bound to both nodes' current configuration and expire after two minutes. Partial results show the successful sample count; unreachable, offline/paused, measurement-in-progress and stale results are explicit. Latency over 100 ms is marked high. A TCP handshake is not a claim about full proxy latency or bandwidth.

Diagnostics stay in controller memory and are discarded on restart. They do not change desired revisions, proxy processes, firewall rules, route acceptance, subscription publication, identities or traffic accounting. Measurements also cover retained enrolled candidates so an operator can see latency before enabling a route; measurement does not enable a disabled grant. Update the controller and participating entry programs to this feature's release before expecting results. Landing programs need no diagnostic update. Release/catalog publication and production upgrades remain separate operations.

手动公网线路测速

独立控制面板的公网直连 / 公网 SS2022 iperf3 TCP 对比及其临时执行边界见手动线路测速(#138;源码实现,尚未验收或部署)。

Panel design

The current UI redesign specification and concept references are in Glivela panel design (#163). This is an isolated development design, not a released or deployed change.

Subscription publication follows configured authorization, independently of connectivity probes and runtime health receipts. Health remains advisory in the business view; explicit suspension, account/quota limits, retired endpoints and configuration/credential/transport ownership checks still apply. See readiness and publication.

IP quality, service unlock evidence and versioned assessments are documented in Independent IP diagnostics, including private offline history import.

Documentation

Overview

Package glivela defines Petauron's runtime-independent account, access, routing, quota, deployment, and subscription rules for managed Xray entries.

Index

Constants

View Source
const (
	MaxIdentifierLength  = 128
	MaxDisplayNameLength = 512
	MaxResetDays         = 3650
)
View Source
const (
	DefaultRealityPort      = 443
	RealityBackendPort      = 10443
	DefaultLandingSOCKSPort = 1080
	XrayAPIListenPort       = 10085
	XrayMinimumClient       = "0.0.0"
)
View Source
const SS2022Method = "2022-blake3-aes-128-gcm"
View Source
const XrayRenderVersion uint8 = 1

XrayRenderVersion identifies the deterministic entry configuration format. Version zero is the persisted format from before the REALITY UDP 443 policy.

Variables

This section is empty.

Functions

func CompositePublicIP

func CompositePublicIP(address netip.Addr) bool

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 Identity

func Identity(secret string) string

func LinkForCredential

func LinkForCredential(endpoint RealityEndpoint, material CredentialMaterial, name string) (string, error)

func PublicTransportIPv4

func PublicTransportIPv4(value string) bool

PublicTransportIPv4 permits a single canonical unicast endpoint, never a subnet, wildcard, private management address or DNS-dependent destination.

func RenderLinks(entries []NativeEntry, accountID string, mode PublishingMode, routes []PublishedRoute, encoded bool) ([]byte, error)

func RenderMihomo

func RenderMihomo(entries []NativeEntry, accountID string, mode PublishingMode, routes []PublishedRoute, chains ...PublishedClientChain) ([]byte, error)

func RenderXrayConfiguration

func RenderXrayConfiguration(plan XrayPlan) ([]byte, error)

func RouteUser

func RouteUser(grantID string) string

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 SubscriptionTokenFingerprint

func SubscriptionTokenFingerprint(token string) string

func ValidIdentifier

func ValidIdentifier(value string) bool

func ValidIdentity

func ValidIdentity(value string) bool

func ValidateCompositeExitPair

func ValidateCompositeExitPair(ipv6, ipv4 RoutePeer) error

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 AccessGate struct {
	CredentialID string `json:"credentialId"`
	Enabled      bool   `json:"enabled"`
}

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"`
}

func (Account) Validate

func (a Account) Validate() error

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 AppliedReceipt struct {
	Revision     uint64 `json:"revision"`
	ConfigSHA256 string `json:"configSha256"`
	RuntimeReady bool   `json:"runtimeReady"`
}

type BusinessOwnership

type BusinessOwnership struct {
	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 {
	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 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 ImportApplication struct {
	Name           string `json:"name"`
	NodeID         string `json:"nodeId"`
	Runtime        string `json:"runtime"`
	PreviousStatus string `json:"previousStatus"`
}

type ImportEndpoint

type ImportEndpoint struct {
	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 {
	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) 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 is operator-owned node configuration. Completeness is an explicit inventory assertion, never inferred from DNS or an exit-IP probe. A missing policy leaves TCP 22 blocked; this enables no other port or UDP.

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 RealityTargetChange

type RealityTargetChange struct {
	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 endpoint fields needed for a forward-revision cancellation. 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"`
}

func (RoutePeer) Validate

func (p RoutePeer) 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"`
}

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.
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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL