diff --git a/glance-system/glance-helper.yaml b/glance-system/glance-helper.yaml index 21c7802..856a232 100644 --- a/glance-system/glance-helper.yaml +++ b/glance-system/glance-helper.yaml @@ -24,9 +24,19 @@ data: import requests from bs4 import BeautifulSoup from fastapi import FastAPI, Response + from fastapi.middleware.cors import CORSMiddleware from prometheus_client import Counter, Histogram, Gauge, generate_latest, CONTENT_TYPE_LATEST APP = FastAPI() + + # Add CORS middleware to allow cross-origin requests from Glance dashboards + APP.add_middleware( + CORSMiddleware, + allow_origins=["https://kisfenyo.dooplex.hu", "https://orsi.dooplex.hu", "https://glance-helper.dooplex.hu"], + allow_credentials=True, + allow_methods=["GET", "POST", "PUT", "DELETE", "OPTIONS"], + allow_headers=["*"], + ) # ================================ # Időkép configuration @@ -1246,7 +1256,6 @@ data: }, ensure_ascii=False), media_type="application/json; charset=utf-8" ) - --- apiVersion: apps/v1 kind: Deployment diff --git a/glance-system/glance-kisfenyo.yaml b/glance-system/glance-kisfenyo.yaml index 2d4e9aa..1227147 100644 --- a/glance-system/glance-kisfenyo.yaml +++ b/glance-system/glance-kisfenyo.yaml @@ -777,14 +777,13 @@ data: {{ $user := .Options.StringOr "user" "kisfenyo" }} {{ $apiKey := .Options.StringOr "api_key" "" }} {{ $todos := .JSON.Array "todos" }} - {{ $widgetId := "todo-kisfenyo" }} -