bartongroup / slivka

http://bartongroup.github.io/slivka/
Apache License 2.0
7 stars 3 forks source link

Slivka fails to resolve relative links if -h parameter points to a symlinked location. #129

Open warownia1 opened 10 months ago

warownia1 commented 10 months ago

When the server is started using the home directory which is an indirect symlink to another location, then the app is unable to properly resolve paths to files under uploads and jobs directories. In particular, the _job_resource method returns a PosixPath object under the parameters because convert_path does not recognise the real file path as being under the jobs/uploads directory. This results in the ValueError raised when the path is converted to JSON.

e.g. given the directory structure

/www/slivka/slivka-project/
    media/
        jobs/
        uploads/
    settings.yaml
    ...
/home/slivka -> /www/slivka

running slivka start -h '/home/slivka/slivka-project' server causes issues with path resolution. However, running it from /home/slivka/slivka-project without specifying --home directory explicitly does not. Running slivka start -h $(readlink -f '/home/slivka/slivka-project') server works well too.