Use example database credentials in config and Docker setup.
Replace bank_db/bank_admin with example_db/example_user in config.yaml, docker-compose, Makefile, and README so pushed templates do not expose real credentials. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
6
Makefile
6
Makefile
@@ -7,10 +7,10 @@ create-migration:
|
|||||||
migrate create -ext sql -dir db/migrations -tz Local init
|
migrate create -ext sql -dir db/migrations -tz Local init
|
||||||
|
|
||||||
# --- for Macos
|
# --- for Macos
|
||||||
migrate:
|
migrate:
|
||||||
migrate -database 'postgres://bank_admin:bank@#23#@_password@localhost:5424/bank_db?sslmode=disable' -path db/migrations up
|
migrate -database 'postgres://example_user:example_password@localhost:5424/example_db?sslmode=disable' -path db/migrations up
|
||||||
migrate-rollback:
|
migrate-rollback:
|
||||||
migrate -database 'postgres://bank_admin:bank@#23#@_password@localhost:5424/bank_db?sslmode=disable' -path db/migrations down
|
migrate -database 'postgres://example_user:example_password@localhost:5424/example_db?sslmode=disable' -path db/migrations down
|
||||||
|
|
||||||
# ---- for linux
|
# ---- for linux
|
||||||
# migrate:
|
# migrate:
|
||||||
|
|||||||
20
README.md
20
README.md
@@ -142,8 +142,8 @@ jwt_key: <your-jwt-secret>
|
|||||||
storage:
|
storage:
|
||||||
host: main-db # use localhost when running outside Docker
|
host: main-db # use localhost when running outside Docker
|
||||||
port: 5432
|
port: 5432
|
||||||
database: bank_db
|
database: example_db
|
||||||
username: bank_admin
|
username: example_user
|
||||||
password: <password>
|
password: <password>
|
||||||
pg_pool_max_conn: 10
|
pg_pool_max_conn: 10
|
||||||
public_file_path: ./public
|
public_file_path: ./public
|
||||||
@@ -152,18 +152,7 @@ app_version: 0.0.1
|
|||||||
|
|
||||||
> **Note:** Replace default credentials before deploying to production.
|
> **Note:** Replace default credentials before deploying to production.
|
||||||
|
|
||||||
## API reference
|
|
||||||
|
|
||||||
**Base path:** `/v1/admin`
|
|
||||||
|
|
||||||
| Method | Endpoint | Auth | Description |
|
|
||||||
|--------|----------|------|-------------|
|
|
||||||
| `POST` | `/login` | No | Admin login — returns access and refresh tokens |
|
|
||||||
| `POST` | `/token` | No | Refresh access token |
|
|
||||||
| `GET` | `/get-profile` | Bearer JWT | Get authenticated admin profile |
|
|
||||||
| `POST` | `/file` | Bearer JWT | Upload a file to local storage |
|
|
||||||
| `DELETE` | `/file/:id` | Bearer JWT | Remove a file |
|
|
||||||
| `GET` | `/images/:id` | No | Serve a stored image |
|
|
||||||
|
|
||||||
### Authentication
|
### Authentication
|
||||||
|
|
||||||
@@ -173,12 +162,7 @@ Protected endpoints require an `Authorization` header with a valid JWT access to
|
|||||||
Authorization: <accessToken>
|
Authorization: <accessToken>
|
||||||
```
|
```
|
||||||
|
|
||||||
**Default admin credentials** (seeded by migration):
|
|
||||||
|
|
||||||
| Field | Value |
|
|
||||||
|-------|-------|
|
|
||||||
| Login | `admin@admin.com` |
|
|
||||||
| Password | *(see migration seed — change after first login)* |
|
|
||||||
|
|
||||||
### Swagger
|
### Swagger
|
||||||
|
|
||||||
|
|||||||
@@ -7,9 +7,10 @@ storage:
|
|||||||
host: main-db
|
host: main-db
|
||||||
# host: localhost
|
# host: localhost
|
||||||
port: 5432
|
port: 5432
|
||||||
database: bank_db
|
# port: 5424
|
||||||
username: bank_admin
|
database: example_db
|
||||||
password: bank@#23#@_password
|
username: example_user
|
||||||
|
password: example_password
|
||||||
pg_pool_max_conn: 10
|
pg_pool_max_conn: 10
|
||||||
app_version: 0.0.1
|
app_version: 0.0.1
|
||||||
public_file_path: ./public
|
public_file_path: ./public
|
||||||
|
|||||||
@@ -6,9 +6,9 @@ services:
|
|||||||
container_name: "main-db"
|
container_name: "main-db"
|
||||||
restart: always
|
restart: always
|
||||||
environment:
|
environment:
|
||||||
- POSTGRES_USER=bank_admin
|
- POSTGRES_USER=example_user
|
||||||
- POSTGRES_PASSWORD=bank@#23#@_password
|
- POSTGRES_PASSWORD=example_password
|
||||||
- POSTGRES_DB=bank_db
|
- POSTGRES_DB=example_db
|
||||||
ports:
|
ports:
|
||||||
- '5424:5432'
|
- '5424:5432'
|
||||||
volumes:
|
volumes:
|
||||||
|
|||||||
Reference in New Issue
Block a user