Split config for better control over secrets like API-KEY
This commit is contained in:
BIN
.gitignore
vendored
Normal file
BIN
.gitignore
vendored
Normal file
Binary file not shown.
55
config.example.yaml
Normal file
55
config.example.yaml
Normal file
@@ -0,0 +1,55 @@
|
|||||||
|
# webhooks:
|
||||||
|
# enabled: true
|
||||||
|
# endpoints:
|
||||||
|
# - url: 'https://webhook.site/92f87e0c-3611-43b1-8010-b873835b9e75'
|
||||||
|
# method: 'POST' # POST, PUT, GET
|
||||||
|
# headers:
|
||||||
|
# Authorization: 'Bearer your-token'
|
||||||
|
# Content-Type: 'application/json'
|
||||||
|
# retry:
|
||||||
|
# max_attempts: 3
|
||||||
|
# delay_seconds: 5
|
||||||
|
# notification_rules:
|
||||||
|
# send_on_new: true # Notificar nuevos QRs
|
||||||
|
# send_on_repeat: false # Notificar QRs repetidos
|
||||||
|
headless:
|
||||||
|
enabled: true # Activar modo headless
|
||||||
|
save_images: true # Guardar imágenes de QRs detectados
|
||||||
|
image_output_dir: '/var/log/qr_detector/images' # Directorio para guardar imágenes
|
||||||
|
webhook_url: 'http://your-webhook-url' # URL para notificaciones (opcional)
|
||||||
|
# Configuración del detector QR
|
||||||
|
database:
|
||||||
|
enabled: true
|
||||||
|
path: 'qr_codes.db'
|
||||||
|
table_name: 'qr_scans'
|
||||||
|
|
||||||
|
camera:
|
||||||
|
id: "rtsp://172.20.5.201:8080/h264.sdp" # ID de la cámara a usar
|
||||||
|
min_delay: 2.0 # Tiempo mínimo entre lecturas del mismo código
|
||||||
|
|
||||||
|
logging:
|
||||||
|
level: INFO
|
||||||
|
format: '%(asctime)s - %(levelname)s - %(message)s'
|
||||||
|
output:
|
||||||
|
console: true
|
||||||
|
file:
|
||||||
|
enabled: true
|
||||||
|
path: 'qr_detector.log'
|
||||||
|
|
||||||
|
display:
|
||||||
|
window_name: 'QR Detector'
|
||||||
|
rectangle:
|
||||||
|
color: [0, 255, 0] # Color BGR (verde)
|
||||||
|
thickness: 2
|
||||||
|
corner_length: 30 # Longitud de las líneas de las esquinas
|
||||||
|
text:
|
||||||
|
font_scale: 0.6
|
||||||
|
color: [255, 255, 255] # Color BGR (blanco)
|
||||||
|
thickness: 2
|
||||||
|
background_opacity: 0.5 # Opacidad del fondo del texto
|
||||||
|
margin_top: 40 # Píxeles sobre el código QR
|
||||||
|
# URL del webhook (opcional)
|
||||||
|
api:
|
||||||
|
url: "${API_URL}"
|
||||||
|
api_key: "${API_KEY}"
|
||||||
|
batch_size: 1 # Número de QRs a acumular antes de enviar
|
||||||
55
config.local.yaml
Normal file
55
config.local.yaml
Normal file
@@ -0,0 +1,55 @@
|
|||||||
|
# webhooks:
|
||||||
|
# enabled: true
|
||||||
|
# endpoints:
|
||||||
|
# - url: 'https://webhook.site/92f87e0c-3611-43b1-8010-b873835b9e75'
|
||||||
|
# method: 'POST' # POST, PUT, GET
|
||||||
|
# headers:
|
||||||
|
# Authorization: 'Bearer your-token'
|
||||||
|
# Content-Type: 'application/json'
|
||||||
|
# retry:
|
||||||
|
# max_attempts: 3
|
||||||
|
# delay_seconds: 5
|
||||||
|
# notification_rules:
|
||||||
|
# send_on_new: true # Notificar nuevos QRs
|
||||||
|
# send_on_repeat: false # Notificar QRs repetidos
|
||||||
|
headless:
|
||||||
|
enabled: true # Activar modo headless
|
||||||
|
save_images: true # Guardar imágenes de QRs detectados
|
||||||
|
image_output_dir: '/var/log/qr_detector/images' # Directorio para guardar imágenes
|
||||||
|
webhook_url: 'http://your-webhook-url' # URL para notificaciones (opcional)
|
||||||
|
# Configuración del detector QR
|
||||||
|
database:
|
||||||
|
enabled: true
|
||||||
|
path: 'qr_codes.db'
|
||||||
|
table_name: 'qr_scans'
|
||||||
|
|
||||||
|
camera:
|
||||||
|
id: "rtsp://172.20.5.201:8080/h264.sdp" # ID de la cámara a usar
|
||||||
|
min_delay: 2.0 # Tiempo mínimo entre lecturas del mismo código
|
||||||
|
|
||||||
|
logging:
|
||||||
|
level: INFO
|
||||||
|
format: '%(asctime)s - %(levelname)s - %(message)s'
|
||||||
|
output:
|
||||||
|
console: true
|
||||||
|
file:
|
||||||
|
enabled: true
|
||||||
|
path: 'qr_detector.log'
|
||||||
|
|
||||||
|
display:
|
||||||
|
window_name: 'QR Detector'
|
||||||
|
rectangle:
|
||||||
|
color: [0, 255, 0] # Color BGR (verde)
|
||||||
|
thickness: 2
|
||||||
|
corner_length: 30 # Longitud de las líneas de las esquinas
|
||||||
|
text:
|
||||||
|
font_scale: 0.6
|
||||||
|
color: [255, 255, 255] # Color BGR (blanco)
|
||||||
|
thickness: 2
|
||||||
|
background_opacity: 0.5 # Opacidad del fondo del texto
|
||||||
|
margin_top: 40 # Píxeles sobre el código QR
|
||||||
|
# URL del webhook (opcional)
|
||||||
|
api:
|
||||||
|
url: "https://webhook.site/92f87e0c-3611-43b1-8010-b873835b9e75"
|
||||||
|
api_key: "tu-api-key-aqui"
|
||||||
|
batch_size: 1 # Número de QRs a acumular antes de enviar
|
||||||
55
config.prod.yaml
Normal file
55
config.prod.yaml
Normal file
@@ -0,0 +1,55 @@
|
|||||||
|
# webhooks:
|
||||||
|
# enabled: true
|
||||||
|
# endpoints:
|
||||||
|
# - url: 'https://webhook.site/92f87e0c-3611-43b1-8010-b873835b9e75'
|
||||||
|
# method: 'POST' # POST, PUT, GET
|
||||||
|
# headers:
|
||||||
|
# Authorization: 'Bearer your-token'
|
||||||
|
# Content-Type: 'application/json'
|
||||||
|
# retry:
|
||||||
|
# max_attempts: 3
|
||||||
|
# delay_seconds: 5
|
||||||
|
# notification_rules:
|
||||||
|
# send_on_new: true # Notificar nuevos QRs
|
||||||
|
# send_on_repeat: false # Notificar QRs repetidos
|
||||||
|
headless:
|
||||||
|
enabled: true # Activar modo headless
|
||||||
|
save_images: true # Guardar imágenes de QRs detectados
|
||||||
|
image_output_dir: '/var/log/qr_detector/images' # Directorio para guardar imágenes
|
||||||
|
webhook_url: 'http://your-webhook-url' # URL para notificaciones (opcional)
|
||||||
|
# Configuración del detector QR
|
||||||
|
database:
|
||||||
|
enabled: true
|
||||||
|
path: 'qr_codes.db'
|
||||||
|
table_name: 'qr_scans'
|
||||||
|
|
||||||
|
camera:
|
||||||
|
id: "rtsp://172.20.5.201:8080/h264.sdp" # ID de la cámara a usar
|
||||||
|
min_delay: 2.0 # Tiempo mínimo entre lecturas del mismo código
|
||||||
|
|
||||||
|
logging:
|
||||||
|
level: INFO
|
||||||
|
format: '%(asctime)s - %(levelname)s - %(message)s'
|
||||||
|
output:
|
||||||
|
console: true
|
||||||
|
file:
|
||||||
|
enabled: true
|
||||||
|
path: 'qr_detector.log'
|
||||||
|
|
||||||
|
display:
|
||||||
|
window_name: 'QR Detector'
|
||||||
|
rectangle:
|
||||||
|
color: [0, 255, 0] # Color BGR (verde)
|
||||||
|
thickness: 2
|
||||||
|
corner_length: 30 # Longitud de las líneas de las esquinas
|
||||||
|
text:
|
||||||
|
font_scale: 0.6
|
||||||
|
color: [255, 255, 255] # Color BGR (blanco)
|
||||||
|
thickness: 2
|
||||||
|
background_opacity: 0.5 # Opacidad del fondo del texto
|
||||||
|
margin_top: 40 # Píxeles sobre el código QR
|
||||||
|
# URL del webhook (opcional)
|
||||||
|
api:
|
||||||
|
url: "https://webhook.site/92f87e0c-3611-43b1-8010-b873835b9e75"
|
||||||
|
api_key: "tu-api-key-aqui"
|
||||||
|
batch_size: 1 # Número de QRs a acumular antes de enviar
|
||||||
58
config.yaml
58
config.yaml
@@ -1,55 +1,3 @@
|
|||||||
# webhooks:
|
import:
|
||||||
# enabled: true
|
- config.local.yaml # desarrollo local
|
||||||
# endpoints:
|
# - config.prod.yaml # producción
|
||||||
# - url: 'https://webhook.site/92f87e0c-3611-43b1-8010-b873835b9e75'
|
|
||||||
# method: 'POST' # POST, PUT, GET
|
|
||||||
# headers:
|
|
||||||
# Authorization: 'Bearer your-token'
|
|
||||||
# Content-Type: 'application/json'
|
|
||||||
# retry:
|
|
||||||
# max_attempts: 3
|
|
||||||
# delay_seconds: 5
|
|
||||||
# notification_rules:
|
|
||||||
# send_on_new: true # Notificar nuevos QRs
|
|
||||||
# send_on_repeat: false # Notificar QRs repetidos
|
|
||||||
headless:
|
|
||||||
enabled: true # Activar modo headless
|
|
||||||
save_images: true # Guardar imágenes de QRs detectados
|
|
||||||
image_output_dir: '/var/log/qr_detector/images' # Directorio para guardar imágenes
|
|
||||||
webhook_url: 'http://your-webhook-url' # URL para notificaciones (opcional)
|
|
||||||
# Configuración del detector QR
|
|
||||||
database:
|
|
||||||
enabled: true
|
|
||||||
path: 'qr_codes.db'
|
|
||||||
table_name: 'qr_scans'
|
|
||||||
|
|
||||||
camera:
|
|
||||||
id: "rtsp://172.20.5.201:8080/h264.sdp" # ID de la cámara a usar
|
|
||||||
min_delay: 2.0 # Tiempo mínimo entre lecturas del mismo código
|
|
||||||
|
|
||||||
logging:
|
|
||||||
level: INFO
|
|
||||||
format: '%(asctime)s - %(levelname)s - %(message)s'
|
|
||||||
output:
|
|
||||||
console: true
|
|
||||||
file:
|
|
||||||
enabled: true
|
|
||||||
path: 'qr_detector.log'
|
|
||||||
|
|
||||||
display:
|
|
||||||
window_name: 'QR Detector'
|
|
||||||
rectangle:
|
|
||||||
color: [0, 255, 0] # Color BGR (verde)
|
|
||||||
thickness: 2
|
|
||||||
corner_length: 30 # Longitud de las líneas de las esquinas
|
|
||||||
text:
|
|
||||||
font_scale: 0.6
|
|
||||||
color: [255, 255, 255] # Color BGR (blanco)
|
|
||||||
thickness: 2
|
|
||||||
background_opacity: 0.5 # Opacidad del fondo del texto
|
|
||||||
margin_top: 40 # Píxeles sobre el código QR
|
|
||||||
# URL del webhook (opcional)
|
|
||||||
api:
|
|
||||||
url: "https://webhook.site/92f87e0c-3611-43b1-8010-b873835b9e75"
|
|
||||||
api_key: "tu-api-key-aqui"
|
|
||||||
batch_size: 1 # Número de QRs a acumular antes de enviar
|
|
||||||
Reference in New Issue
Block a user