ArtesiaWater / field_form

An iOS and Android app to perform location-bound measurements in the field
MIT License
7 stars 2 forks source link

relative vs absolute path behavior #9

Open tob123 opened 2 years ago

tob123 commented 2 years ago

Hello,

first of all thx for developing this app and providing support for sftp. I have some issues to get started and see some strange behavior regarding paths..: steps to reproduce:

issue 1: can choose folder of only one level deeper than is configured at hostname. in the app:

issue 2: upl / download uses relative path

according to logs i see the app tries to download <folder_part_setup_inhostname//locations.json (but without the forward / at the start. as such it tries to download in case of scenario 1a where hostname is setup to myhostname.nl and folder is setup to /home: it tries to retrieve "home/locations.json" (which points to /home/my_user/home/locations.json instead of /home/locations.json)

to see what was going on i setup sftp-server by adding -l INFO in /etc/sshd_config as dscribed here: https://serverfault.com/questions/73319/sftp-logging-is-there-a-way

rubencalje commented 1 year ago

Hi @tob123, sorry for the late reply. You describe the way the app is supposed to work. If you want to use a folder deeper than the root directory, you should add the parent of this folder to hostname.

Basically. the issue you have is that when you use a folder called 'home', the app goes to a deeper directory, because the name 'home' refers to special location on the ftp-server? Not sure if this can easily be fixed. I would recommend renaming the folder to a name other than 'home', bus you have probably thought about this yourself.