basePath: /api/v0/ definitions: api.Error: properties: error: type: string message: description: AuthMessage is an error from Echo framework, particularly from Basic Auth middleware type: string type: object config.BlockedPeer: properties: createdAt: description: Time of adding to config (decline invitation/remove from KnownPeers) type: string displayName: type: string peerId: description: Hex-encoded multihash representing a peer ID type: string type: object config.DNSConfig: properties: disableDNS: type: boolean listenAddress: type: string upstreamDNSAddress: description: |- UpstreamDNSAddress is the public resolver (host:port) that the awl DNS resolver forwards non-.awl queries to. Used as a fallback when the OS exposes no base nameserver, and forced as the sole upstream in VPN gateway client mode so DNS traverses the tunnel and does not leak. On Android the host reads this value to configure VpnService DNS. type: string type: object config.HttpBasicAuthConfig: properties: password: type: string username: type: string type: object config.Invite: properties: alias: description: Alias to give the new peer; single-use invites only, aliases are unique. type: string createdAt: type: string expiresAt: description: |- ExpiresAt is checked against our own clock at redemption time; zero means the invite never expires. type: string id: description: |- ID is a short non-secret identifier, the key in Config.Invites. UI, CLI and logs refer to an invite by it so the token stays out of sight. type: string label: description: Label is an optional human-readable note. type: string maxUses: type: integer revoked: type: boolean token: description: |- Token is the bearer secret embedded in the link. Stored in the clear because the link has to be displayable again. type: string usedCount: type: integer weAllowUsingAsExitNode: description: WeAllowUsingAsExitNode is applied to the new peer's KnownPeer. type: boolean type: object config.KnownPeer: properties: alias: description: User provided name type: string allowedUsingAsExitNode: type: boolean confirmed: description: |- Confirmed means the remote peer keeps us in its KnownPeers: it accepted our invitation or added us itself. Learned from the auth and status exchanges, cleared when the peer declines us. Grants nothing by itself. type: boolean createdAt: description: Time of adding to config (accept/invite) type: string declined: description: |- Declined means the remote peer has blocked us: it declined our invitation or removed us from its peers. type: boolean domainName: description: DomainName without zone suffix (.awl) type: string inviteID: description: |- InviteID marks a peer we let in through one of our invite links (Config.Invites). Non-secret, kept forever: it is what lets the UI say "added via invite X". type: string ipAddr: description: |- IPAddr is our view of the peer's IPv4 address, used for forwarding: set by the user, or on the first status exchange the address the peer announced if it is free in our subnet, otherwise one derived from its peer ID (Config.AllocPeerIPUnlocked). Not changed by later announcements. Empty until the first status exchange. type: string ipAddrV6: description: |- IPAddrV6 is our view of the peer's IPv6 overlay address: the address the peer announced if it is valid in our subnet, otherwise one derived from its peer ID. Assigned once and not changed by later announcements, see Config.AllocPeerIPv6Unlocked. Used only while RemoteIPv6Enabled. type: string lastSeen: description: Time of last connection type: string name: description: Peer provided name type: string peerId: description: Hex-encoded multihash representing a peer ID type: string pendingInviteToken: description: |- PendingInviteToken is the secret from an invite link we are redeeming: we present it in every auth request until the peer confirms us, then it is dropped. Set only on the side that used the link. type: string remoteIPv6Enabled: description: |- RemoteIPv6Enabled is whether the remote peer announces an IPv6 overlay address via the status protocol. IPAddrV6 is kept while it is false, so the peer gets the same address back when it enables IPv6 again. type: boolean remoteVPNGatewayServerEnabled: description: |- RemoteVPNGatewayServerEnabled is the remote peer's VPNGatewayConfig.ServerEnabled as advertised via the status protocol. Combined with AllowedUsingAsExitNode (also from status) it determines whether this peer is currently a valid VPN gateway target for us — see KnownPeer.CanUseAsVPNGateway. type: boolean weAllowUsingAsExitNode: type: boolean type: object config.P2pNodeConfig: properties: autoAcceptAuthRequests: type: boolean bootstrapPeers: items: type: string type: array dhtMode: description: DHTMode defaults to client on Android and auto on other platforms. enum: - auto - client type: string identity: type: string ignoreDefaultBootstrapPeers: description: With this option only BootstrapPeers from config will be used type: boolean listenAddresses: items: type: string type: array name: type: string parallelSendingStreamsCount: type: integer peerId: description: Hex-encoded multihash representing a peer ID, calculated from Identity type: string reconnectionIntervalSec: description: |- Pace of the reconnection rounds, and the first pause before a peer that could not be reached is tried again. Each next pause is twice as long, up to 10 minutes type: integer useDedicatedConnForEachStream: type: boolean type: object config.SOCKS5Config: properties: listenAddress: type: string listenerEnabled: type: boolean password: type: string proxyingEnabled: description: allow using my host as proxy type: boolean username: description: Optional local auth credentials. If both are set, SOCKS5 clients must authenticate. type: string usingPeerID: description: peer that is set as proxy type: string type: object config.UpdateConfig: properties: lowestPriorityChan: type: string trayAutoCheckEnabled: type: boolean trayAutoCheckInterval: type: string updateServerURL: type: string type: object config.VPNConfig: properties: disableVPNInterface: type: boolean interfaceName: type: string ipNet: type: string ipNetV6: type: string mtu: description: |- MTU is the VPN interface's maximum packet size in bytes. An omitted or zero value defaults to 1400 for new configs and 3500 for existing configs. Nonzero values outside the range 1280 to 3500 prevent startup. type: integer type: object config.VPNGatewayConfig: properties: clientEnabled: description: ClientEnabled — route all traffic through GatewayPeerID (client side). type: boolean gatewayPeerID: description: GatewayPeerID — selected gateway peer ID. type: string serverEnabled: description: |- ServerEnabled — this node serves as a VPN gateway for others. Propagated via the status protocol so peers know whether to offer this node as an option in their UI. type: boolean type: object entity.AuthRequest: properties: ipv4Addr: description: |- IPv4Addr is the sender's own awl IPv4 address, as in PeerStatusInfo. It is only a suggestion for the accept form: the address is assigned on the first status exchange. Additive like Token. type: string name: type: string peerID: type: string suggestedIP: description: |- SuggestedIP is the address the peer would get: the one it announced (IPv4Addr) if it is free, otherwise one derived from its peer ID. Empty if the subnet has no free address. type: string type: object entity.AvailableProxy: properties: connected: type: boolean peerID: type: string peerName: type: string type: object entity.AvailableVPNGateway: properties: connected: type: boolean peerID: type: string peerName: type: string type: object entity.BandwidthDebugInfo: properties: byProtocol: additionalProperties: $ref: '#/definitions/entity.BandwidthInfo' type: object total: $ref: '#/definitions/entity.BandwidthInfo' type: object entity.BandwidthInfo: properties: rateIn: type: string rateOut: type: string totalIn: type: string totalOut: type: string type: object entity.ConnectionsDebugInfo: properties: connectedPeersCount: type: integer lastTrimAgo: type: string openConnectionsCount: type: integer openStreamsCount: format: int64 type: integer tcpdials: $ref: '#/definitions/p2p.TCPDialStats' type: object entity.CreateInviteRequest: properties: alias: description: Alias to give the peer that redeems the link. Single-use links only. maxLength: 100 type: string allowUsingAsExitNode: description: AllowUsingAsExitNode lets the new peer use us as an exit node. type: boolean expiresInSeconds: description: |- ExpiresInSeconds: 0 means the invite never expires. A number rather than a duration string, as with ReconnectionIntervalSec; clients parse "24h" on their side. Maximum is 365 days. maximum: 31536000 minimum: 0 type: integer label: maxLength: 100 type: string maxUses: description: 'MaxUses: 0 means the default, 1 (single-use).' maximum: 100 minimum: 0 type: integer type: object entity.DhtDebugInfo: properties: bootstrapPeers: additionalProperties: $ref: '#/definitions/p2p.BootstrapPeerDebugInfo' type: object listenAddress: items: type: string type: array peersWithAddrsCount: type: integer reachability: enum: - Unknown - Public - Private type: string reachableAddrs: items: type: string type: array routingTable: items: $ref: '#/definitions/kbucket.PeerInfo' type: array routingTableSize: type: integer unknownAddrs: items: type: string type: array unreachableAddrs: items: type: string type: array type: object entity.EnableVPNGatewayClientRequest: properties: gatewayPeerID: type: string required: - gatewayPeerID type: object entity.FriendRequest: properties: alias: maxLength: 100 type: string allowUsingAsExitNode: description: 'optional: allow the peer to use us as an exit node' type: boolean ipaddr: description: 'optional: specific IP address for the peer' type: string peerID: type: string token: description: |- optional: token from an invite link (see InviteLink.Token). It is stored with the peer and presented in every auth request until the peer confirms us, which it then does without a manual accept. type: string required: - alias - peerID type: object entity.FriendRequestReply: properties: alias: description: Alias is required to accept; declining takes none. maxLength: 100 type: string allowUsingAsExitNode: description: 'optional: allow the peer to use us as an exit node' type: boolean decline: type: boolean ipaddr: description: 'optional: specific IP address for the peer' type: string peerID: type: string required: - peerID type: object entity.GeneralDebugInfo: properties: uptime: type: string version: type: string type: object entity.InviteResponse: properties: alias: type: string allowUsingAsExitNode: type: boolean createdAt: type: string expiresAt: description: ExpiresAt zero means the invite never expires. type: string id: type: string label: type: string link: description: |- Link is rebuilt on every request from the current node name, so renaming this node changes the link shown here while links already handed out keep working — the name plays no part in validation. type: string maxUses: type: integer revoked: type: boolean status: description: Status is derived from the fields above for display. enum: - active - expired - used_up - revoked type: string usedCount: type: integer type: object entity.KnownPeerReconnectInfo: properties: eager: description: Eager peers are tried every round, whatever NextAttemptIn says type: boolean failures: description: Failures in a row type: integer lastAttemptAgo: type: string lastError: type: string nextAttemptIn: description: NextAttemptIn is zero when the peer is to be tried on the next round type: string type: object entity.KnownPeersResponse: properties: alias: type: string allowedUsingAsExitNode: type: boolean confirmed: type: boolean connected: type: boolean connections: items: $ref: '#/definitions/p2p.ConnectionInfo' type: array declined: type: boolean displayName: description: 'Deprecated: useless, equal to Alias all the time' type: string domainName: type: string inviteID: description: |- InviteID is set when we let this peer in through one of our invite links; empty otherwise. Non-secret, see config.KnownPeer.InviteID. type: string ipAddr: description: empty until the first status exchange with the peer type: string ipAddrV6: type: string lastSeen: type: string name: description: 'Deprecated: use DisplayName instead' type: string networkStats: $ref: '#/definitions/metrics.Stats' networkStatsInIECUnits: $ref: '#/definitions/entity.StatsInUnits' peerID: type: string peerstoreAddrs: description: |- PeerstoreAddrs are the addresses a dial to the peer goes through. There are none for a peer that has been away for a while. items: type: string type: array ping: type: integer reconnect: allOf: - $ref: '#/definitions/entity.KnownPeerReconnectInfo' description: Reconnect is set for a peer we fail to reach. remoteVPNGatewayServerEnabled: type: boolean version: type: string weAllowUsingAsExitNode: type: boolean type: object entity.ListAvailableProxiesResponse: properties: proxies: items: $ref: '#/definitions/entity.AvailableProxy' type: array type: object entity.ListAvailableVPNGatewaysResponse: properties: vpngateways: items: $ref: '#/definitions/entity.AvailableVPNGateway' type: array type: object entity.P2pDebugInfo: properties: bandwidth: $ref: '#/definitions/entity.BandwidthDebugInfo' connections: $ref: '#/definitions/entity.ConnectionsDebugInfo' dht: $ref: '#/definitions/entity.DhtDebugInfo' general: $ref: '#/definitions/entity.GeneralDebugInfo' knownPeers: items: $ref: '#/definitions/entity.KnownPeersResponse' type: array type: object entity.PeerIDRequest: properties: peerID: type: string required: - peerID type: object entity.PeerInfo: properties: awlDNSAddress: type: string connectedBootstrapPeers: type: integer isAwlDNSSetAsSystem: type: boolean name: type: string networkStats: $ref: '#/definitions/metrics.Stats' networkStatsInIECUnits: $ref: '#/definitions/entity.StatsInUnits' peerID: type: string reachability: enum: - Unknown - Public - Private type: string serverVersion: type: string socks5: $ref: '#/definitions/entity.SOCKS5Info' totalBootstrapPeers: type: integer uptime: type: integer vpn: $ref: '#/definitions/entity.VPNInfo' vpngateway: $ref: '#/definitions/entity.VPNGatewayInfo' type: object entity.RevokeInviteRequest: properties: id: type: string required: - id type: object entity.SOCKS5Info: properties: connected: description: Connected — current libp2p connectivity to the exit peer. type: boolean listenAddress: description: ListenAddress — address the local proxy listens on, empty if the proxy is off. type: string listenerEnabled: type: boolean proxyingEnabled: type: boolean usingPeerID: type: string usingPeerName: type: string usingPeerPing: type: integer usingPeerPublicIP: type: string usingPeerThroughRelay: type: boolean type: object entity.SetVPNGatewayServerEnabledRequest: properties: enabled: type: boolean type: object entity.StatsInUnits: properties: rateIn: type: string rateOut: type: string totalIn: type: string totalOut: type: string type: object entity.UpdateMySettingsRequest: properties: name: maxLength: 100 type: string type: object entity.UpdatePeerSettingsRequest: properties: alias: maxLength: 100 type: string allowUsingAsExitNode: type: boolean domainName: type: string ipaddr: description: |- optional: empty keeps the current address TODO: support ipv6 type: string peerID: type: string required: - alias - domainName - peerID type: object entity.UpdateProxySettingsRequest: properties: usingPeerID: type: string type: object entity.VPNGatewayInfo: properties: clientEnabled: description: ClientEnabled — VPN gateway client mode is on (we route via GatewayPeerID). type: boolean connected: description: Connected — current libp2p connectivity to the gateway peer. type: boolean gatewayPeerID: description: GatewayPeerID — the peer we route through; empty when disabled. type: string gatewayPeerName: description: GatewayPeerName — display name of the gateway peer, populated when known. type: string gatewayPing: type: integer gatewayPublicIP: type: string gatewayThroughRelay: type: boolean serverEnabled: description: ServerEnabled — this node currently offers VPN gateway server. type: boolean type: object entity.VPNInfo: properties: interfaceName: type: string ipnet: type: string ipv6Addr: type: string vpninterfaceEnabled: type: boolean type: object github_com_anywherelan_awl_config.Config: properties: blockedPeers: additionalProperties: $ref: '#/definitions/config.BlockedPeer' type: object dns: $ref: '#/definitions/config.DNSConfig' httpBasicAuth: $ref: '#/definitions/config.HttpBasicAuthConfig' httpListenAddress: type: string httpListenOnAdminHost: type: boolean invites: additionalProperties: $ref: '#/definitions/config.Invite' type: object knownPeers: additionalProperties: $ref: '#/definitions/config.KnownPeer' type: object loggerLevel: type: string p2pNode: $ref: '#/definitions/config.P2pNodeConfig' socks5: $ref: '#/definitions/config.SOCKS5Config' update: $ref: '#/definitions/config.UpdateConfig' version: type: string vpn: $ref: '#/definitions/config.VPNConfig' vpnGateway: $ref: '#/definitions/config.VPNGatewayConfig' type: object kbucket.PeerInfo: properties: addedAt: description: AddedAt is the time this peer was added to the routing table. type: string id: type: string lastSuccessfulOutboundQueryAt: description: |- LastSuccessfulOutboundQueryAt is the time instant at which we last got a successful query response from the peer. type: string lastUsefulAt: description: |- LastUsefulAt is the time instant at which the peer was last "useful" to us. Please see the DHT docs for the definition of usefulness. type: string type: object metrics.Stats: properties: rateIn: format: float64 type: number rateOut: format: float64 type: number totalIn: format: int64 type: integer totalOut: format: int64 type: integer type: object p2p.BootstrapPeerDebugInfo: properties: connections: items: type: string type: array error: type: string peerstoreAddrs: description: PeerstoreAddrs are the addresses a dial to the peer goes through items: type: string type: array ping: type: string reconnect: allOf: - $ref: '#/definitions/p2p.ReconnectDebugInfo' description: Reconnect is set while the peer cannot be reached type: object p2p.ConnectionInfo: properties: address: type: string direction: type: string multiaddr: type: string opened: type: string protocol: type: string relayPeerID: type: string throughRelay: type: boolean transient: type: boolean type: object p2p.ReconnectDebugInfo: properties: failures: description: Failures in a row type: integer lastAttemptAgo: type: string lastError: type: string nextAttemptIn: description: NextAttemptIn is zero when the peer is to be tried on the next round type: string type: object p2p.TCPDialStats: properties: fromListenPort: description: |- FromListenPort is what hole punching needs. If it stays at zero while FromRandomPort grows, port reuse is silently broken. format: int64 type: integer fromRandomPort: format: int64 type: integer type: object host: localhost:8639 info: contact: {} description: Anywherelan API title: Anywherelan API version: "0.1" paths: /debug/log: get: parameters: - description: Define number of rows of logs to output. On default and 0 prints all. in: query name: logs type: integer - description: Print logs from the beginning of logs in: query name: from_head type: boolean produces: - text/plain responses: "200": description: log text schema: type: string summary: Get logs tags: - Debug /debug/p2p_info: get: produces: - application/json responses: "200": description: OK schema: $ref: '#/definitions/entity.P2pDebugInfo' summary: Get p2p debug info tags: - Debug /peers/accept_peer: post: consumes: - application/json parameters: - description: Params in: body name: body required: true schema: $ref: '#/definitions/entity.FriendRequestReply' produces: - application/json responses: "200": description: OK "400": description: Bad Request schema: $ref: '#/definitions/api.Error' "500": description: Internal Server Error schema: $ref: '#/definitions/api.Error' summary: Accept new peer's invitation tags: - Peers /peers/auth_requests: get: consumes: - application/json produces: - application/json responses: "200": description: OK schema: items: $ref: '#/definitions/entity.AuthRequest' type: array summary: Get ingoing auth requests tags: - Peers /peers/get_blocked: get: consumes: - application/json produces: - application/json responses: "200": description: OK schema: items: $ref: '#/definitions/config.BlockedPeer' type: array summary: Get blocked peers info tags: - Peers /peers/get_known: get: consumes: - application/json produces: - application/json responses: "200": description: OK schema: items: $ref: '#/definitions/entity.KnownPeersResponse' type: array summary: Get known peers info tags: - Peers /peers/get_known_peer_settings: post: consumes: - application/json parameters: - description: Params in: body name: body required: true schema: $ref: '#/definitions/entity.PeerIDRequest' produces: - application/json responses: "200": description: OK schema: $ref: '#/definitions/config.KnownPeer' "400": description: Bad Request schema: $ref: '#/definitions/api.Error' "404": description: Not Found schema: $ref: '#/definitions/api.Error' summary: Get known peer settings tags: - Peers /peers/invite_peer: post: consumes: - application/json parameters: - description: Params in: body name: body required: true schema: $ref: '#/definitions/entity.FriendRequest' produces: - application/json responses: "200": description: OK "400": description: Bad Request schema: $ref: '#/definitions/api.Error' "500": description: Internal Server Error schema: $ref: '#/definitions/api.Error' summary: Invite new peer tags: - Peers /peers/invites/create: post: consumes: - application/json parameters: - description: Params in: body name: body required: true schema: $ref: '#/definitions/entity.CreateInviteRequest' produces: - application/json responses: "200": description: OK schema: $ref: '#/definitions/entity.InviteResponse' "400": description: Bad Request schema: $ref: '#/definitions/api.Error' "500": description: Internal Server Error schema: $ref: '#/definitions/api.Error' summary: Create an invite link tags: - Peers /peers/invites/list: get: consumes: - application/json produces: - application/json responses: "200": description: OK schema: items: $ref: '#/definitions/entity.InviteResponse' type: array summary: Get invite links tags: - Peers /peers/invites/revoke: post: consumes: - application/json description: Stops new connections through the link; peers already added stay. parameters: - description: Params in: body name: body required: true schema: $ref: '#/definitions/entity.RevokeInviteRequest' produces: - application/json responses: "200": description: OK "400": description: Bad Request schema: $ref: '#/definitions/api.Error' "404": description: Not Found schema: $ref: '#/definitions/api.Error' summary: Revoke an invite link tags: - Peers /peers/remove: post: consumes: - application/json parameters: - description: Params in: body name: body required: true schema: $ref: '#/definitions/entity.PeerIDRequest' produces: - application/json responses: "200": description: OK "400": description: Bad Request schema: $ref: '#/definitions/api.Error' "404": description: Not Found schema: $ref: '#/definitions/api.Error' "409": description: Conflict schema: $ref: '#/definitions/api.Error' summary: Remove known peer tags: - Peers /peers/unblock: post: consumes: - application/json parameters: - description: Params in: body name: body required: true schema: $ref: '#/definitions/entity.PeerIDRequest' produces: - application/json responses: "200": description: OK "400": description: Bad Request schema: $ref: '#/definitions/api.Error' "404": description: Not Found schema: $ref: '#/definitions/api.Error' summary: Unblock peer tags: - Peers /peers/update_settings: post: consumes: - application/json parameters: - description: Params in: body name: body required: true schema: $ref: '#/definitions/entity.UpdatePeerSettingsRequest' produces: - application/json responses: "200": description: OK "400": description: Bad Request schema: $ref: '#/definitions/api.Error' "404": description: Not Found schema: $ref: '#/definitions/api.Error' summary: Update peer settings tags: - Peers /settings/export_server_config: get: consumes: - application/json produces: - application/json responses: "200": description: OK schema: $ref: '#/definitions/github_com_anywherelan_awl_config.Config' summary: Export server configuration tags: - Settings /settings/list_proxies: get: consumes: - application/json produces: - application/json responses: "200": description: OK schema: $ref: '#/definitions/entity.ListAvailableProxiesResponse' summary: List available socks5 proxies tags: - Settings /settings/peer_info: get: consumes: - application/json produces: - application/json responses: "200": description: OK schema: $ref: '#/definitions/entity.PeerInfo' summary: Get my peer info tags: - Settings /settings/set_proxy: post: consumes: - application/json parameters: - description: Params in: body name: body required: true schema: $ref: '#/definitions/entity.UpdateProxySettingsRequest' produces: - application/json responses: "200": description: OK summary: Update current proxy settings tags: - Settings /settings/update: post: consumes: - application/json parameters: - description: Params in: body name: body required: true schema: $ref: '#/definitions/entity.UpdateMySettingsRequest' produces: - application/json responses: "200": description: OK summary: Update my peer info tags: - Settings /vpn_gateway/client/disable: post: consumes: - application/json produces: - application/json responses: "200": description: OK summary: Disable VPN gateway client mode tags: - VPN Gateway /vpn_gateway/client/enable: post: consumes: - application/json parameters: - description: Params in: body name: body required: true schema: $ref: '#/definitions/entity.EnableVPNGatewayClientRequest' produces: - application/json responses: "200": description: OK summary: Enable VPN gateway client mode tags: - VPN Gateway /vpn_gateway/client/list_available: get: consumes: - application/json produces: - application/json responses: "200": description: OK schema: $ref: '#/definitions/entity.ListAvailableVPNGatewaysResponse' summary: List available VPN gateways tags: - VPN Gateway /vpn_gateway/server/set_enabled: post: consumes: - application/json parameters: - description: Params in: body name: body required: true schema: $ref: '#/definitions/entity.SetVPNGatewayServerEnabledRequest' produces: - application/json responses: "200": description: OK summary: Toggle VPN gateway server mode tags: - VPN Gateway swagger: "2.0"