refactor: use environment variables for Tryton credentials
This commit is contained in:
23
AGENTS.md
23
AGENTS.md
@@ -66,17 +66,24 @@ fastmcp run tryton_mcp.server
|
||||
|
||||
## Configuration
|
||||
|
||||
Edit `TRYTON_CREDENTIALS` in `server.py:12-17` to change connection settings:
|
||||
Credentials are loaded from environment variables (with sensible defaults):
|
||||
|
||||
```python
|
||||
TRYTON_CREDENTIALS = {
|
||||
"hostname": 'dev.naliia.co',
|
||||
"database": 'capacitacion',
|
||||
"username": 'admin',
|
||||
"password": 'admin'
|
||||
}
|
||||
```bash
|
||||
export TRYTON_HOSTNAME=dev.naliia.co
|
||||
export TRYTON_DATABASE=capacitacion
|
||||
export TRYTON_USERNAME=admin
|
||||
export TRYTON_PASSWORD=admin
|
||||
export TRYTON_PORT=8000
|
||||
```
|
||||
|
||||
Or copy `.env.example` to `.env` and adjust values:
|
||||
|
||||
```bash
|
||||
cp .env.example .env
|
||||
```
|
||||
|
||||
Note: `.env` is gitignored to protect credentials.
|
||||
|
||||
## Testing RPC Calls
|
||||
|
||||
Use `test_rpc.py` to test Tryton RPC calls independently:
|
||||
|
||||
Reference in New Issue
Block a user