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

Add functionality to list available profiles and download a single profile #752

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

pcace
Copy link

@pcace pcace commented Dec 21, 2024

This pull request adds new functionality to the BRouter server to support listing available profiles and downloading a single profile. it addresses: #749

The following changes have been made:

New Parameters:

getprofiles: Returns a list of available profiles in JSON format.
getprofiles/profilename.brf: Returns the content of the specified profile.

Updated Documentation:

The README section in ServerHandler.java has been updated to include the new parameters and example URLs.

Example URLs:

List available profiles:
http://localhost:17777/brouter/getprofiles

Download a specific profile:
http://localhost:17777/brouter/getprofiles/trekking.brf

Please review the changes and let me know if there are any questions or further improvements needed.

Thank you!

@afischerdev
Copy link
Collaborator

@pcace
Thanks for your PR.
But sorry, I don't understand the idea behind.

When you call for the folder content you will get also profiles that are not intended for routing only for database generation (all, dummy, softaccess). And there could be some other profiles from the server owner, that are not public and so they are not in the visible list box at the server.

When you call for a single profile, what is the need to have this profile?
When you like to use this profile on the server just call ...&profile=profile_name&...
When you like to build your own profiles you should use the originals from this git repository. And go on with your needs.
And there are other profiles that are not reachable over the server logic - download only over github.

@pcace
Copy link
Author

pcace commented Dec 22, 2024

Hi, no worries, i was expecting this a little bit - i was just breefly looking for the functionality to get the profiles from the server because i wanted to have the ability here: https://gpx.studio/app to use my own profiles. And since in this project the profiles are hardcoded, i thought it might be a good idea to have a way to ask the server what profiles it has. (so i changed it on my fork here: pcace/gpx.studio@2919bec)

To be honest, i had no idea that there can be profiles which are not intended for routing.

I am totally fine with you closing this here!

cheers and have a great christmas!

PS.: this is what i wanted to achieve - having my profiles in here:
Bildschirmfoto 2024-12-22 um 17 36 14

@zod
Copy link
Collaborator

zod commented Dec 22, 2024

Well brouter-web also needs those profiles but expects the server to provide them as download to allow customizing. There was also a similar PR in the past (#578), but the older PR and your PR both have the same weakness: They are vulnerable to directory traversal which would allow extracting files outside of the profiles directory (or custom profiles).

In general I think it makes sense to provide a list of profiles and eventually downloading them for customization, but without those pitfalls.

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

Successfully merging this pull request may close these issues.

3 participants