EDIT:
Those posting content on Reddit retain the rights to their content. They give Reddit a license to do certain things to their content, but this license is solely to Reddit, not the general public.
If you want to do what you do legally, you have to ask for permission of every single person whose content you have included in your ebook. Depending on the jurisdiction, you probably can legally compile a list of links to interesting content and publish that, but certainly not the contents themselves.
Now I am questioning whether this kind of disregard for copyright goes further than the ebook. For example, does your software use GPL code without complying with GPL?