Skip to content

SSH reverse tunnel should use dynamic port allocation #1

Description

@markusfurtlehner

Problem

The SSH reverse tunnel in ssh-manager.ts hardcodes port 3000 on the remote side and 3010 on the local side:

await this.setupReverseTunnel(config.id, 3000, 3010);

This has two issues:

  1. The local port should use WEB_PORT (now configurable via ATOO_PORT env var) instead of hardcoded 3010
  2. The remote port (3000) might already be in use on the remote machine — it should be dynamically allocated

Suggested approach

  1. Request port 0 on the remote side so SSH picks a free port
  2. Pass the allocated port as ATOO_PORT env var when spawning the agent on the remote machine, so the MCP server connects to the correct tunneled port

Context

Remote agent spawning over SSH is not fully wired up yet — the reverse tunnel is prep work. This should be addressed when implementing SSH remote agents.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions