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

interactivetools_shorten_url: true is not taken into account when token is shared with sqlite #15224

Closed
Lain-inrae opened this issue Dec 16, 2022 · 0 comments

Comments

@Lain-inrae
Copy link
Contributor

Lain-inrae commented Dec 16, 2022

Describe the bug
When galaxy generates token for gxit, the token is 32 chars long, if interactivetools_shorten_url is false.
This token should be 10 chars long when interactivetools_shorten_url is true (as it is in the url).
So, when we try to access a gxit located at:
xxxxxxxxxxxxxxxx-0123456789.interactivetool.domain
the gx-it-proxy tries to find the token 0123456789.
But what is written in the sqlite file is the 32 chars long token and gx-it-proxy fails with
No target found for xxxxxxxxxxxxxxxx-0123456789.interactivetool.domain GET /

Galaxy Version and/or server at which you observed the bug
Galaxy Version: 22.01
Commit: origin/release_22.01 - 7a9e83c

To Reproduce
Steps to reproduce the behavior:
I deactivated gx-it-proxy in config, so I could run it from terminal (helped me find the source of the bug)

  • set interactivetools_shorten_url to true (in config/galaxy.yml)
  • activate interactive tools
  • galaxy$ ./run.sh
  • galaxy$ . ./.venv/bin/activate
  • galaxy$ npx gx-it-proxy --sessions ./database/interactivetools_map.sqlite --ip 0.0.0.0 --port 4002 --verbose
  • run a interactive tool
    (they work when interactivetools_shorten_url is false)

Expected behavior
Iteractive tool runs,
galaxy transferts token using sqlite file
gx-it-proxy reads it and proxies the gxit
the gxit is served and accessible

Additional context
Bug found on a server, but reproduced in dev env (commit 6db3224)

I think it can be fixed in /lib/galaxy/managers/interactivetool.py:InteractiveToolSqlite.save, where the config should be accessed to know if the token have to be cut down to 10 chars.

Thank you!

Lain-inrae added a commit to Lain-inrae/galaxy that referenced this issue Dec 19, 2022
… chars when interactivetools_shorten_url is true
Lain-inrae added a commit to Lain-inrae/galaxy that referenced this issue Jan 2, 2023
… chars when interactivetools_shorten_url is true
Lain-inrae added a commit to Lain-inrae/galaxy that referenced this issue Jan 2, 2023
… chars when interactivetools_shorten_url is true
martenson added a commit that referenced this issue Jan 3, 2023
…_15224

[22.05] Fixes #15224 - tools token are created with a size of 10 chars when interactivetools_shorten_url is true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant