I want to know how can I prevent users to download the code from Git Hub for example, search in the code for a premium variable or something similar and change it to true, rebuild the project and boom, premium plan without paying.

I was thinking on making requests to a server with a token given to premium users but this also can be deleted from the code.

The app is an Electron webapp with free plan and a premium with more features.

  • 7
    If you want to sell a premium version, then don't upload its code to Github. Only upload the code of the free version. Of course that means your premium version isn't FLOSS, so you can't depend on any copyleft libraries. – curiousdannii Nov 1 '17 at 23:31
  • Also, it would be a good way to have the information about premium plan into a DB. I don't know how your application works but if you happen to use a DB then I would store the premium users information there. – Luca De Nardi Nov 3 '17 at 16:11
  • @curiousdannii Your suggestion it's ok, but I think some users can complain about that missing code in the repo. Luca De Nardi Yes, I will have a DB with all the premium users but that means that I have to make a request every X time to my server to check if the user still in the premium plan but that request its code and it can be erased. – Roberto Piazza Nov 3 '17 at 17:31
  • They can complain about missing code in the repo as much as they like. So long as you've got your licensing right, it's your code and you can do what you like with it. – Philip Kendall Nov 4 '17 at 13:05
  • 1
    Offer premium features which aren't only dependent on a variable in the code. For example, you could offer more server resources for your premium plan, extra support access, etc. If they want it for free, they would have to set up and maintain their own servers. – Brandin Nov 6 '17 at 15:23

It's even worse: An open source license would allow anyone to not just make that change for their own use but in fact release the premium version for free on their own website.

And that check you are considering could be dummied out just as easily.

The pay-per-install business model simply doesn't work for open source software. For alternative business models which might work for you, check out the question "How can large open source projects be monetized?".

You could also make only the free version open source and the premium version proprietary. The free version would then simply lack the sourcecode of the premium features. But that's of course only possible when every part of the software is either your own intellectual property or used under non-copyleft open source licenses. In the context of web applications you can implement crucial parts of the premium-exclusive features as webservices on the server and only allow paying users to access them.

  • You can run GPLed code on a server and not have to distribute it. That's what the Affero GPL is designed to guard against. If you're using a GPL variant that isn't Affero, write your proprietary stuff, link it to the GPLed code, call the whole thing GPLed, and don't distribute it. It remains as what Stallman called private code, and nobody else has any rights to it. – David Thornley Oct 5 '18 at 21:57

As others have pointed out, the secret here is to keep your proprietary source proprietary. What no one has mentioned is how. You'll need a plug-in architecture to achieve this properly. Make your proprietary code a plug-in to the open source code base.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.