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

Consider discouraging/prohibiting the use of hyphens in Appstream IDs, to match the DBus spec #162

Closed
Pointedstick opened this issue Dec 30, 2017 · 6 comments

Comments

@Pointedstick
Copy link

Right now AppStream recommends reverse-DNS-style IDs and supports the full range of rDNS characters, including hyphens anywhere (e.g. com.my-awesome-website.my-awesome-app).

However, DBus does not, and discourages the use of hyphens anywhere but the last element. So to be valid to DBus, that string would have to be com.my_awesome_website.my-awesome-app or com.myawesomewebsite.my-awesome-app.

This has caused a situation where the FileZilla developers adopted an AppStream ID with a hyphen in the middle (org.filezilla-project.FileZilla) that complies with the AppStream spec, but not the DBus spec. When I asked them to change their ID to remove the hyphen, they pointed out quite reasonably that it was a perfectly valid AppStream ID.

We might consider changing the AppStream spec for IDs to match the DBus spec and discourage or prohibit the use of hyphens anywhere but the last element to prevent this kind of confusion.

@smcv
Copy link
Contributor

smcv commented Jan 3, 2018

The D-Bus specification discourages hyphens everywhere, not just in the non-last components.

The Flatpak specification is the one that has a problem with hyphens in non-last elements. It forbids hyphens anywhere except the last element for some technical reason that I don't fully understand: I think it's something to do with wanting an app to be able to "export" multiple icons (com.example.App.png and com.example.App-symbolic.png) while guaranteeing an absence of collisions with other apps, although I'm not entirely sure how the restriction avoids the collisions.

@ximion
Copy link
Owner

ximion commented Jan 4, 2018

Yes, I agree with this as said in the discussion on the mailinglist. I just haven't had time to implement the result of that discussion, due to finishing a thesis and then a lot of other stuff happened too.
In any case, I hope I can make the necessary changes soon.

I will not make hyphens in IDs an error from the AppStream side (at least not for now), but I will add a warning to the specification and guides about this issue, and make appstreamcli validate throw out an info-type hint to notify about this, so people can fix their component-IDs.

@Pointedstick
Copy link
Author

Awesome, thanks folks.

@smcv
Copy link
Contributor

smcv commented Jan 4, 2018

to be valid to DBus, that string would have to be com.my_awesome_website.my-awesome-app

This is allowed but not recommended. com.my_awesome_website.my_awesome_app (or more conventionally, com.my_awesome_website.MyAwesomeApp) is preferred.

or com.myawesomewebsite.my-awesome-app

That's not valid, because the owner of my-awesome-website.com typically does not also own myawesomewebsite.com, so they have no way to know that the owner of myawesomewebsite.com won't release a different app with that name. Curated app-stores like Flathub should reject app IDs that are based on a domain not owned by the app's publisher.

@Pointedstick
Copy link
Author

This all came about because Flathub has taken the liberty of assigning Appstream IDs to certain apps that did not already provide them. One such example is FileZilla, which was assigned org.filezillaproject.Filezilla. I gather this is incorrect because filezillaproject != filezilla-project and should have been filezilla_project?

Either way, now Flathub uses org.filezillaproject.Filezilla and the FileZilla people use org.filezilla-project.FileZilla and this is a mess and I'm trying to figure out what to do about it.

@smcv
Copy link
Contributor

smcv commented Jan 4, 2018

One such example is FileZilla, which was assigned org.filezillaproject.Filezilla. I gather this is incorrect because filezillaproject != filezilla-project and should have been filezilla_project?

Yes, Flathub was wrong to apply that transformation. Nobody can own filezilla_project.org because underscores aren't allowed in domain names, so it can't possibly collide with a real domain name, which is why normalizing/escaping filezilla-project to filezilla_project is an OK thing to do. (Similarly, nobody can own _7_zip.org because domain name components can't start with underscores, so it's OK to escape 7-zip as _7_zip, which is the example I like to use in places like the D-Bus Specification.)

@Pointedstick Pointedstick changed the title Consider discouraging/prohibiting the use of hyphens anywhere but the last element for Appstream IDs, to match DBus spec Consider discouraging/prohibiting the use of hyphens in Appstream IDs, to match the DBus spec Jan 14, 2018
ximion added a commit that referenced this issue Jan 22, 2018
@ximion ximion closed this as completed in 6eb31c8 Jan 22, 2018
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

3 participants