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.
This commit is contained in:
2026-07-08 12:53:02 +05:00
parent 4350915b30
commit 1337175e5d
4 changed files with 17 additions and 37 deletions

1
.gitignore vendored
View File

@@ -21,6 +21,7 @@ coverage.html
!.env.example
config.local.yaml
config.yaml
!config.example.yaml
# Logs
logs/

View File

@@ -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: <your-jwt-secret>
storage:
host: main-db # use localhost when running outside Docker
port: 5432
database: bank_db
username: bank_admin
password: <password>
pg_pool_max_conn: 10
public_file_path: ./public
app_version: 0.0.1
```
> **Note:** Replace default credentials before deploying to production.

15
config.example.yaml Normal file
View File

@@ -0,0 +1,15 @@
is_debug: true
listen:
type: port
bind_ip: 0.0.0.0
port: 5050
jwt_key: <your-jwt-secret>
storage:
host: example-db # use localhost when running outside Docker
port: 5432
database: example_db
username: example_username
password: <your-db-password>
pg_pool_max_conn: 10
app_version: 0.0.1
public_file_path: ./public

View File

@@ -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