mirror of
https://github.com/unshackle-dl/unshackle.git
synced 2026-11-27 03:15:08 +00:00
fix(vaults): quote table names, dedupe kids without case, and reuse one mysql connection
This commit is contained in:
@@ -83,7 +83,7 @@ Network-backed vaults (`HTTP` and `API`) accept an optional per-vault `timeout`
|
||||
vault_timeout: 10.0 # default, in seconds
|
||||
```
|
||||
|
||||
A `timeout` set inline on an individual vault always wins over this global value. The `SQLite` and `MySQL` backends do not take a `timeout` field. `MySQL` uses `vault_timeout` as its `connect_timeout` instead, and falls back to the pymysql default of 10 seconds when `vault_timeout` is `0`. To use a different connect timeout, set `connect_timeout` on the vault.
|
||||
A `timeout` set inline on an individual vault always wins over this global value. The `SQLite` and `MySQL` backends do not take a `timeout` field. `MySQL` uses `vault_timeout` as its `connect_timeout`, `read_timeout` and `write_timeout` instead, and falls back to 10 seconds when `vault_timeout` is `0`. To use a different value, set that field on the vault.
|
||||
|
||||
unshackle pushes content keys to all vaults at the same time, so one slow or unreachable vault costs only its own timeout and does not delay the others.
|
||||
|
||||
@@ -146,7 +146,9 @@ key_vaults:
|
||||
| `username` | yes | Login user. |
|
||||
| `no_push` | no | If `true`, keys are read but never written. |
|
||||
|
||||
Any additional fields you provide (such as `password`, `port`, or `ssl`) are passed straight through to `pymysql.connect`, so you can use the full range of its connection options.
|
||||
Any additional fields you provide (such as `password`, `port`, or `ssl`) are passed straight through to `pymysql.connect`, so you can use the full range of its connection options. The one exception is `autocommit`, which is always on.
|
||||
|
||||
Each `MySQL` vault keeps one connection open for the whole run and shares it between threads. If the server is down, unshackle skips the vault for the rest of the run.
|
||||
|
||||
!!! warning "Account security is on you, not on unshackle"
|
||||
unshackle enforces none of this. It is operational policy for a database that may be shared with a group. Never connect with the `root` account, not even for yourself. Give every account a password, and never let two users share a username/password. Restrict each account's access to only the `unshackle` database, and grant normal users only `SELECT` and `INSERT`. Reserve the `CREATE` grant for a single trusted user who bootstraps the service tables (see [`kv prepare`](#kv-prepare-pre-create-service-tables)); everyone else can insert new keys but should not be creating tables.
|
||||
|
||||
@@ -13,7 +13,7 @@ name) and a `name`, plus backend-specific keys.
|
||||
| `type` | Purpose | Required keys | Notes |
|
||||
|--------|---------|--------------|-------|
|
||||
| `SQLite` | Local SQLite database | `name`, `path` | Loaded **critically**; a failure aborts the run. |
|
||||
| `MySQL` | Remote MySQL database | `name`, `host`, `database`, `username` | Extra keys (e.g. `password`, `port`) forwarded to pymysql. `connect_timeout` defaults to `vault_timeout`. |
|
||||
| `MySQL` | Remote MySQL database | `name`, `host`, `database`, `username` | Extra keys (e.g. `password`, `port`) forwarded to pymysql. `connect_timeout`, `read_timeout` and `write_timeout` default to `vault_timeout`. `autocommit` is always on. |
|
||||
| `API` | RESTful JSON API | `name`, `uri`, `token` | Optional `headers` map is sent with every request. Honours `vault_timeout`. |
|
||||
| `HTTP` | HTTP API with modes | `name`, `host`, one of `password`/`api_key`, and `username` in query mode | `api_mode`: `query` (default), `json`, `decrypt_labs`. Honours `vault_timeout`. |
|
||||
|
||||
@@ -55,7 +55,7 @@ key_vaults:
|
||||
|
||||
Timeout in seconds for vault operations. Injected automatically into any backend whose
|
||||
constructor accepts a `timeout` parameter (a per-vault `timeout` still wins). The `MySQL` backend
|
||||
uses it as the default `connect_timeout`.
|
||||
uses it as the default `connect_timeout`, `read_timeout` and `write_timeout`.
|
||||
|
||||
The `API` and `HTTP` backends send a request again up to 3 times when the vault answers
|
||||
`429 Too Many Requests`. They wait the `Retry-After` time, but never longer than this timeout.
|
||||
|
||||
Reference in New Issue
Block a user