It looks like you should provide a sample file for the user / administrator to modify for your personal environment, and then populate the environment from this, avoiding possibly having this file with sensitive information in the repository. Note. Regarding file security, you need to decide where the file is located, as well as your operating system and server software.
If so, you can provide a file containing a template of what you need from the administrator / user of the program you are setting up.
Ruby has an ENV constant that acts like a Hash and contains the shell environment used.
As an example, you can find a file called environment.rb.sample that will be shared with someone. It contains instructions and contains a template that users can freely change, with instructions for copying the file to environment.rb . An example file is as follows:
# environment.rb.sample
Then the file is copied to this file, perhaps:
# environment.rb ENV['temp_user_name'] = 'Joe Admin' ENV['temp_password'] = 'Super Secure Password'
The file that downloads it and uses it is just a Ruby file that is freely modified by the user / administrator of the software and looks like this, as well as publicly available.
# load_environment require './environment' puts ENV['temp_user_name'] puts ENV['temp_password']
Loads the file and uses ENV , which is a constant limited to global areas for the application.
The file permissions are then controlled by the user / system administrator and protected like any other confidential information in their system. A sensitive file must also be specified in the repository ignore mechanism. It should never be published.
source share