Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
warownia1 opened this issue Sep 8, 2023 · 0 comments

Comments

@warownia1
Copy link
Collaborator

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.

warownia1 added a commit that referenced this issue Apr 5, 2024
Home paths provided in the -h parameter or SLIVKA_HOME were used
as is without resolving symlinks. On the other hand, os.getcwd
and paths to input and output files were formed with os.realpath
which resolved all symlinks.
It was actually a problem with an api code converting paths to
ids in a hacky way, but changing all paths to real paths works too.
Fix #129
@warownia1 warownia1 moved this to Done in Slivka 0.8 release Apr 9, 2024
@warownia1 warownia1 moved this from Done to Ready to Merge in Slivka 0.8 release Apr 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Ready to Merge
Development

No branches or pull requests

1 participant