From a98df5f9a0d6fb5b48c9f6017a28fdafe4f5e4b6 Mon Sep 17 00:00:00 2001 From: "Aaron D. Lee" Date: Tue, 6 Jan 2026 22:16:23 -0500 Subject: [PATCH] SSL cert: Use actual hostname instead of 'localhost' default MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When STEGASOO_HOSTNAME env var is not set, use socket.gethostname() to get the actual machine hostname for certificate generation. This ensures the cert includes proper hostname.local SAN. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 --- frontends/web/app.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/frontends/web/app.py b/frontends/web/app.py index 8a035e7..50726d2 100644 --- a/frontends/web/app.py +++ b/frontends/web/app.py @@ -31,6 +31,7 @@ import time from concurrent.futures import ThreadPoolExecutor from pathlib import Path +import temp_storage from auth import ( MAX_CHANNEL_KEYS, MAX_USERS, @@ -83,7 +84,6 @@ from flask import ( ) from PIL import Image from ssl_utils import ensure_certs -import temp_storage os.environ["NUMPY_MADVISE_HUGEPAGE"] = "0" os.environ["OMP_NUM_THREADS"] = "1" @@ -2532,7 +2532,8 @@ if __name__ == "__main__": # HTTPS configuration ssl_context = None if app.config.get("HTTPS_ENABLED", False): - hostname = os.environ.get("STEGASOO_HOSTNAME", "localhost") + import socket + hostname = os.environ.get("STEGASOO_HOSTNAME") or socket.gethostname() try: cert_path, key_path = ensure_certs(base_dir, hostname) if cert_path.exists() and key_path.exists():