Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/compassvpn/agent
/ functions
Functions
45 in github.com/compassvpn/agent
⨍
Functions
45
◇
Types & classes
2
↳
Endpoints
7
↓ 11 callers
Function
_prom_label_escape
Escape a value for a Prometheus exposition-format label value. Label values must escape backslash, double-quote, and newline; otherwise an un
xray-config/run.py:14
↓ 7 callers
Function
exec_command
Standardized subprocess execution wrapper.
shared_lib/system.py:26
↓ 6 callers
Function
_river_escape
Escape a value for safe inclusion inside a River double-quoted string. Without this, a stray quote/newline/brace in an interpolated value could
metric-forwarder/common.py:56
↓ 5 callers
Function
is_debug
Single source of truth for the DEBUG flag. Checked here, the lowest-level module, so every other module can share one definition (env var fir
shared_lib/logger.py:8
↓ 4 callers
Method
_interruptible_sleep
Sleep for `seconds`, returns True if shutdown requested.
xray-config/run.py:140
↓ 4 callers
Function
load_env
Reads key-value pairs from an env file, optionally including os.environ.
shared_lib/config.py:8
↓ 3 callers
Function
get_identifier
Retrieves the system identifier from environment variables or config file. Note: Stays in config.py to prevent circular imports with logger a
shared_lib/config.py:92
↓ 3 callers
Function
get_public_ip
Fetches the public IP and optionally country info from multiple providers.
shared_lib/network.py:8
↓ 2 callers
Method
run
(self)
xray-config/run.py:280
↓ 1 callers
Function
_cert_not_after
Return a PEM cert's notAfter (UTC), or None if it can't be determined.
xray-config/config.py:126
↓ 1 callers
Method
_create_cf_records
Internal method to manage Cloudflare DNS records.
xray-config/config.py:198
↓ 1 callers
Function
_generate_wg_keys
Generates a WireGuard private and public key pair using the wg utility.
shared_lib/xray.py:59
↓ 1 callers
Method
_get_domain
Internal method to retrieve domain from Cloudflare API.
xray-config/config.py:169
↓ 1 callers
Function
_make_replica
(inbound_def: Dict[str, Any], replica_index: int, new_port: int)
xray-config/config.py:50
↓ 1 callers
Function
_nginx_location_block
(path: str, xray_port: int, template: str)
xray-config/config.py:83
↓ 1 callers
Function
_resolve_instance_ip
()
metric-forwarder/common.py:16
↓ 1 callers
Method
_setup_routes
(self)
xray-config/run.py:33
↓ 1 callers
Function
csv_to_dict
Converts a CSV file to a dictionary, skipping headers and malformed lines.
shared_lib/system.py:67
↓ 1 callers
Function
generate_config
()
metric-forwarder/common.py:72
↓ 1 callers
Function
generate_vmess_link
Generates a vmess:// link from a configuration dictionary.
shared_lib/xray.py:143
↓ 1 callers
Method
get_config_links
Return formatted config links for active inbounds.
xray-config/config.py:726
↓ 1 callers
Function
get_machine_id
Retrieves the machine ID from the host system.
shared_lib/system.py:8
↓ 1 callers
Method
initialize
Perform all initialization logic. Only executes once.
xray-config/config.py:267
↓ 1 callers
Function
parse_config_link
Parses Xray config links (vmess, vless). Standardized to return 'id' as the primary identifier (consistent across protocols).
shared_lib/xray.py:11
↓ 1 callers
Function
register_warp
Registers a new Warp account with Cloudflare and returns the configuration.
shared_lib/xray.py:79
↓ 1 callers
Method
reload_certs
Bump cert serial so the config watcher detects a change and SIGHUPs xray to reload cert files.
xray-config/config.py:713
↓ 1 callers
Function
start
()
metric-forwarder/alloy.py:7
↓ 1 callers
Method
update_metrics
(self, configs: Dict[str, List[str]])
xray-config/run.py:78
Method
__init__
Initialize instance attributes to hold shared variables.
xray-config/config.py:145
Method
__init__
(self)
xray-config/run.py:25
Method
_has_valid_tls
(inbound_def: Dict[str, Any])
xray-config/config.py:456
Method
background_job
(self)
xray-config/run.py:144
Method
cert_management_job
(self)
xray-config/run.py:223
Method
create_dns_record
(name: str, proxied: bool)
xray-config/config.py:224
Method
dns_record_already_exist
(record_name: str)
xray-config/config.py:202
Method
export_certs
()
xray-config/run.py:50
Method
get_nginx_locations
()
xray-config/run.py:69
Method
get_warps
()
xray-config/run.py:57
Method
get_wg_configs
()
xray-config/run.py:63
Method
get_xray_config
()
xray-config/run.py:35
Method
metrics
()
xray-config/run.py:75
Method
run_acme
(cmd_args: str)
xray-config/config.py:338
Method
substitute_vars
Recursively substitute variables in strings within a nested data structure.
xray-config/config.py:392
Method
valid_configs_route
()
xray-config/run.py:46
Function
write_env
Writes configuration data to an env file, preserving schema order if provided.
shared_lib/config.py:53