From 1337175e5d1d0195fc59e7a98832265457bf53a7 Mon Sep 17 00:00:00 2001 From: GuwandykA Date: Wed, 8 Jul 2026 12:53:02 +0500 Subject: [PATCH] Stop tracking config.yaml and document config via example file config.yaml carried real secrets (jwt_key, DB password) despite already being listed in .gitignore. Untrack it, add config.example.yaml with placeholder values, and point the README setup steps at the example file. --- .gitignore | 1 + README.md | 22 +--------------------- config.example.yaml | 15 +++++++++++++++ config.yaml | 16 ---------------- 4 files changed, 17 insertions(+), 37 deletions(-) create mode 100644 config.example.yaml delete mode 100755 config.yaml diff --git a/.gitignore b/.gitignore index dd50f5b..fc296ee 100644 --- a/.gitignore +++ b/.gitignore @@ -21,6 +21,7 @@ coverage.html !.env.example config.local.yaml config.yaml +!config.example.yaml # Logs logs/ diff --git a/README.md b/README.md index 0c945d9..d64587d 100755 --- a/README.md +++ b/README.md @@ -110,7 +110,7 @@ The API will be available at `http://localhost:5050`. 1. Start PostgreSQL (or use `docker compose up main-db -d`). -2. Update `config.yaml` — set `storage.host` to `localhost` and match your database credentials. +2. Copy `config.example.yaml` to `config.yaml`, set `storage.host` to `localhost`, and fill in your database credentials and a JWT secret. 3. Apply migrations: @@ -130,26 +130,6 @@ The API will be available at `http://localhost:5050`. go run app.go ``` -## Configuration - -Settings are loaded from `config.yaml`: - -```yaml -is_debug: true -listen: - port: 5050 -jwt_key: -storage: - host: main-db # use localhost when running outside Docker - port: 5432 - database: bank_db - username: bank_admin - password: - pg_pool_max_conn: 10 -public_file_path: ./public -app_version: 0.0.1 -``` - > **Note:** Replace default credentials before deploying to production. diff --git a/config.example.yaml b/config.example.yaml new file mode 100644 index 0000000..55c7554 --- /dev/null +++ b/config.example.yaml @@ -0,0 +1,15 @@ +is_debug: true +listen: + type: port + bind_ip: 0.0.0.0 + port: 5050 +jwt_key: +storage: + host: example-db # use localhost when running outside Docker + port: 5432 + database: example_db + username: example_username + password: + pg_pool_max_conn: 10 +app_version: 0.0.1 +public_file_path: ./public \ No newline at end of file diff --git a/config.yaml b/config.yaml deleted file mode 100755 index 1affccb..0000000 --- a/config.yaml +++ /dev/null @@ -1,16 +0,0 @@ -is_debug: true -listen: - type: port - port: 5050 -jwt_key: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpX@VCJ9.yueyJzdWIiOiIyNTEyNzMiLCJpYXQiOjE1MTYy#MzkwMjJ9.o_LoJm03CaE6!0dugdR8sjIuFgPxGT7I2W8NvugFqHRY -storage: - # host: localhost - host: main-db - # port: 5424 - port: 5432 - database: bank_db - username: bank_admin - password: bank@#23#@_password - pg_pool_max_conn: 10 -app_version: 0.0.1 -public_file_path: ./public