ncrocfer/whatportis

Store service names and ports in a JSON/YAML file?

brouberol opened this issue · 6 comments

IMHO, you should store the service name and ports in a human-readable serialized file, to lower the bar of contribution. Indeed, it seems waaay easier to submit a PR in the github web interface by adding a line in a JSON file, than adding a row in a sqlite file.

What do you think? I'd be more than happy to do this in a PR, in the format of your choice.

Actually my first idea was to make a tool based on the IANA database (so no customization), but it seems to be a feature requested by many users :)

However I wonder if performance will be the same : search a pattern through a long JSON file is not the same as a simple SELECT query.
Do you have an optimize method in mind rather than a complete for loop ? I will be of course happy to merge your PR.

For contributions, I think it would be nice to have a new column, named Official for example, with a boolean value ("Yes" for IANA ports, "No" for contributions).

What do you think ?

@scalp42 this is actually the file I use to generate the database :)

Sorry about the silence. I can probably make a PoC using JSON/CSV and regular expressions for the LIKE, if you feel like the pros will outmatch the cons. Up to you :)

Yes no problem, it's ok for me.

I've played around with CSV and JSON, but I'm not convinced by the fact that the project would be better off. The code gets more complex and harder to follow. I'm closing this one.