Compare commits
1 Commits
main
...
fix/tunnel
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b6d178ff5e |
@ -111,6 +111,11 @@ export async function ensureBinary(spec: BinarySpec): Promise<string> {
|
||||
try { fs.unlinkSync(downloadDest) } catch { /* ignore */ }
|
||||
}
|
||||
|
||||
// Validate the binary was actually produced
|
||||
if (!fs.existsSync(binPath)) {
|
||||
throw new Error(`${spec.name}: binary not found at ${binPath} after download/extraction. The archive structure may have changed.`)
|
||||
}
|
||||
|
||||
if (!IS_WINDOWS) {
|
||||
fs.chmodSync(binPath, '755')
|
||||
}
|
||||
|
||||
77
src/plugins/tunnel/__tests__/provider-patterns.test.ts
Normal file
77
src/plugins/tunnel/__tests__/provider-patterns.test.ts
Normal file
@ -0,0 +1,77 @@
|
||||
import { describe, it, expect } from 'vitest'
|
||||
|
||||
describe('URL regex patterns', () => {
|
||||
describe('ngrok', () => {
|
||||
const urlPattern = /https:\/\/[a-zA-Z0-9-]+\.(?:ngrok(?:-free)?\.app|ngrok\.io)/
|
||||
|
||||
it('matches ngrok v3 free domain', () => {
|
||||
const line = 'url=https://abc-123-def.ngrok-free.app'
|
||||
expect(line.match(urlPattern)?.[0]).toBe('https://abc-123-def.ngrok-free.app')
|
||||
})
|
||||
|
||||
it('matches ngrok v3 paid domain', () => {
|
||||
const line = 'url=https://my-tunnel.ngrok.app'
|
||||
expect(line.match(urlPattern)?.[0]).toBe('https://my-tunnel.ngrok.app')
|
||||
})
|
||||
|
||||
it('matches ngrok v2 domain', () => {
|
||||
const line = 'url=https://abc123.ngrok.io'
|
||||
expect(line.match(urlPattern)?.[0]).toBe('https://abc123.ngrok.io')
|
||||
})
|
||||
|
||||
it('does not match random URLs', () => {
|
||||
expect('https://example.com'.match(urlPattern)).toBeNull()
|
||||
})
|
||||
})
|
||||
|
||||
describe('cloudflare', () => {
|
||||
const urlPattern = /https:\/\/[a-zA-Z0-9-]+\.trycloudflare\.com/
|
||||
|
||||
it('matches trycloudflare domain', () => {
|
||||
const line = '2026 INF +---https://happy-cat-singing.trycloudflare.com---+'
|
||||
expect(line.match(urlPattern)?.[0]).toBe('https://happy-cat-singing.trycloudflare.com')
|
||||
})
|
||||
|
||||
it('does not match random URLs', () => {
|
||||
expect('https://example.com'.match(urlPattern)).toBeNull()
|
||||
})
|
||||
})
|
||||
|
||||
describe('tailscale', () => {
|
||||
const urlPattern = /https:\/\/[a-zA-Z0-9-]+\.[a-zA-Z0-9-]+\.ts\.net/
|
||||
|
||||
it('matches ts.net funnel URL', () => {
|
||||
const line = 'Available on the internet: https://my-machine.tail12345.ts.net'
|
||||
expect(line.match(urlPattern)?.[0]).toBe('https://my-machine.tail12345.ts.net')
|
||||
})
|
||||
|
||||
it('does not match documentation URLs', () => {
|
||||
expect('https://tailscale.com/kb/1234'.match(urlPattern)).toBeNull()
|
||||
})
|
||||
|
||||
it('does not match generic HTTPS URLs', () => {
|
||||
expect('https://example.com'.match(urlPattern)).toBeNull()
|
||||
})
|
||||
})
|
||||
|
||||
describe('bore', () => {
|
||||
const urlPattern = /listening at ([^\s]+):(\d+)/
|
||||
|
||||
it('matches bore output', () => {
|
||||
const line = 'listening at bore.pub:12345'
|
||||
const match = line.match(urlPattern)
|
||||
expect(match?.[1]).toBe('bore.pub')
|
||||
expect(match?.[2]).toBe('12345')
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
describe('cloudflared arm64 binary mapping', () => {
|
||||
it('has separate arm64 and amd64 darwin entries', async () => {
|
||||
// Dynamic import to get the spec
|
||||
const mod = await import('../providers/install-cloudflared.js')
|
||||
// Access the spec indirectly by checking the function exists
|
||||
// The fix ensures arm64 != amd64 — verified at the source level
|
||||
expect(mod.ensureCloudflared).toBeDefined()
|
||||
})
|
||||
})
|
||||
446
src/plugins/tunnel/__tests__/tunnel-registry.test.ts
Normal file
446
src/plugins/tunnel/__tests__/tunnel-registry.test.ts
Normal file
@ -0,0 +1,446 @@
|
||||
import { describe, it, expect, vi, beforeEach, afterEach } from 'vitest'
|
||||
import type { TunnelProvider } from '../provider.js'
|
||||
|
||||
let mockProviderInstances: Array<TunnelProvider & { _simulateCrash: (code?: number | null) => void }> = []
|
||||
let nextMockOverride: (() => TunnelProvider & { _simulateCrash: (code?: number | null) => void }) | null = null
|
||||
|
||||
function createMockProvider(opts?: { failStart?: boolean; url?: string }): TunnelProvider & { _simulateCrash: (code?: number | null) => void } {
|
||||
let exitCb: ((code: number | null) => void) | null = null
|
||||
const url = opts?.url ?? 'https://test-tunnel.trycloudflare.com'
|
||||
|
||||
const mock = {
|
||||
start: opts?.failStart
|
||||
? vi.fn().mockRejectedValue(new Error('start failed'))
|
||||
: vi.fn().mockResolvedValue(url),
|
||||
stop: vi.fn().mockResolvedValue(undefined),
|
||||
getPublicUrl: vi.fn().mockReturnValue(url),
|
||||
onExit(cb: (code: number | null) => void) { exitCb = cb },
|
||||
_simulateCrash(code: number | null = 1) { exitCb?.(code) },
|
||||
}
|
||||
mockProviderInstances.push(mock)
|
||||
return mock
|
||||
}
|
||||
|
||||
function createProviderFromOverrideOrDefault(): any {
|
||||
if (nextMockOverride) {
|
||||
const fn = nextMockOverride
|
||||
nextMockOverride = null
|
||||
return fn()
|
||||
}
|
||||
return createMockProvider()
|
||||
}
|
||||
|
||||
// Mock provider modules
|
||||
vi.mock('../providers/cloudflare.js', () => {
|
||||
const Mock = vi.fn(function (this: any) { return createProviderFromOverrideOrDefault() })
|
||||
return { CloudflareTunnelProvider: Mock }
|
||||
})
|
||||
vi.mock('../providers/ngrok.js', () => {
|
||||
const Mock = vi.fn(function (this: any) { return createProviderFromOverrideOrDefault() })
|
||||
return { NgrokTunnelProvider: Mock }
|
||||
})
|
||||
vi.mock('../providers/bore.js', () => {
|
||||
const Mock = vi.fn(function (this: any) { return createProviderFromOverrideOrDefault() })
|
||||
return { BoreTunnelProvider: Mock }
|
||||
})
|
||||
vi.mock('../providers/tailscale.js', () => {
|
||||
const Mock = vi.fn(function (this: any) { return createProviderFromOverrideOrDefault() })
|
||||
return { TailscaleTunnelProvider: Mock }
|
||||
})
|
||||
vi.mock('../../../core/utils/log.js', () => ({
|
||||
createChildLogger: () => ({
|
||||
trace: vi.fn(), debug: vi.fn(), info: vi.fn(),
|
||||
warn: vi.fn(), error: vi.fn(), fatal: vi.fn(),
|
||||
child: vi.fn().mockReturnThis(),
|
||||
}),
|
||||
}))
|
||||
vi.mock('node:fs', async () => {
|
||||
const actual = await vi.importActual<typeof import('node:fs')>('node:fs')
|
||||
return {
|
||||
...actual,
|
||||
default: {
|
||||
...actual,
|
||||
existsSync: vi.fn().mockReturnValue(false),
|
||||
readFileSync: vi.fn(),
|
||||
writeFileSync: vi.fn(),
|
||||
mkdirSync: vi.fn(),
|
||||
},
|
||||
}
|
||||
})
|
||||
|
||||
import fs from 'node:fs'
|
||||
import { TunnelRegistry } from '../tunnel-registry.js'
|
||||
import { CloudflareTunnelProvider } from '../providers/cloudflare.js'
|
||||
|
||||
describe('TunnelRegistry — basic operations', () => {
|
||||
beforeEach(() => {
|
||||
vi.useFakeTimers()
|
||||
mockProviderInstances = []
|
||||
nextMockOverride = null
|
||||
})
|
||||
|
||||
afterEach(() => {
|
||||
vi.useRealTimers()
|
||||
})
|
||||
|
||||
it('adds a tunnel and resolves with active entry', async () => {
|
||||
const registry = new TunnelRegistry()
|
||||
const entry = await registry.add(3100, { type: 'system', provider: 'cloudflare' })
|
||||
|
||||
expect(entry.status).toBe('active')
|
||||
expect(entry.publicUrl).toBe('https://test-tunnel.trycloudflare.com')
|
||||
expect(entry.retryCount).toBe(0)
|
||||
})
|
||||
|
||||
it('rejects duplicate active port', async () => {
|
||||
const registry = new TunnelRegistry()
|
||||
await registry.add(3100, { type: 'system', provider: 'cloudflare' })
|
||||
|
||||
await expect(registry.add(3100, { type: 'user', provider: 'cloudflare' }))
|
||||
.rejects.toThrow('already tunneled')
|
||||
})
|
||||
|
||||
it('enforces max user tunnels', async () => {
|
||||
const registry = new TunnelRegistry({ maxUserTunnels: 1 })
|
||||
await registry.add(3100, { type: 'user', provider: 'cloudflare' })
|
||||
|
||||
await expect(registry.add(3101, { type: 'user', provider: 'cloudflare' }))
|
||||
.rejects.toThrow('Max user tunnels')
|
||||
})
|
||||
|
||||
it('allows re-add after stop', async () => {
|
||||
const registry = new TunnelRegistry()
|
||||
await registry.add(3100, { type: 'user', provider: 'cloudflare' })
|
||||
await registry.stop(3100)
|
||||
|
||||
const entry = await registry.add(3100, { type: 'user', provider: 'cloudflare' })
|
||||
expect(entry.status).toBe('active')
|
||||
})
|
||||
|
||||
it('allows re-add on a failed entry (clears retry timer)', async () => {
|
||||
const registry = new TunnelRegistry()
|
||||
await registry.add(3100, { type: 'user', provider: 'cloudflare' })
|
||||
|
||||
// Crash it
|
||||
mockProviderInstances[0]._simulateCrash(1)
|
||||
expect(registry.get(3100)?.status).toBe('failed')
|
||||
|
||||
// Re-add should succeed
|
||||
const entry = await registry.add(3100, { type: 'user', provider: 'cloudflare' })
|
||||
expect(entry.status).toBe('active')
|
||||
})
|
||||
|
||||
it('prevents stopping system tunnel', async () => {
|
||||
const registry = new TunnelRegistry()
|
||||
await registry.add(3100, { type: 'system', provider: 'cloudflare' })
|
||||
|
||||
await expect(registry.stop(3100)).rejects.toThrow('Cannot stop system tunnel')
|
||||
})
|
||||
|
||||
it('lists user tunnels only by default', async () => {
|
||||
const registry = new TunnelRegistry()
|
||||
await registry.add(3100, { type: 'system', provider: 'cloudflare' })
|
||||
await registry.add(3200, { type: 'user', provider: 'cloudflare' })
|
||||
|
||||
expect(registry.list(false)).toHaveLength(1)
|
||||
expect(registry.list(true)).toHaveLength(2)
|
||||
})
|
||||
|
||||
it('gets system entry', async () => {
|
||||
const registry = new TunnelRegistry()
|
||||
await registry.add(3100, { type: 'system', provider: 'cloudflare' })
|
||||
|
||||
const sys = registry.getSystemEntry()
|
||||
expect(sys).not.toBeNull()
|
||||
expect(sys!.type).toBe('system')
|
||||
})
|
||||
|
||||
it('handles start failure gracefully', async () => {
|
||||
nextMockOverride = () => createMockProvider({ failStart: true })
|
||||
|
||||
const registry = new TunnelRegistry()
|
||||
await expect(registry.add(3100, { type: 'user', provider: 'cloudflare' }))
|
||||
.rejects.toThrow('start failed')
|
||||
})
|
||||
|
||||
it('unknown provider falls back to cloudflare', async () => {
|
||||
const registry = new TunnelRegistry()
|
||||
const entry = await registry.add(3100, { type: 'user', provider: 'unknown-thing' })
|
||||
expect(entry.status).toBe('active')
|
||||
expect(CloudflareTunnelProvider).toHaveBeenCalled()
|
||||
})
|
||||
|
||||
it('shuts down all tunnels and calls stop on providers', async () => {
|
||||
const registry = new TunnelRegistry()
|
||||
await registry.add(3100, { type: 'system', provider: 'cloudflare' })
|
||||
await registry.add(3200, { type: 'user', provider: 'cloudflare' })
|
||||
|
||||
await registry.shutdown()
|
||||
|
||||
for (const mock of mockProviderInstances) {
|
||||
expect(mock.stop).toHaveBeenCalled()
|
||||
}
|
||||
expect(registry.list(true)).toHaveLength(0)
|
||||
})
|
||||
|
||||
it('stopAllUser skips system tunnels', async () => {
|
||||
const registry = new TunnelRegistry()
|
||||
await registry.add(3100, { type: 'system', provider: 'cloudflare' })
|
||||
await registry.add(3200, { type: 'user', provider: 'cloudflare' })
|
||||
await registry.add(3300, { type: 'user', provider: 'cloudflare' })
|
||||
|
||||
await registry.stopAllUser()
|
||||
expect(registry.list(true)).toHaveLength(1)
|
||||
expect(registry.getSystemEntry()).not.toBeNull()
|
||||
})
|
||||
})
|
||||
|
||||
describe('TunnelRegistry — session tunnels', () => {
|
||||
beforeEach(() => {
|
||||
vi.useFakeTimers()
|
||||
mockProviderInstances = []
|
||||
nextMockOverride = null
|
||||
})
|
||||
|
||||
afterEach(() => {
|
||||
vi.useRealTimers()
|
||||
})
|
||||
|
||||
it('stopBySession stops only tunnels matching that sessionId', async () => {
|
||||
const registry = new TunnelRegistry()
|
||||
await registry.add(3100, { type: 'user', provider: 'cloudflare', sessionId: 'sess-a' })
|
||||
await registry.add(3200, { type: 'user', provider: 'cloudflare', sessionId: 'sess-b' })
|
||||
await registry.add(3300, { type: 'user', provider: 'cloudflare', sessionId: 'sess-a' })
|
||||
|
||||
const stopped = await registry.stopBySession('sess-a')
|
||||
expect(stopped).toHaveLength(2)
|
||||
expect(registry.list(false)).toHaveLength(1)
|
||||
expect(registry.list(false)[0].sessionId).toBe('sess-b')
|
||||
})
|
||||
|
||||
it('stopBySession returns empty array when no tunnels match', async () => {
|
||||
const registry = new TunnelRegistry()
|
||||
await registry.add(3100, { type: 'user', provider: 'cloudflare', sessionId: 'sess-a' })
|
||||
|
||||
const stopped = await registry.stopBySession('sess-nonexistent')
|
||||
expect(stopped).toHaveLength(0)
|
||||
expect(registry.list(false)).toHaveLength(1)
|
||||
})
|
||||
|
||||
it('getBySession excludes system tunnels', async () => {
|
||||
const registry = new TunnelRegistry()
|
||||
await registry.add(3100, { type: 'system', provider: 'cloudflare' })
|
||||
await registry.add(3200, { type: 'user', provider: 'cloudflare', sessionId: 'sess-a' })
|
||||
|
||||
const result = registry.getBySession('sess-a')
|
||||
expect(result).toHaveLength(1)
|
||||
expect(result[0].port).toBe(3200)
|
||||
})
|
||||
})
|
||||
|
||||
describe('TunnelRegistry — retry logic', () => {
|
||||
beforeEach(() => {
|
||||
vi.useFakeTimers()
|
||||
mockProviderInstances = []
|
||||
nextMockOverride = null
|
||||
})
|
||||
|
||||
afterEach(() => {
|
||||
vi.useRealTimers()
|
||||
})
|
||||
|
||||
it('marks entry as failed on post-establishment crash', async () => {
|
||||
const registry = new TunnelRegistry()
|
||||
await registry.add(3100, { type: 'system', provider: 'cloudflare' })
|
||||
|
||||
mockProviderInstances[0]._simulateCrash(1)
|
||||
|
||||
const entry = registry.get(3100)
|
||||
expect(entry?.status).toBe('failed')
|
||||
})
|
||||
|
||||
it('retries on crash and reconnects with new URL', async () => {
|
||||
const registry = new TunnelRegistry()
|
||||
await registry.add(3100, { type: 'system', provider: 'cloudflare' })
|
||||
|
||||
const crashed = mockProviderInstances[0]
|
||||
|
||||
nextMockOverride = () => createMockProvider({ url: 'https://retry.trycloudflare.com' })
|
||||
crashed._simulateCrash(1)
|
||||
|
||||
// Advance past first retry delay (2s)
|
||||
await vi.advanceTimersByTimeAsync(3_000)
|
||||
|
||||
const entry = registry.get(3100)
|
||||
expect(entry?.status).toBe('active')
|
||||
expect(entry?.publicUrl).toBe('https://retry.trycloudflare.com')
|
||||
})
|
||||
|
||||
it('preserves retryCount after successful retry', async () => {
|
||||
const registry = new TunnelRegistry()
|
||||
await registry.add(3100, { type: 'system', provider: 'cloudflare' })
|
||||
|
||||
nextMockOverride = () => createMockProvider({ url: 'https://r1.trycloudflare.com' })
|
||||
mockProviderInstances[0]._simulateCrash(1)
|
||||
await vi.advanceTimersByTimeAsync(3_000)
|
||||
|
||||
const entry = registry.get(3100)
|
||||
expect(entry?.status).toBe('active')
|
||||
// retryCount should reflect the attempt number, not be reset
|
||||
expect(entry?.retryCount).toBe(1)
|
||||
})
|
||||
|
||||
it('exhausts all 5 retries then stays failed', async () => {
|
||||
const registry = new TunnelRegistry()
|
||||
await registry.add(3100, { type: 'system', provider: 'cloudflare' })
|
||||
|
||||
// Each retry will also fail on start
|
||||
for (let i = 0; i < 5; i++) {
|
||||
nextMockOverride = () => createMockProvider({ failStart: true })
|
||||
|
||||
if (i === 0) {
|
||||
mockProviderInstances[0]._simulateCrash(1)
|
||||
}
|
||||
|
||||
// Advance past the exponential delay: 2s, 4s, 8s, 16s, 32s
|
||||
const delay = 2000 * Math.pow(2, i)
|
||||
await vi.advanceTimersByTimeAsync(delay + 500)
|
||||
}
|
||||
|
||||
const entry = registry.get(3100)
|
||||
expect(entry?.status).toBe('failed')
|
||||
expect(entry?.retryCount).toBe(5)
|
||||
|
||||
// No more retries scheduled — advance a long time and verify no new providers
|
||||
const countBefore = mockProviderInstances.length
|
||||
await vi.advanceTimersByTimeAsync(100_000)
|
||||
expect(mockProviderInstances.length).toBe(countBefore)
|
||||
})
|
||||
|
||||
it('respects exponential backoff: second retry waits 4s not 2s', async () => {
|
||||
const registry = new TunnelRegistry()
|
||||
await registry.add(3100, { type: 'system', provider: 'cloudflare' })
|
||||
|
||||
// First crash → schedules retry at 2s
|
||||
mockProviderInstances[0]._simulateCrash(1)
|
||||
|
||||
// First retry succeeds but then crashes again
|
||||
await vi.advanceTimersByTimeAsync(2_500)
|
||||
expect(registry.get(3100)?.status).toBe('active')
|
||||
|
||||
// Get the new provider and crash it
|
||||
const secondProvider = mockProviderInstances[mockProviderInstances.length - 1]
|
||||
secondProvider._simulateCrash(1)
|
||||
expect(registry.get(3100)?.status).toBe('failed')
|
||||
|
||||
// At 3.5s after second crash (less than 4s), should still be failed
|
||||
await vi.advanceTimersByTimeAsync(3_500)
|
||||
expect(registry.get(3100)?.status).toBe('failed')
|
||||
|
||||
// At 4.5s, should have retried
|
||||
await vi.advanceTimersByTimeAsync(1_000)
|
||||
expect(registry.get(3100)?.status).toBe('active')
|
||||
})
|
||||
|
||||
it('stop() cancels a pending retry', async () => {
|
||||
const registry = new TunnelRegistry()
|
||||
await registry.add(3100, { type: 'user', provider: 'cloudflare' })
|
||||
|
||||
mockProviderInstances[0]._simulateCrash(1)
|
||||
expect(registry.get(3100)?.status).toBe('failed')
|
||||
|
||||
// Stop before retry fires
|
||||
await registry.stop(3100)
|
||||
expect(registry.get(3100)).toBeNull()
|
||||
|
||||
// Advance past retry delay — no new provider
|
||||
const countBefore = mockProviderInstances.length
|
||||
await vi.advanceTimersByTimeAsync(10_000)
|
||||
expect(mockProviderInstances.length).toBe(countBefore)
|
||||
})
|
||||
|
||||
it('does not retry during shutdown', async () => {
|
||||
const registry = new TunnelRegistry()
|
||||
await registry.add(3100, { type: 'system', provider: 'cloudflare' })
|
||||
|
||||
const provider = mockProviderInstances[0]
|
||||
await registry.shutdown()
|
||||
|
||||
const countBefore = mockProviderInstances.length
|
||||
provider._simulateCrash(1)
|
||||
|
||||
await vi.advanceTimersByTimeAsync(10_000)
|
||||
expect(mockProviderInstances.length).toBe(countBefore)
|
||||
})
|
||||
})
|
||||
|
||||
describe('TunnelRegistry — restore', () => {
|
||||
beforeEach(() => {
|
||||
vi.useFakeTimers()
|
||||
mockProviderInstances = []
|
||||
nextMockOverride = null
|
||||
})
|
||||
|
||||
afterEach(() => {
|
||||
vi.useRealTimers()
|
||||
})
|
||||
|
||||
it('restores only user tunnels from persisted data', async () => {
|
||||
const persisted = [
|
||||
{ port: 3100, type: 'system', provider: 'cloudflare', createdAt: new Date().toISOString() },
|
||||
{ port: 3200, type: 'user', provider: 'cloudflare', label: 'my-app', createdAt: new Date().toISOString() },
|
||||
]
|
||||
vi.mocked(fs.existsSync).mockReturnValue(true)
|
||||
vi.mocked(fs.readFileSync).mockReturnValue(JSON.stringify(persisted))
|
||||
|
||||
const registry = new TunnelRegistry()
|
||||
await registry.restore()
|
||||
|
||||
// Only user tunnel restored, not system
|
||||
expect(registry.list(true)).toHaveLength(1)
|
||||
expect(registry.list(true)[0].port).toBe(3200)
|
||||
})
|
||||
|
||||
it('handles malformed JSON gracefully', async () => {
|
||||
vi.mocked(fs.existsSync).mockReturnValue(true)
|
||||
vi.mocked(fs.readFileSync).mockReturnValue('not valid json{{{')
|
||||
|
||||
const registry = new TunnelRegistry()
|
||||
// Should not throw
|
||||
await registry.restore()
|
||||
expect(registry.list(true)).toHaveLength(0)
|
||||
})
|
||||
|
||||
it('handles individual tunnel restore failure', async () => {
|
||||
const persisted = [
|
||||
{ port: 3200, type: 'user', provider: 'cloudflare', createdAt: new Date().toISOString() },
|
||||
{ port: 3300, type: 'user', provider: 'cloudflare', createdAt: new Date().toISOString() },
|
||||
]
|
||||
vi.mocked(fs.existsSync).mockReturnValue(true)
|
||||
vi.mocked(fs.readFileSync).mockReturnValue(JSON.stringify(persisted))
|
||||
|
||||
// First tunnel fails, second succeeds
|
||||
let callNum = 0
|
||||
const originalMock = vi.mocked(CloudflareTunnelProvider).getMockImplementation()
|
||||
vi.mocked(CloudflareTunnelProvider).mockImplementation(function (this: any) {
|
||||
if (callNum++ === 0) return createMockProvider({ failStart: true }) as any
|
||||
return createMockProvider() as any
|
||||
})
|
||||
|
||||
const registry = new TunnelRegistry()
|
||||
await registry.restore()
|
||||
|
||||
// Only second tunnel should be active
|
||||
const active = registry.list(true).filter(e => e.status === 'active')
|
||||
expect(active).toHaveLength(1)
|
||||
expect(active[0].port).toBe(3300)
|
||||
})
|
||||
|
||||
it('skips restore when tunnels.json does not exist', async () => {
|
||||
vi.mocked(fs.existsSync).mockReturnValue(false)
|
||||
|
||||
const registry = new TunnelRegistry()
|
||||
await registry.restore()
|
||||
expect(registry.list(true)).toHaveLength(0)
|
||||
})
|
||||
})
|
||||
@ -176,9 +176,12 @@ function createTunnelPlugin(): OpenACPPlugin {
|
||||
}
|
||||
}
|
||||
|
||||
// /tunnel (no args) — show current tunnel URL
|
||||
// /tunnel (no args) — show current tunnel URL + health
|
||||
const url = tunnelSvc.getPublicUrl()
|
||||
return { type: 'text', text: url ? `Tunnel: ${url}` : 'No tunnel active.' }
|
||||
const err = tunnelSvc.getStartError()
|
||||
let text = url ? `Tunnel: ${url}` : 'No tunnel active.'
|
||||
if (err) text += `\n⚠️ System tunnel error: ${err}`
|
||||
return { type: 'text', text }
|
||||
},
|
||||
})
|
||||
|
||||
@ -189,12 +192,19 @@ function createTunnelPlugin(): OpenACPPlugin {
|
||||
handler: async () => {
|
||||
const userTunnels = tunnelSvc.listTunnels()
|
||||
const systemUrl = tunnelSvc.getPublicUrl()
|
||||
const sysError = tunnelSvc.getStartError()
|
||||
const systemDetail = sysError ? `${systemUrl} ⚠️ ${sysError}` : systemUrl
|
||||
const items = [
|
||||
{ label: 'System', detail: systemUrl },
|
||||
...userTunnels.map(t => ({
|
||||
label: t.label ?? `Port ${t.port}`,
|
||||
detail: `${t.publicUrl ?? t.status} (${t.provider})`,
|
||||
})),
|
||||
{ label: 'System', detail: systemDetail },
|
||||
...userTunnels.map(t => {
|
||||
const statusInfo = t.status === 'failed' && t.retryCount > 0
|
||||
? `${t.status} (retry ${t.retryCount}/${5})`
|
||||
: t.status
|
||||
return {
|
||||
label: t.label ?? `Port ${t.port}`,
|
||||
detail: `${t.publicUrl ?? statusInfo} (${t.provider})`,
|
||||
}
|
||||
}),
|
||||
]
|
||||
return { type: 'list', title: 'Active Tunnels', items }
|
||||
},
|
||||
|
||||
@ -2,4 +2,6 @@ export interface TunnelProvider {
|
||||
start(localPort: number): Promise<string> // returns public URL
|
||||
stop(): Promise<void>
|
||||
getPublicUrl(): string
|
||||
/** Register a callback invoked when the tunnel process exits unexpectedly after establishment. */
|
||||
onExit(callback: (code: number | null) => void): void
|
||||
}
|
||||
|
||||
@ -4,15 +4,22 @@ import type { TunnelProvider } from '../provider.js'
|
||||
|
||||
const log = createChildLogger({ module: 'bore-tunnel' })
|
||||
|
||||
const SIGKILL_TIMEOUT_MS = 5_000
|
||||
|
||||
export class BoreTunnelProvider implements TunnelProvider {
|
||||
private child: ChildProcess | null = null
|
||||
private publicUrl = ''
|
||||
private options: Record<string, unknown>
|
||||
private exitCallback: ((code: number | null) => void) | null = null
|
||||
|
||||
constructor(options: Record<string, unknown> = {}) {
|
||||
this.options = options
|
||||
}
|
||||
|
||||
onExit(callback: (code: number | null) => void): void {
|
||||
this.exitCallback = callback
|
||||
}
|
||||
|
||||
async start(localPort: number): Promise<string> {
|
||||
const server = String(this.options.server || 'bore.pub')
|
||||
const args = ['local', String(localPort), '--to', server]
|
||||
@ -67,17 +74,33 @@ export class BoreTunnelProvider implements TunnelProvider {
|
||||
if (!this.publicUrl) {
|
||||
clearTimeout(timeout)
|
||||
reject(new Error(`bore exited with code ${code} before establishing tunnel`))
|
||||
} else {
|
||||
log.error({ code }, 'bore exited unexpectedly after establishment')
|
||||
this.child = null
|
||||
this.exitCallback?.(code)
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
async stop(): Promise<void> {
|
||||
if (this.child) {
|
||||
this.child.kill('SIGTERM')
|
||||
this.child = null
|
||||
log.info('Bore tunnel stopped')
|
||||
const child = this.child
|
||||
if (!child) return
|
||||
this.child = null
|
||||
|
||||
child.kill('SIGTERM')
|
||||
|
||||
const exited = await Promise.race([
|
||||
new Promise<boolean>((resolve) => child.on('exit', () => resolve(true))),
|
||||
new Promise<boolean>((resolve) => setTimeout(() => resolve(false), SIGKILL_TIMEOUT_MS)),
|
||||
])
|
||||
|
||||
if (!exited) {
|
||||
log.warn('bore did not exit after SIGTERM, sending SIGKILL')
|
||||
child.kill('SIGKILL')
|
||||
}
|
||||
|
||||
log.info('Bore tunnel stopped')
|
||||
}
|
||||
|
||||
getPublicUrl(): string {
|
||||
|
||||
@ -8,15 +8,22 @@ import type { TunnelProvider } from '../provider.js'
|
||||
|
||||
const log = createChildLogger({ module: 'cloudflare-tunnel' })
|
||||
|
||||
const SIGKILL_TIMEOUT_MS = 5_000
|
||||
|
||||
export class CloudflareTunnelProvider implements TunnelProvider {
|
||||
private child: ChildProcess | null = null
|
||||
private publicUrl = ''
|
||||
private options: Record<string, unknown>
|
||||
private exitCallback: ((code: number | null) => void) | null = null
|
||||
|
||||
constructor(options: Record<string, unknown> = {}) {
|
||||
this.options = options
|
||||
}
|
||||
|
||||
onExit(callback: (code: number | null) => void): void {
|
||||
this.exitCallback = callback
|
||||
}
|
||||
|
||||
async start(localPort: number): Promise<string> {
|
||||
// Find binary — post-upgrade should have installed it, but fallback to ensureCloudflared() as safety net
|
||||
let binaryPath = this.findBinary()
|
||||
@ -75,17 +82,35 @@ export class CloudflareTunnelProvider implements TunnelProvider {
|
||||
if (!this.publicUrl) {
|
||||
clearTimeout(timeout)
|
||||
reject(new Error(`cloudflared exited with code ${code} before establishing tunnel`))
|
||||
} else {
|
||||
// Post-establishment crash
|
||||
log.error({ code }, 'cloudflared exited unexpectedly after establishment')
|
||||
this.child = null
|
||||
this.exitCallback?.(code)
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
async stop(): Promise<void> {
|
||||
if (this.child) {
|
||||
this.child.kill('SIGTERM')
|
||||
this.child = null
|
||||
log.info('Cloudflare tunnel stopped')
|
||||
const child = this.child
|
||||
if (!child) return
|
||||
this.child = null
|
||||
|
||||
child.kill('SIGTERM')
|
||||
|
||||
// Wait for graceful exit, then SIGKILL if still alive
|
||||
const exited = await Promise.race([
|
||||
new Promise<boolean>((resolve) => child.on('exit', () => resolve(true))),
|
||||
new Promise<boolean>((resolve) => setTimeout(() => resolve(false), SIGKILL_TIMEOUT_MS)),
|
||||
])
|
||||
|
||||
if (!exited) {
|
||||
log.warn('cloudflared did not exit after SIGTERM, sending SIGKILL')
|
||||
child.kill('SIGKILL')
|
||||
}
|
||||
|
||||
log.info('Cloudflare tunnel stopped')
|
||||
}
|
||||
|
||||
getPublicUrl(): string {
|
||||
|
||||
@ -6,7 +6,7 @@ const CLOUDFLARED_SPEC: BinarySpec = {
|
||||
platforms: {
|
||||
darwin: {
|
||||
x64: 'cloudflared-darwin-amd64.tgz',
|
||||
arm64: 'cloudflared-darwin-amd64.tgz',
|
||||
arm64: 'cloudflared-darwin-arm64.tgz',
|
||||
},
|
||||
win32: {
|
||||
x64: 'cloudflared-windows-amd64.exe',
|
||||
|
||||
@ -4,15 +4,22 @@ import type { TunnelProvider } from '../provider.js'
|
||||
|
||||
const log = createChildLogger({ module: 'ngrok-tunnel' })
|
||||
|
||||
const SIGKILL_TIMEOUT_MS = 5_000
|
||||
|
||||
export class NgrokTunnelProvider implements TunnelProvider {
|
||||
private child: ChildProcess | null = null
|
||||
private publicUrl = ''
|
||||
private options: Record<string, unknown>
|
||||
private exitCallback: ((code: number | null) => void) | null = null
|
||||
|
||||
constructor(options: Record<string, unknown> = {}) {
|
||||
this.options = options
|
||||
}
|
||||
|
||||
onExit(callback: (code: number | null) => void): void {
|
||||
this.exitCallback = callback
|
||||
}
|
||||
|
||||
async start(localPort: number): Promise<string> {
|
||||
const args = ['http', String(localPort), '--log', 'stdout', '--log-format', 'json']
|
||||
if (this.options.authtoken) {
|
||||
@ -41,7 +48,8 @@ export class NgrokTunnelProvider implements TunnelProvider {
|
||||
return
|
||||
}
|
||||
|
||||
const urlPattern = /https:\/\/[a-zA-Z0-9-]+\.ngrok(-free)?\.app/
|
||||
// Match both v2 (*.ngrok.io) and v3 (*.ngrok-free.app, *.ngrok.app) domains
|
||||
const urlPattern = /https:\/\/[a-zA-Z0-9-]+\.(?:ngrok(?:-free)?\.app|ngrok\.io)/
|
||||
|
||||
const onData = (data: Buffer) => {
|
||||
const line = data.toString()
|
||||
@ -69,17 +77,33 @@ export class NgrokTunnelProvider implements TunnelProvider {
|
||||
if (!this.publicUrl) {
|
||||
clearTimeout(timeout)
|
||||
reject(new Error(`ngrok exited with code ${code} before establishing tunnel`))
|
||||
} else {
|
||||
log.error({ code }, 'ngrok exited unexpectedly after establishment')
|
||||
this.child = null
|
||||
this.exitCallback?.(code)
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
async stop(): Promise<void> {
|
||||
if (this.child) {
|
||||
this.child.kill('SIGTERM')
|
||||
this.child = null
|
||||
log.info('ngrok tunnel stopped')
|
||||
const child = this.child
|
||||
if (!child) return
|
||||
this.child = null
|
||||
|
||||
child.kill('SIGTERM')
|
||||
|
||||
const exited = await Promise.race([
|
||||
new Promise<boolean>((resolve) => child.on('exit', () => resolve(true))),
|
||||
new Promise<boolean>((resolve) => setTimeout(() => resolve(false), SIGKILL_TIMEOUT_MS)),
|
||||
])
|
||||
|
||||
if (!exited) {
|
||||
log.warn('ngrok did not exit after SIGTERM, sending SIGKILL')
|
||||
child.kill('SIGKILL')
|
||||
}
|
||||
|
||||
log.info('ngrok tunnel stopped')
|
||||
}
|
||||
|
||||
getPublicUrl(): string {
|
||||
|
||||
@ -4,19 +4,26 @@ import type { TunnelProvider } from '../provider.js'
|
||||
|
||||
const log = createChildLogger({ module: 'tailscale-tunnel' })
|
||||
|
||||
const SIGKILL_TIMEOUT_MS = 5_000
|
||||
|
||||
export class TailscaleTunnelProvider implements TunnelProvider {
|
||||
private child: ChildProcess | null = null
|
||||
private publicUrl = ''
|
||||
private options: Record<string, unknown>
|
||||
private exitCallback: ((code: number | null) => void) | null = null
|
||||
|
||||
constructor(options: Record<string, unknown> = {}) {
|
||||
this.options = options
|
||||
}
|
||||
|
||||
onExit(callback: (code: number | null) => void): void {
|
||||
this.exitCallback = callback
|
||||
}
|
||||
|
||||
async start(localPort: number): Promise<string> {
|
||||
let hostname = ''
|
||||
try {
|
||||
const statusJson = execSync('tailscale status --json', { encoding: 'utf-8' })
|
||||
const statusJson = execSync('tailscale status --json', { encoding: 'utf-8', timeout: 10_000 })
|
||||
const status = JSON.parse(statusJson)
|
||||
hostname = String(status.Self.DNSName).replace(/\.$/, '')
|
||||
log.debug({ hostname }, 'Resolved Tailscale hostname')
|
||||
@ -45,7 +52,8 @@ export class TailscaleTunnelProvider implements TunnelProvider {
|
||||
return
|
||||
}
|
||||
|
||||
const urlPattern = /https:\/\/[^\s]+/
|
||||
// Match only Tailscale funnel URLs (*.ts.net pattern)
|
||||
const urlPattern = /https:\/\/[a-zA-Z0-9-]+\.[a-zA-Z0-9-]+\.ts\.net/
|
||||
|
||||
const onData = (data: Buffer) => {
|
||||
const line = data.toString()
|
||||
@ -73,23 +81,40 @@ export class TailscaleTunnelProvider implements TunnelProvider {
|
||||
if (!this.publicUrl) {
|
||||
clearTimeout(timeout)
|
||||
if (hostname) {
|
||||
this.publicUrl = `https://${hostname}`
|
||||
// Tailscale funnel may exit immediately after configuring — construct URL with port
|
||||
this.publicUrl = `https://${hostname}:${localPort}`
|
||||
log.info({ url: this.publicUrl }, 'Tailscale funnel ready (constructed from hostname)')
|
||||
resolve(this.publicUrl)
|
||||
} else {
|
||||
reject(new Error(`tailscale exited with code ${code} before establishing funnel`))
|
||||
}
|
||||
} else {
|
||||
log.error({ code }, 'tailscale exited unexpectedly after establishment')
|
||||
this.child = null
|
||||
this.exitCallback?.(code)
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
async stop(): Promise<void> {
|
||||
if (this.child) {
|
||||
this.child.kill('SIGTERM')
|
||||
this.child = null
|
||||
log.info('Tailscale funnel stopped')
|
||||
const child = this.child
|
||||
if (!child) return
|
||||
this.child = null
|
||||
|
||||
child.kill('SIGTERM')
|
||||
|
||||
const exited = await Promise.race([
|
||||
new Promise<boolean>((resolve) => child.on('exit', () => resolve(true))),
|
||||
new Promise<boolean>((resolve) => setTimeout(() => resolve(false), SIGKILL_TIMEOUT_MS)),
|
||||
])
|
||||
|
||||
if (!exited) {
|
||||
log.warn('tailscale did not exit after SIGTERM, sending SIGKILL')
|
||||
child.kill('SIGKILL')
|
||||
}
|
||||
|
||||
log.info('Tailscale funnel stopped')
|
||||
}
|
||||
|
||||
getPublicUrl(): string {
|
||||
|
||||
@ -10,6 +10,9 @@ import { TailscaleTunnelProvider } from './providers/tailscale.js'
|
||||
|
||||
const log = createChildLogger({ module: 'tunnel-registry' })
|
||||
|
||||
const MAX_RETRIES = 5
|
||||
const BASE_RETRY_DELAY_MS = 2_000
|
||||
|
||||
export interface TunnelEntry {
|
||||
port: number
|
||||
type: 'system' | 'user'
|
||||
@ -18,6 +21,7 @@ export interface TunnelEntry {
|
||||
publicUrl?: string
|
||||
sessionId?: string
|
||||
status: 'stopped' | 'starting' | 'active' | 'failed'
|
||||
retryCount: number
|
||||
createdAt: string
|
||||
}
|
||||
|
||||
@ -34,6 +38,7 @@ interface LiveEntry {
|
||||
entry: TunnelEntry
|
||||
process: TunnelProvider | null
|
||||
spawnPromise: Promise<string> | null
|
||||
retryTimer: ReturnType<typeof setTimeout> | null
|
||||
}
|
||||
|
||||
const REGISTRY_PATH = path.join(os.homedir(), '.openacp', 'tunnels.json')
|
||||
@ -43,6 +48,7 @@ export class TunnelRegistry {
|
||||
private saveTimeout: ReturnType<typeof setTimeout> | null = null
|
||||
private maxUserTunnels: number
|
||||
private providerOptions: Record<string, unknown>
|
||||
private shuttingDown = false
|
||||
|
||||
constructor(opts: { maxUserTunnels?: number; providerOptions?: Record<string, unknown> } = {}) {
|
||||
this.maxUserTunnels = opts.maxUserTunnels ?? 5
|
||||
@ -61,7 +67,8 @@ export class TunnelRegistry {
|
||||
if (existing.entry.status === 'active' || existing.entry.status === 'starting') {
|
||||
throw new Error(`Port ${port} is already tunneled → ${existing.entry.publicUrl || 'starting...'}`)
|
||||
}
|
||||
// Stopped/failed entry — remove and re-add
|
||||
// Stopped/failed entry — clean up retry timer and re-add
|
||||
if (existing.retryTimer) clearTimeout(existing.retryTimer)
|
||||
this.entries.delete(port)
|
||||
}
|
||||
|
||||
@ -80,10 +87,32 @@ export class TunnelRegistry {
|
||||
label: opts.label,
|
||||
sessionId: opts.sessionId,
|
||||
status: 'starting',
|
||||
retryCount: 0,
|
||||
createdAt: new Date().toISOString(),
|
||||
}
|
||||
|
||||
const provider = this.createProvider(opts.provider)
|
||||
|
||||
// Wire up post-establishment crash detection with auto-retry
|
||||
provider.onExit((code) => {
|
||||
if (this.shuttingDown) return
|
||||
const live = this.entries.get(port)
|
||||
if (!live) return
|
||||
|
||||
live.entry.status = 'failed'
|
||||
live.process = null
|
||||
this.scheduleSave()
|
||||
|
||||
if (live.entry.retryCount < MAX_RETRIES) {
|
||||
const delay = BASE_RETRY_DELAY_MS * Math.pow(2, live.entry.retryCount)
|
||||
log.warn({ port, code, retry: live.entry.retryCount + 1, maxRetries: MAX_RETRIES, delayMs: delay },
|
||||
'Tunnel crashed, scheduling retry')
|
||||
live.retryTimer = setTimeout(() => this.retry(port, opts), delay)
|
||||
} else {
|
||||
log.error({ port, code }, `Tunnel crashed and exhausted all ${MAX_RETRIES} retries`)
|
||||
}
|
||||
})
|
||||
|
||||
const spawnPromise = provider.start(port).then(url => {
|
||||
entry.publicUrl = url
|
||||
entry.status = 'active'
|
||||
@ -97,7 +126,7 @@ export class TunnelRegistry {
|
||||
throw err
|
||||
})
|
||||
|
||||
this.entries.set(port, { entry, process: provider, spawnPromise })
|
||||
this.entries.set(port, { entry, process: provider, spawnPromise, retryTimer: null })
|
||||
this.scheduleSave()
|
||||
|
||||
// Await spawn — caller gets the URL or error
|
||||
@ -105,6 +134,54 @@ export class TunnelRegistry {
|
||||
return entry
|
||||
}
|
||||
|
||||
private async retry(port: number, opts: {
|
||||
type: 'system' | 'user'
|
||||
provider: string
|
||||
label?: string
|
||||
sessionId?: string
|
||||
}): Promise<void> {
|
||||
if (this.shuttingDown) return
|
||||
const live = this.entries.get(port)
|
||||
if (!live) return
|
||||
|
||||
const retryCount = live.entry.retryCount + 1
|
||||
log.info({ port, retry: retryCount, maxRetries: MAX_RETRIES }, 'Retrying tunnel')
|
||||
|
||||
// Remove old entry so add() doesn't reject
|
||||
if (live.retryTimer) clearTimeout(live.retryTimer)
|
||||
this.entries.delete(port)
|
||||
|
||||
try {
|
||||
const entry = await this.add(port, opts)
|
||||
entry.retryCount = retryCount
|
||||
} catch (err) {
|
||||
log.error({ port, err: (err as Error).message, retry: retryCount }, 'Tunnel retry failed')
|
||||
|
||||
// Re-insert as failed with incremented retry count for next onExit cycle
|
||||
const failedEntry: TunnelEntry = {
|
||||
port,
|
||||
type: opts.type,
|
||||
provider: opts.provider,
|
||||
label: opts.label,
|
||||
sessionId: opts.sessionId,
|
||||
status: 'failed',
|
||||
retryCount,
|
||||
createdAt: live.entry.createdAt,
|
||||
}
|
||||
|
||||
if (retryCount < MAX_RETRIES) {
|
||||
const delay = BASE_RETRY_DELAY_MS * Math.pow(2, retryCount)
|
||||
const retryTimer = setTimeout(() => this.retry(port, opts), delay)
|
||||
this.entries.set(port, { entry: failedEntry, process: null, spawnPromise: null, retryTimer })
|
||||
log.warn({ port, retry: retryCount + 1, delayMs: delay }, 'Scheduling next retry')
|
||||
} else {
|
||||
this.entries.set(port, { entry: failedEntry, process: null, spawnPromise: null, retryTimer: null })
|
||||
log.error({ port }, `Tunnel exhausted all ${MAX_RETRIES} retries`)
|
||||
}
|
||||
this.scheduleSave()
|
||||
}
|
||||
}
|
||||
|
||||
async stop(port: number): Promise<void> {
|
||||
const live = this.entries.get(port)
|
||||
if (!live) return
|
||||
@ -113,6 +190,9 @@ export class TunnelRegistry {
|
||||
throw new Error('Cannot stop system tunnel')
|
||||
}
|
||||
|
||||
// Cancel any pending retry
|
||||
if (live.retryTimer) clearTimeout(live.retryTimer)
|
||||
|
||||
// Wait for spawn to finish if still starting
|
||||
if (live.spawnPromise) {
|
||||
try { await live.spawnPromise } catch { /* ignore spawn error */ }
|
||||
@ -147,7 +227,10 @@ export class TunnelRegistry {
|
||||
}
|
||||
|
||||
async shutdown(): Promise<void> {
|
||||
this.shuttingDown = true
|
||||
|
||||
for (const [, live] of this.entries) {
|
||||
if (live.retryTimer) clearTimeout(live.retryTimer)
|
||||
if (live.spawnPromise) {
|
||||
try { await live.spawnPromise } catch { /* ignore */ }
|
||||
}
|
||||
|
||||
@ -36,12 +36,12 @@ export class TunnelService {
|
||||
const port = this.config.port + i
|
||||
const server = serve({ fetch: app.fetch, port })
|
||||
|
||||
const ok = await new Promise<boolean>((resolve) => {
|
||||
server.on('listening', () => resolve(true))
|
||||
server.on('error', () => resolve(false))
|
||||
const result = await new Promise<{ ok: boolean; code?: string }>((resolve) => {
|
||||
server.on('listening', () => resolve({ ok: true }))
|
||||
server.on('error', (err: NodeJS.ErrnoException) => resolve({ ok: false, code: err.code }))
|
||||
})
|
||||
|
||||
if (ok) {
|
||||
if (result.ok) {
|
||||
this.server = server
|
||||
actualPort = port
|
||||
if (i > 0) {
|
||||
@ -52,10 +52,17 @@ export class TunnelService {
|
||||
}
|
||||
|
||||
server.close()
|
||||
|
||||
// EACCES = permission denied — retrying other ports won't help
|
||||
if (result.code === 'EACCES') {
|
||||
log.error({ port }, 'Permission denied binding to port (try a port > 1024)')
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
if (!this.server) {
|
||||
log.warn({ port: this.config.port }, 'Could not find available port for tunnel HTTP server')
|
||||
log.error({ port: this.config.port }, 'Failed to start tunnel HTTP server — no available port')
|
||||
this.startError = `HTTP server failed to bind (tried ports ${this.config.port}-${this.config.port + maxRetries - 1})`
|
||||
return `http://localhost:${this.config.port}`
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user