Compare commits

..

No commits in common. "18f5915b8f5cf4dcf983415673c2495dd575626e" and "3c2d665bfd4ceef056c183e0ad13f3899bb77a3f" have entirely different histories.

5 changed files with 14 additions and 18 deletions

View File

@ -9,9 +9,6 @@ from flask import Flask, Response, render_template, request, send_from_directory
from prefect.deployments import run_deployment from prefect.deployments import run_deployment
PORT = 9021 PORT = 9021
PROTO = "https"
BARE = True
app = Flask(__name__) app = Flask(__name__)
logging.basicConfig(level=logging.DEBUG) logging.basicConfig(level=logging.DEBUG)
@ -25,20 +22,20 @@ def get_host():
host = os.environ.get("LIGHTNING_CLOUDSPACE_HOST") host = os.environ.get("LIGHTNING_CLOUDSPACE_HOST")
if host is None: if host is None:
default_host = os.environ.get("HOST_NAME", "0.0.0.0") default_host = os.environ.get("HOST_NAME", "0.0.0.0")
return f"{default_host}:{PORT}" if not BARE else f"{default_host}" return f"{default_host}:{PORT}"
else: else:
return f"{PORT}-{host}" if not BARE else f"{host}" return f"{PORT}-{host}"
@app.route("/iframe") @app.route("/iframe")
@app.route("/iframe/") @app.route("/iframe/")
@app.route("/iframe/<path:subpath>") @app.route("/iframe/<path:subpath>")
def home(subpath="images/animations/", proto=PROTO): def home(subpath="images/animations/"):
host = get_host() host = get_host()
initial_url = f"{proto}://{host}/{subpath}" initial_url = f"http://{host}/{subpath}"
api_url = f"{proto}://{host}/api" api_url = f"http://{host}/api"
return render_template( return render_template(
"index.html", initial_url=initial_url, host=f"{proto}://{host}", api_url=api_url "index.html", initial_url=initial_url, host=f"http://{host}", api_url=api_url
) )
@ -73,10 +70,10 @@ def custom_static(filename):
@app.route("/", methods=["GET"]) @app.route("/", methods=["GET"])
@app.route("/<path:url>", methods=["GET"]) @app.route("/<path:url>", methods=["GET"])
def proxy(url="", proto=PROTO): def proxy(url=""):
original_base_url = "https://services.swpc.noaa.gov" original_base_url = "https://services.swpc.noaa.gov"
host = get_host() host = get_host()
proxy_base_url = f"{proto}://{host}/" proxy_base_url = f"http://{host}/"
target_url = f"{original_base_url}/{url}" target_url = f"{original_base_url}/{url}"
logging.debug(f"Fetching URL: {target_url}") logging.debug(f"Fetching URL: {target_url}")

View File

@ -174,8 +174,8 @@
formattedPath += '-'; formattedPath += '-';
} }
// Append '.mp4' to the formatted path + cache bust // Append '.mp4' to the formatted path
let videoPath = `${formattedPath}latest.mp4` + "?t=" + Date.now(); let videoPath = `${formattedPath}latest.mp4`;
let videoPlayer = document.getElementById('video-player'); let videoPlayer = document.getElementById('video-player');
let videoSource = document.getElementById('video-source'); let videoSource = document.getElementById('video-source');

View File

@ -1,5 +1,5 @@
run: build run: build
docker run --rm -ti --name noaa -e LIGHTNING_CLOUDSPACE_HOST=noaa.clfx.cc -p 9021:9021 -p 4200:4200 noaa docker run --rm -ti --name noaa -e HOST_NAME=localhost -p 9021:9021 -p 4200:4200 noaa
build: build:
docker build -t noaa . docker build -t noaa .

View File

@ -10,5 +10,5 @@ PREFECT_API_SERVICES_SCHEDULER_INSERT_BATCH_SIZE = 500
PREFECT_API_SERVICES_SCHEDULER_LOOP_SECONDS = 60 PREFECT_API_SERVICES_SCHEDULER_LOOP_SECONDS = 60
PREFECT_API_SERVICES_SCHEDULER_MIN_RUNS = 3 PREFECT_API_SERVICES_SCHEDULER_MIN_RUNS = 3
PREFECT_API_SERVICES_SCHEDULER_MAX_RUNS = 100 PREFECT_API_SERVICES_SCHEDULER_MAX_RUNS = 100
PREFECT_API_SERVICES_SCHEDULER_MIN_SCHEDULED_TIME = '00:30:00' PREFECT_API_SERVICES_SCHEDULER_MIN_SCHEDULED_TIME = '0:30:00'
PREFECT_API_SERVICES_SCHEDULER_MAX_SCHEDULED_TIME = '08:00:00' PREFECT_API_SERVICES_SCHEDULER_MAX_SCHEDULED_TIME = '0 days, 8:00:00'

View File

@ -1,5 +1,4 @@
#prefect==2.17.1 prefect==2.17.1
prefect==3.0.0rc1
Flask==3.0.3 Flask==3.0.3
gunicorn==22.0.0 gunicorn==22.0.0
gevent==24.2.1 gevent==24.2.1