2

Recently, I've been developing an open source proxy that has a client and a server. Both client and server have scripts.

The server end can be run on a cloud platform, and the client connects the server.

I registered an app on Heroku for debugging the server, and the address of that app is written in the client script temporarily.

This is the environment. But obviously the address of the server is just for personal debugging. I don't want to make it public.

My current method is, every time before I commit to the repository, I delete the address, and after commiting, I add that back. It is not a good manner evidently.

This phenomenon should be very common. How do people usually deal with that?

David Cain
  • 16,484
  • 14
  • 65
  • 75
shouya
  • 2,863
  • 1
  • 24
  • 45

2 Answers2

9

Have a configuration file (e.g. config.ini) that is excluded from git (i.e. add it to your project's .gitignore) and include a sample configuration (config.example.ini) instead.

Stefan
  • 109,145
  • 14
  • 143
  • 218
1

Store the information in an environment variable, or in a file outside the source tree.

For more complex projects, you can supply it as an argument to the build script.

ecatmur
  • 152,476
  • 27
  • 293
  • 366