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

File download not routed to correct path #1049

Closed
dcnadler opened this issue Dec 22, 2021 · 2 comments
Closed

File download not routed to correct path #1049

dcnadler opened this issue Dec 22, 2021 · 2 comments
Labels
bug Something isn't working

Comments

@dcnadler
Copy link
Contributor

Description

For v. 0.3.0, when launching as a directory, clicking on a file link (displayed by FileLink) in an app it does not forward to expected path of /voila/files/my_report.html.

The user is instead taken to /voila/render/my_report.html

This does not happen with v. 0.2.16

Reproduce

Files:

  • docker-compose.yml
  • Dockerfile
  • requirement.txt
  • test.ipynb

requirements.txt

voila
notebook

or

voila<0.3
notebook

test.ipynb

from IPython.display import display, FileLink
fpath = './my_report.html'
with open(fpath, "w") as f:
    f.write('<h1>My Report</h1>\n')
    f.write('All the details\n')
display(FileLink(fpath))

Dockerfile

FROM python:3.8

COPY requirements.txt /app/

WORKDIR /app
RUN pip install --upgrade pip && pip install --no-cache-dir -r requirements.txt

COPY . /app/

CMD voila . --Voila.ip=0.0.0.0 --VoilaConfiguration.file_whitelist="['.*.html']"

docker-compose.yml

version: '3.7'

services:
  app:
    build: .
    image: voila-test
    ports:
      - 8866:8866
    volumes:
      - .:/app

Run app with docker-compose up, access at localhost:8866. Click on link test.ipynb link to access that app.

Expected behavior

For both voila 0.2 and 0.3, a hyperlink shows up after launching the app that points to:
http://localhost:8866/voila/render/my_report.html

For v 0.2.16, it redirects to: http://localhost:8866/voila/files/my_report.html

For v 0.3.0, however, it does not forward so you get a 500 error at http://localhost:8866/voila/render/my_report.html

I didn't notice this issue when launching as an individual notebook, only as a directory.

Thank you!

@dcnadler dcnadler added the bug Something isn't working label Dec 22, 2021
@trungleduc
Copy link
Member

Thanks for your report, I can reproduce this bug, I'll take a look at it.

@trungleduc
Copy link
Member

Fixed by #1073

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants