Skip to content

Infrastructure Management

ARROW provides comprehensive infrastructure asset tracking and management capabilities for servers, VPS instances, and network equipment.

The infrastructure management system enables organizations to:

  • Track Assets: Maintain inventory of all infrastructure components
  • Monitor Health: Automated health checks and status monitoring
  • Discover Resources: Automatic asset discovery from cloud providers
  • Organize Assets: Assign assets to organizations and projects

ARROW supports tracking various infrastructure asset types:

Asset TypeDescriptionExamples
VPSVirtual private serversHetzner Cloud, cloud instances
Proxy ServerProxy and relay serversSOCKS proxies, HTTP proxies
VPN ServerVPN infrastructureNetBird management servers
Network DeviceNetwork equipmentRouters, switches, firewalls
DatabaseDatabase serversPostgreSQL, MySQL instances
Physical ServerDedicated hardwareBare metal servers

Each infrastructure asset tracks comprehensive metadata:

PropertyDescription
NameDisplay name for the asset
TypeAsset classification (VPS, proxy, etc.)
OrganizationOwning organization
StatusCurrent operational status
ProviderCloud provider or datacenter
PropertyDescription
IP AddressesPublic and private IPv4/IPv6
HostnameDNS hostname
Server TypeInstance type or model
CPU CoresNumber of CPU cores
MemoryRAM allocation (GB)
DiskStorage capacity (GB)
DatacenterPhysical datacenter location
LocationGeographic region
PropertyDescription
Provider IDExternal provider’s asset ID
LabelsTags and categorization
NotesAdministrative notes
Last Health CheckTimestamp of last check

ARROW integrates with Hetzner Cloud for automated asset discovery and management through backend/api/infrastructure/hetzner.go.

The HetznerService provides a Go interface to the Hetzner Cloud API:

MethodDescription
GetServers()Retrieve all servers with pagination
GetServersByLabel(selector)Filter servers by label selector
DiscoverOrganizationAssets()Sync Hetzner servers to infrastructure_assets

The discovery process automatically imports servers from Hetzner Cloud:

flowchart TD
    A[POST /api/infrastructure/assets/discover/hetzner] --> B[Get system_integrations type=hetzner]
    B --> C[Parse API token from config]
    C --> D[Create HetznerService with token]
    D --> E[Call GetServers with pagination]
    E --> F{For Each Server}
    F --> G[Determine asset_type from labels]
    G --> H[Create external_id: hetzner-{id}]
    H --> I{Asset exists by external_id?}
    I -->|Yes| J[Update existing infrastructure_asset]
    I -->|No| K[Create new infrastructure_asset]
    J --> L[Store full metadata as JSON]
    K --> L
    L --> M[Map Hetzner status to ARROW status]
    M --> N[Set organization from labels/config]
    N --> F
    F --> O[Return AssetDiscoveryResult]

Test Hetzner API connectivity before discovery:

Endpoint: POST /api/hetzner/test-connection

Validates API token and returns server count if successful.

Servers are automatically assigned to organizations based on:

  1. Server Labels: Hetzner labels containing organization identifiers
  2. Naming Conventions: Server names following organization patterns
  3. Manual Assignment: Administrator override for edge cases

Discovery captures comprehensive server information:

  • Server Type: Instance size (cx11, cx21, cpx31, etc.)
  • CPU Cores: Virtual CPU count
  • Memory: RAM in GB
  • Disk: Storage in GB
  • Datacenter: Hetzner datacenter code (fsn1, nbg1, hel1)
  • Location: Geographic location name
  • IP Addresses: All assigned public IPs
  • Creation Date: When the server was provisioned

Full Metadata Structure (from HetznerServer type):

{
"hetzner_id": 123456,
"server_type": "cx21",
"cores": 2,
"memory_gb": 4,
"disk_gb": 40,
"datacenter": "fsn1-dc14",
"location": "Falkenstein, Germany",
"image_name": "ubuntu-22.04",
"os_flavor": "ubuntu",
"os_version": "22.04",
"created": "2024-01-15T10:00:00Z",
"labels": {"organization": "acme", "service": "proxy"},
"public_net": {
"ipv4": {"ip": "1.2.3.4"},
"ipv6": {"ip": "2001:db8::1/64"},
"firewalls": []
},
"private_net": [],
"protection": {"delete": false, "rebuild": false},
"volumes": [],
"load_balancers": []
}

Common Hetzner Cloud instance types supported:

TypeCPUMemoryDiskDescription
cx111 vCPU2 GB20 GBEntry-level shared
cx212 vCPU4 GB40 GBStandard shared
cpx314 vCPU8 GB160 GBPerformance shared
cx414 vCPU16 GB160 GBStandard dedicated
ccx132 vCPU8 GB80 GBDedicated AMD

Hetzner server states are mapped to ARROW asset statuses:

Hetzner StatusARROW StatusDescription
runningonlineServer operational
initializingmaintenanceServer starting up
startingmaintenanceServer booting
stoppingofflineServer shutting down
offofflineServer powered off
deletingmaintenanceServer being removed

