I have some website, and I am planning register/login using MySQL for it. My website is licensed under GNU GPLv3.
Is there some way to let users see source code, but to still have the database safe (e.g. keep the php file with MySQL password unpublished)? I really want to share my code, but I don’t want to somebody stealing data from my db.
My website isn’t e-bank or something, but it can still contain sensitive data.
I am sorry for the license question, but I searched stackexchange for an hour and couldn’t find a better place to ask
If it is your original code, you are free to choose which part to distribute under GPL. Also, if you configure and set up the code on a webserver, you are not distributing a modified version in the terms of the GPL.
The actual solution then is really simple: don’t include the credentials in the distributed code.
Have a look at how WordPress does it: they include a
wp-config-sample.phpfile, which includes most settings with sane default values. But the database connection is empty. Users just copy this example towp-config.phpand add their needed values for the database connection.