new redis migration

Signed-off-by: ale <ale@manalejandro.com>
Este commit está contenido en:
ale
2025-12-15 16:35:35 +01:00
padre ad7a1cf0a7
commit 3ce64eeb8e
Se han modificado 20 ficheros con 1021 adiciones y 712 borrados

38
API.md
Ver fichero

@@ -102,7 +102,7 @@ Content-Type: application/json
}
```
Note: When plaintext is provided, it is automatically indexed in Elasticsearch for future lookups.
Note: When plaintext is provided, it is automatically stored in Redis for future lookups.
#### Error Responses
@@ -113,7 +113,7 @@ Note: When plaintext is provided, it is automatically indexed in Elasticsearch f
}
```
**500 Internal Server Error** - Server or Elasticsearch error:
**500 Internal Server Error** - Server or Redis error:
```json
{
"error": "Internal server error",
@@ -127,7 +127,7 @@ Note: When plaintext is provided, it is automatically indexed in Elasticsearch f
**Endpoint**: `GET /api/health`
**Description**: Check the health of the application and Elasticsearch connection.
**Description**: Check the health of the application and Redis connection.
#### Request
@@ -139,31 +139,28 @@ No parameters required.
```json
{
"status": "ok",
"elasticsearch": {
"cluster": "elasticsearch",
"status": "green"
"redis": {
"version": "7.2.0",
"memory": "1.5M",
"dbSize": 1542
},
"index": {
"exists": true,
"name": "hasher",
"stats": {
"documentCount": 1542,
"indexSize": 524288
}
"stats": {
"count": 1542,
"size": 524288
}
}
```
**Elasticsearch cluster status values**:
- `green`: All primary and replica shards are active
- `yellow`: All primary shards are active, but not all replicas
- `red`: Some primary shards are not active
**Redis status fields**:
- `version`: Redis server version
- `memory`: Memory used by Redis
- `dbSize`: Total number of keys in database
**Error** (503 Service Unavailable):
```json
{
"status": "error",
"error": "Connection refused to Elasticsearch"
"error": "Connection refused to Redis"
}
```
@@ -179,7 +176,6 @@ The API automatically detects hash types based on length and format:
| SHA1 | 40 | `^[a-f0-9]{40}$` |
| SHA256 | 64 | `^[a-f0-9]{64}$` |
| SHA512 | 128 | `^[a-f0-9]{128}$` |
| Bcrypt | 60 | `^\$2[abxy]\$` |
Hashes are case-insensitive.
@@ -253,7 +249,7 @@ The API accepts requests from any origin by default. For production deployment,
## Notes
- All timestamps are in ISO 8601 format
- The API automatically creates the Elasticsearch index if it doesn't exist
- Plaintext searches are automatically indexed for future lookups
- The API automatically creates Redis keys with proper structure
- Plaintext searches are automatically stored for future lookups
- Searches are case-insensitive
- Hashes must be valid hexadecimal strings