-
-
Notifications
You must be signed in to change notification settings - Fork 2
Home
Greg Bowler edited this page Aug 1, 2022
·
9 revisions
This repository allows you to store all application configuration within an INI file, separated by named sections. The default, non-sensitive config values can be stored within the config.ini
file, and extra values can be injected in by deploying special override files during the build pipeline, or manually.
An example config.ini
file looks like this:
[app]
namespace=MyApp
[database]
driver=mysql
host=localhost
schema=myapp
port=3306
username=app_user
password=app_pass
[stripe]
api_key=pk_test_80dbaff1f54f61fe104ce87832ae6c4e
secret_key=sk_test_de297e4be8dbc589d309ba04541d58db
In production, a config.prod.ini
file can be generated that only overrides the keys that need to be different in production. This can be handled as part of the build pipeline:
[database]
host=live-db.example.com
username=live-example
password=260d153ad1bc8b5b
[stripe]
api_key=pk_live_b3d585b7ef94ba3f2fe0645e046834e2
secret_key=sk_live_322c5de70ec80aa99c33280b0b8516fe