platformsh / legacy-cli

This is the legacy version of Platform.sh's command-line interface. The new version is at: https://github.com/platformsh/cli
https://docs.platform.sh/administration/cli.html
MIT License
224 stars 121 forks source link

Opening a SSH tunnel to Solr service provides incorrect URL #1443

Open rhubinak opened 2 months ago

rhubinak commented 2 months ago

Both tunnel:open and tunnel:single give URL that returns 404:

upsun tunnel:open -p zzyyd54xpaq5m
Are you sure you want to open SSH tunnel(s) to the environment main (type: production)? [Y/n] 

SSH tunnel opened to solr at: http://127.0.0.1:30000/solr/collection1

Logs are written to: /home/rh/.upsun-cli/tunnels.log

List tunnels with: upsun tunnels
View tunnel details with: upsun tunnel:info
Close tunnels with: upsun tunnel:close

Save encoded tunnel details to the PLATFORM_RELATIONSHIPS variable using:
  export PLATFORM_RELATIONSHIPS="$(upsun tunnel:info --encode)"
upsun tunnel:single -p zzyyd54xpaq5m        
Are you sure you want to open an SSH tunnel to the relationship solr on the environment main (type: production)? [Y/n] 

SSH tunnel opened to solr at: http://127.0.0.1:30000/solr/collection1
curl -IL http://127.0.0.1:30000/solr/collection1/
HTTP/1.1 404 Not Found
Content-Security-Policy: default-src 'none'; base-uri 'none'; connect-src 'self'; form-action 'self'; font-src 'self'; frame-ancestors 'none'; img-src 'self' data:; media-src 'self'; style-src 'self' 'unsafe-inline'; script-src 'self'; worker-src 'self';
X-Content-Type-Options: nosniff
X-Frame-Options: SAMEORIGIN
X-XSS-Protection: 1; mode=block
Cache-Control: must-revalidate,no-cache,no-store
Last-Modified: Fri, 11 Nov 2022 07:31:28 GMT
Content-Type: text/html
Accept-Ranges: bytes
Content-Length: 96

Correct URL should be http://127.0.0.1:30000/solr/

curl -IL http://127.0.0.1:30000/solr/
HTTP/1.1 200 OK
Content-Security-Policy: default-src 'none'; base-uri 'none'; connect-src 'self'; form-action 'self'; font-src 'self'; frame-ancestors 'none'; img-src 'self' data:; media-src 'self'; style-src 'self' 'unsafe-inline'; script-src 'self'; worker-src 'self';
X-Content-Type-Options: nosniff
X-Frame-Options: SAMEORIGIN
X-XSS-Protection: 1; mode=block
X-Frame-Options: DENY
Content-Type: text/html;charset=utf-8
Content-Length: 17035

Maybe a special case for Solr service has to be made in https://github.com/platformsh/legacy-cli/blob/main/src/Command/Tunnel/TunnelCommandBase.php#L188 ?