jakob / jakob/Postico

Pre-Connect Shell Script does not run within SSH session

Open
#889 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
485
Forks
8
PR merge metrics
No merged PRs in 30d

Description

You can use this template for reporting bugs.
Feel free to remove parts that are not relevant, or just write something free-form if you prefer.

## What did you do?

I selected "Connect via SSH Tunnel" and "Pre-Connect Shell Script"

- My SSH session is with user `ubuntu`
- My pre-connect script looks like:
```
cd ~
pwd >&2
exit 1
```

## What did you expect to happen?

Per https://eggerapps.at/postico2/documentation/connection-preconnect-script.html,

> The pre-connect shell script is executed just before Postico connects to the PostgreSQL server. If you are using an SSH tunnel, the script is executed after the SSH tunnel has been established.

Therefore, I expected an error with the logged out directory to be `/home/ubuntu`, as it is when I ssh into the box and do `pwd` from the home

## What actually happened?

The pre-connect runs on my local machine, as evidenced by not finding the file with my MacOS path in the error message as opposed to the linux path within the machine I've SSH'ed into.

```
Command failed with status 1:
/Users/mymacusername
```

## What software versions are you using?

Postico version:
Version 2.1.2 (9702)

macOS version:
Version 13.1 (22C65)

PostgreSQL version:
(execute the command "SELECT VERSION();" to find out)

Not relevant

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reproducing the issue with a PostgreSQL connection using an SSH tunnel and the reported pre-connect script, comparing the local and remote working directories. Done means the script runs on the SSH host after the tunnel is established and reports `/home/ubuntu` rather than the local macOS path.

Written by the indexing model from the issue text.

Assessment

Tech stack
macos, postgresql, shell
Domain
databases, desktop, networking
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.