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

Support [F-Droid] custom repos #10792

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

Conversation

cyb3rko
Copy link
Contributor

@cyb3rko cyb3rko commented Jan 6, 2025

Closes #9649

Copy link
Contributor

github-actions bot commented Jan 6, 2025

Messages
📖 ✨ Thanks for your contribution to Shields, @cyb3rko!

Generated by 🚫 dangerJS against 2cb8146

@jNullj jNullj changed the title Support |F-Droid] custom repos Support [F-Droid] custom repos Jan 6, 2025
@jNullj jNullj added the service-badge New or updated service badge label Jan 6, 2025
Copy link
Member

@jNullj jNullj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey, thank you for the PR.
Here are some early review points.

Comment on lines +19 to +20
serverFqdn: Joi.string().hostname(),
endpoint: Joi.string(),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shouldn't we merge these two into one input? just endpoint, there is no need to split here.

Also i think Joi.string() is too loose for part of a url and could intrudoce invalid input that passes this test.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would rather keep it separate, as they are different components in the URL.
If we would combine them, how would you call it to not confuse the user?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're right about the endpoint format. What about "relativeUri" from validators.js?
It seems other services use the same validator for paths.

Copy link
Member

@jNullj jNullj Jan 6, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In other services we use something like gitea_url or gitlab_url
i propose using something similar.
notice that in some tests the base url can even include get params.
also you can use the optionalUrl for the schema.

we could keep the project consistency and use fdroid_url here

i recommend you to take a look at one of the services already using hosted instances like gitea

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Passing the full URL does not feel right.
Especially with #2637 in mind, at least the protocol should be hard-coded to https.

The way Matrix (https://shields.io/badges/matrix) badges do it seems much better and "cleaner" for the user.

Copy link
Member

@jNullj jNullj Jan 7, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for highlighting #2637. It seems like a valuable addition that could be implemented as a project-wide feature. While you can explore this idea in the current PR, I believe it would be better to separate these two subjects and ensure each PR focuses on a single topic for clarity and maintainability.

As a temporary solution, you could consider introducing a new validator, optionalUrlHttps, in validators.js. This would address the immediate need without over complicating this PR.

Regarding the Matrix badges, it uses only the FQDN for the host/endpoint. The mode parameter, however, serves a distinct purpose—it separates result types and facilitates different goals beyond accessing the endpoint. The key takeaway here is that mode provides functionality tied to achieving separate objectives.

Could you provide an example where your proposed endpoint achieves a distinct goal separate from simply accessing the same information? For comparison, consider how the Matrix badge's separation of FQDN and mode addresses two clearly different goals.

services/f-droid/f-droid.tester.js Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
service-badge New or updated service badge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Fdroid version badge but for custom fdroid repos
2 participants