AMP icon indicating copy to clipboard operation
AMP copied to clipboard

SFTP address for instance using AMP's host, not the instances.

Open cross opened this issue 4 years ago • 2 comments

Bug Report

System Information

  • Ubuntu 20.04
  • AMP 2.3.0.4

I confirm:

  • [x] that I have searched for an existing bug report for this issue.
  • [x] that I am using the latest available version of AMP.
  • [x] that my operating system is up-to-date.

Symptoms

  • What are you trying to do? SFTP to an area in an instances File Manager
  • What are you expecting to happen? To be given an sftp:// URL that works
  • What is actually happening? ('Nothing' is not an acceptable answer!) I'm given an sftp:// URL containing the amp server name as host, but the instance is running on a different IP address. If I change the host element of the sftp:// URI to be the IP address of the instance, the SFTP connection works.

Reproduction

  • Install amp with a name/address.
  • Having multiple IP addresses on your server, set the default instance address to one other than the hostname/IP AMP is configured to use.
  • Create an instance (Minecraft Java in my case, though others likely the same)
  • Manage that instance
  • Go to File Manager
  • Click the SFTP icon

The presented dialog for me says:

Full Address | sftp://[email protected]:2224/
-- | --
Host | amp.distal.com
Port | 2224
Username | cross

However, amp.distal.com resolves to the main address for amp and that server, and the instance is running on a different IP address. So the above URL will not connect. The instance address should be used in SFTP in the instance File Manager.

cross avatar Dec 04 '21 03:12 cross

This may be related to #352 , but seems different, as that one seems specific to IPv6, which this isn't. So I want to mention it here, but I think it's not the same issue.

cross avatar Dec 04 '21 03:12 cross

Yep, this is a known limitation. The “connect to SFTP” button just uses the domain/IP shown in the browser URL. This of course breaks in cases like yours, or cases like mine where my nginx reverse proxy is on a separate host - so the SFTP button attempts to connect to the nginx host, rather than the AMP host. @PhonicUK has in the past indicated that he might look at introducing logic to pick the IP that the instance is actually running on, but no changes yet. Alternatively an option to explicitly set the IP for SFTP would work

Greelan avatar Dec 04 '21 21:12 Greelan

This was addressed in #760.

IceOfWraith avatar Dec 28 '22 16:12 IceOfWraith