Replace legacy branding with Kaizoku
This commit is contained in:
+8
-26
@@ -11,7 +11,6 @@ import traceback
|
||||
from base64 import b64decode
|
||||
from binascii import Error as BinasciiError
|
||||
from dataclasses import dataclass
|
||||
from functools import lru_cache
|
||||
from http import HTTPStatus
|
||||
from http.cookies import SimpleCookie
|
||||
from http.server import BaseHTTPRequestHandler
|
||||
@@ -33,6 +32,7 @@ from app_support import (
|
||||
configured_remote_path_roots,
|
||||
debug_enabled,
|
||||
debug_log,
|
||||
env_value,
|
||||
load_project_text_file,
|
||||
cli_executable_exists_any,
|
||||
cli_executable_exists,
|
||||
@@ -219,24 +219,9 @@ def queue_clear_failed(runtime):
|
||||
return result
|
||||
|
||||
|
||||
@lru_cache(maxsize=1)
|
||||
def installed_ani_cli_version():
|
||||
return "Disregarded"
|
||||
|
||||
|
||||
@lru_cache(maxsize=1)
|
||||
def installed_anipy_cli_version():
|
||||
return "Disregarded"
|
||||
|
||||
|
||||
@lru_cache(maxsize=1)
|
||||
def installed_animdl_version():
|
||||
return "Disregarded"
|
||||
|
||||
|
||||
class Handler(BaseHTTPRequestHandler):
|
||||
server_version = "Kaizoku/0.1"
|
||||
remote_session_cookie_name = "ani_cli_web_session"
|
||||
remote_session_cookie_name = "kaizoku_session"
|
||||
remote_session_cookie_max_age_seconds = 30 * 24 * 60 * 60
|
||||
quiet_poll_paths = {"/api/queue", "/api/watchlist/refresh-status", "/api/config/jellyfin/sync-status"}
|
||||
|
||||
@@ -549,11 +534,11 @@ class Handler(BaseHTTPRequestHandler):
|
||||
return
|
||||
if not remote_access_allowed():
|
||||
raise PermissionError(
|
||||
"Remote access is disabled. Set ANI_CLI_WEB_ALLOW_REMOTE=1 to allow non-local clients."
|
||||
"Remote access is disabled. Set KAIZOKU_ALLOW_REMOTE=1 to allow non-local clients."
|
||||
)
|
||||
if not remote_access_credentials_configured():
|
||||
raise PermissionError(
|
||||
"Remote access requires ANI_CLI_WEB_AUTH_USERNAME and ANI_CLI_WEB_AUTH_PASSWORD for non-local clients."
|
||||
"Remote access requires KAIZOKU_AUTH_USERNAME and KAIZOKU_AUTH_PASSWORD for non-local clients."
|
||||
)
|
||||
if not Handler._remote_credentials_valid(self):
|
||||
raise PermissionError("Remote username or password missing or invalid.")
|
||||
@@ -613,9 +598,6 @@ class Handler(BaseHTTPRequestHandler):
|
||||
{
|
||||
"name": APP_NAME,
|
||||
"version": VERSION,
|
||||
"ani_cli_version": installed_ani_cli_version(),
|
||||
"anipy_cli_version": installed_anipy_cli_version(),
|
||||
"animdl_version": installed_animdl_version(),
|
||||
"providers": list(provider_bridge.PROVIDERS),
|
||||
}
|
||||
)
|
||||
@@ -1054,15 +1036,15 @@ class Handler(BaseHTTPRequestHandler):
|
||||
|
||||
|
||||
def server_host():
|
||||
return os.environ.get("ANI_CLI_WEB_HOST", "127.0.0.1").strip() or "127.0.0.1"
|
||||
return env_value("KAIZOKU_HOST", "127.0.0.1") or "127.0.0.1"
|
||||
|
||||
|
||||
def server_port():
|
||||
raw = str(os.environ.get("ANI_CLI_WEB_PORT", "8421")).strip() or "8421"
|
||||
raw = env_value("KAIZOKU_PORT", "8421") or "8421"
|
||||
try:
|
||||
port = int(raw, 10)
|
||||
except ValueError as exc:
|
||||
raise ValueError("ANI_CLI_WEB_PORT must be a valid integer") from exc
|
||||
raise ValueError("KAIZOKU_PORT must be a valid integer") from exc
|
||||
if not 1 <= port <= 65535:
|
||||
raise ValueError("ANI_CLI_WEB_PORT must be between 1 and 65535")
|
||||
raise ValueError("KAIZOKU_PORT must be between 1 and 65535")
|
||||
return port
|
||||
|
||||
Reference in New Issue
Block a user