Usar URLs internas para go2rtc y Frigate
All checks were successful
build-and-deploy / build-and-deploy (push) Successful in 1m1s
All checks were successful
build-and-deploy / build-and-deploy (push) Successful in 1m1s
- go2rtc: http://192.168.87.29:1984 (configurable via GO2RTC_URL) - Frigate: http://192.168.87.29:5000 (configurable via FRIGATE_URL) - Evita problemas de DNS/red desde el contenedor
This commit is contained in:
@@ -2,6 +2,7 @@
|
|||||||
* Proxy endpoint para crear eventos en Frigate
|
* Proxy endpoint para crear eventos en Frigate
|
||||||
* POST /api/frigate/event
|
* POST /api/frigate/event
|
||||||
* Body: { camera: string, label: string, sub_label?: string, duration?: number, include_recording?: boolean }
|
* Body: { camera: string, label: string, sub_label?: string, duration?: number, include_recording?: boolean }
|
||||||
|
* Usa URL interna del servidor Frigate
|
||||||
*/
|
*/
|
||||||
|
|
||||||
interface EventRequestBody {
|
interface EventRequestBody {
|
||||||
@@ -54,9 +55,12 @@ export default defineEventHandler(async (event) => {
|
|||||||
frigatePayload.include_recording = body.include_recording
|
frigatePayload.include_recording = body.include_recording
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// URL interna de Frigate (sin pasar por Traefik/Authentik)
|
||||||
|
const FRIGATE_URL = process.env.FRIGATE_URL || 'http://192.168.87.29:5000'
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const response = await fetch(
|
const response = await fetch(
|
||||||
`https://camaras.nucleoriofrio.com/api/events/${cameraName}/create`,
|
`${FRIGATE_URL}/api/events/${cameraName}/create`,
|
||||||
{
|
{
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
headers: {
|
headers: {
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
/**
|
/**
|
||||||
* Proxy endpoint para obtener la lista de streams de go2rtc
|
* Proxy endpoint para obtener la lista de streams de go2rtc
|
||||||
* Evita problemas de CORS/cookies entre subdominios
|
* Evita problemas de CORS/cookies entre subdominios
|
||||||
|
* Usa URL interna del servidor go2rtc
|
||||||
*/
|
*/
|
||||||
|
|
||||||
export default defineEventHandler(async (event) => {
|
export default defineEventHandler(async (event) => {
|
||||||
@@ -15,8 +16,11 @@ export default defineEventHandler(async (event) => {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// URL interna de go2rtc (sin pasar por Traefik/Authentik)
|
||||||
|
const GO2RTC_URL = process.env.GO2RTC_URL || 'http://192.168.87.29:1984'
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const response = await fetch('https://streams.nucleoriofrio.com/api/streams', {
|
const response = await fetch(`${GO2RTC_URL}/api/streams`, {
|
||||||
method: 'GET',
|
method: 'GET',
|
||||||
headers: {
|
headers: {
|
||||||
'Accept': 'application/json'
|
'Accept': 'application/json'
|
||||||
|
|||||||
Reference in New Issue
Block a user