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

Automatic URL considered as invalid when creating ressource on local instance (http://127.0.0.1:7000) #3093

Open
rv2931 opened this issue Jul 18, 2024 · 3 comments

Comments

@rv2931
Copy link

rv2931 commented Jul 18, 2024

I'm testing udata with local docker stack
The domain name is so http://127.0.0.0.1:7000

When I try to create a new dataset for testing, I can't validate the ressource (CSV upload) because the URL that is generated is concidered as invalid
URL : http://127.0.0.1:7000/en/admin/dataset/new/
URL auto generated: http://127.0.0.1:7000/s/resources/dataset1/20240718-053900/ports.csv

Error message on URL field: Please enter a valid URL

Detailed Description

I've started from scrach a docker instance on local dev plateform
I've created an organsiation
when I try to create a new dataset based on a CSV, on the page asking to upload the file, I'm stuck with the error "Please enter a valid URL" for the resource, but no way to bypass as the field is read only
So finally I can't really test the dev instance

Context

The criterias of what is a valid URL is not given in question mark
Mayeb it is due to domain format nom:port or maybe it is due to presence of IP adress, or maybe 127.0.0.1
If it is, so this should be present in pre-requisite for mounting an instance
Or be more tolerant on domain name

Possible Implementation

Your Environment

This is docker stack based on podman
I'm on Windows 10 entreprise

  • Browser Name and version: Firefox 115.11.0esr (64 bits)
  • Operating System and version (desktop or mobile): desktop

Capture

@maudetes
Copy link
Contributor

Thank you for your ticket.

I think some configurations are needed in your udata.cfg to make it work with local URLs.
See this udata.cfg sample, with some properties that may be related with your issue:

URLS_ALLOW_LOCAL = True
URLS_ALLOWED_TLDS = Defaults.URLS_ALLOWED_TLDS | set(['local'])

RESOURCES_FILE_ALLOWED_DOMAINS = ['*']

I would also recommend using the dev.local:7000 URL locally as described in this documentation.

You may see more logs on the udata server backend?

@rv2931
Copy link
Author

rv2931 commented Jul 19, 2024

Thank you for the rapid answer
This configuration should solve my problem ! "RTFM"
For dns dev.local solution, basically I've not the permissions to edit hosts file on my machine

@rv2931
Copy link
Author

rv2931 commented Jul 23, 2024

So I checked. in fact it was already the configuration values I'm using as I followed the at first try
The only thing I can't do to follow completly the recommandations with my machine is to edit the domain name in etc/hosts to get dev.local:7000 but I tried with http://localhost:7000 and the result is the same. I'm on windows on professional computer and I'm not admin user
I tried with ports 80:7000 and http://localhost/... without port, this is the same invalid error message so this is not due to the host:port format
I tried with adding explicitly URLS_ALLOWED_SCHEMES=('http', 'https', 'ftp', 'ftps'), same error
I tried URLS_ALLOWED_TLDS = Defaults.URLS_ALLOWED_TLDS | set(['localhost']), same error

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

2 participants