Asset discovery can be triggered:

  • Manually: Through admin interface
  • Scheduled: Regular automated discovery
  • On Demand: API endpoint for programmatic triggering

The infrastructure management API is implemented in backend/api/infrastructure/handlers.go:

EndpointMethodPermissionPurpose
/api/infrastructure/assetsGETinfrastructure.viewList assets for organization
/api/infrastructure/assetsPOSTinfrastructure.adminCreate new asset
/api/infrastructure/assets/{id}GETinfrastructure.viewGet specific asset
/api/infrastructure/assets/{id}PUTinfrastructure.adminUpdate asset
/api/infrastructure/assets/{id}DELETEinfrastructure.adminDelete asset
/api/infrastructure/assets/discoverPOSTinfrastructure.adminDiscover all assets
/api/infrastructure/assets/discover/hetznerPOSTinfrastructure.adminDiscover Hetzner assets
/api/infrastructure/assets/health-checkPOSTinfrastructure.adminRun bulk health checks
/api/infrastructure/assets/{id}/healthGETinfrastructure.viewGet asset health status
/api/infrastructure/assets/{id}/health-checkPOSTinfrastructure.adminCheck specific asset
/api/infrastructure/assets/{id}/organizationPUTinfrastructure.adminUpdate asset organization
PermissionScopeCapabilities
infrastructure.adminGlobalFull access to all assets
infrastructure.viewGlobalView all assets
infrastructure.organization.createOrgCreate assets in own org
infrastructure.organization.viewOrgView own org assets
infrastructure.organization.editOrgEdit own org assets
infrastructure.organization.deleteOrgDelete own org assets

Access infrastructure assets through the ARROW console:

  1. Navigate to Infrastructure in the sidebar
  2. View the asset list with status indicators
  3. Filter by organization, type, or status
  4. Click an asset for detailed information

The asset detail view shows:

  • Overview: Basic information and status
  • Technical Specs: Hardware and network details
  • Health History: Recent health check results
  • Organization: Assigned organization and project
  • Notes: Administrative notes and documentation

Modify asset information as needed:

  • Reassign Organization: Move asset between organizations
  • Update Status: Manually set operational status
  • Add Notes: Document important information
  • Edit Labels: Modify tags and categorization

Track operational status for each asset:

StatusDescription
OnlineAsset is operational and responding
OfflineAsset is not responding to checks
MaintenanceAsset under scheduled maintenance
UnknownStatus could not be determined

ARROW performs automated health checks on infrastructure assets:

  • Ping Checks: ICMP connectivity verification
  • Port Checks: TCP port availability testing
  • Service Checks: Application-level health verification

Different asset types are checked on specific ports:

Asset TypePorts CheckedDescription
Proxy Servers1080, 8080, 3128, 8888Common SOCKS/HTTP proxy ports
VPN Servers51820, 1194, 443, 4789WireGuard, OpenVPN, HTTPS, NetBird
Web Servers80, 443HTTP/HTTPS
Database5432, 3306PostgreSQL, MySQL

Endpoint: POST /api/infrastructure/assets/{id}/health-check

Performs an immediate health check on the specified asset and returns results.

Each check records:

FieldDescription
TimestampWhen the check was performed
ResultSuccess or failure
Response TimeLatency measurement (ms)
Error MessageDetails if check failed
Ports CheckedList of ports tested
Port ResultsIndividual port availability

Assets can have custom health check settings stored in health_check_config:

{
"enabled": true,
"interval_minutes": 5,
"ports": [80, 443, 8080],
"timeout_seconds": 10,
"failure_threshold": 3,
"notify_on_failure": true
}

Health checks run at configurable intervals:

  • Critical Assets: Every 5 minutes
  • Standard Assets: Every 15 minutes
  • Low Priority: Every 60 minutes

The console displays health status visually:

  • Green: All checks passing
  • Yellow: Degraded performance or warnings
  • Red: Failed checks or offline
  • Gray: Unknown or checks disabled

When setting up Hetzner integration:

  1. Configure API Token: Add Hetzner API credentials
  2. Run Discovery: Trigger initial asset import
  3. Review Assets: Verify discovered assets
  4. Assign Organizations: Map assets to organizations
  5. Enable Monitoring: Configure health checks

Regular discovery keeps inventory current:

  • New Servers: Automatically added to inventory
  • Removed Servers: Marked as offline or deleted
  • Updated Specs: Changes reflected in metadata

When discovery finds conflicts:

  • Duplicate Detection: Matching by provider ID
  • Update vs Create: Existing assets updated, new ones created
  • Manual Resolution: Admin review for edge cases
  • Consistent Naming: Use clear naming conventions
  • Proper Labeling: Apply meaningful labels in Hetzner
  • Organization Assignment: Keep assignments current
  • Documentation: Maintain notes for each asset
  • Enable Checks: Configure health checks for all assets
  • Review Alerts: Respond promptly to failures
  • Trend Analysis: Monitor performance over time
  • Capacity Planning: Use metrics for planning
  • API Token Security: Protect Hetzner API credentials
  • Access Control: Limit who can manage assets
  • Audit Logging: Review asset management activities
  • Regular Review: Periodically audit asset inventory