mirror of
https://gitlvb.teallvbs.xyz/IQ.Lvbs/IQ.Pilot.git
synced 2026-07-16 18:22:07 +08:00
34 lines
1.0 KiB
Python
34 lines
1.0 KiB
Python
"""
|
|
Copyright © IQ.Lvbs, apart of Project Teal Lvbs, All Rights Reserved, licensed under https://konn3kt.com/tos
|
|
"""
|
|
|
|
from typing import Optional
|
|
|
|
|
|
# Read-only access to the private tile bundle host (same konn3kt read user as the
|
|
# model selector; the IQMapTiles repo grants it read).
|
|
TILES_AUTH_USERNAME = "konn3kt_iq_auth"
|
|
TILES_AUTH_PAT = "014d95baa71e5bc717f66674a40f2c52ea7c0386"
|
|
|
|
# Bundle hosts, first reachable index.json wins. Primary is the R2 bucket (iqnav) behind
|
|
# the public maps.konn3kt.com domain; the gitea endpoints stay as auth'd fallbacks.
|
|
TILES_BASE_URLS = [
|
|
"https://maps.konn3kt.com/iqosmd/v1",
|
|
"https://git.konn3kt.com/api/packages/teal/generic/osmaps/v1",
|
|
"https://git.konn3kt.com/teal/IQMapTiles/raw/branch/main",
|
|
]
|
|
|
|
|
|
def _has_auth() -> bool:
|
|
return bool(TILES_AUTH_USERNAME and TILES_AUTH_PAT)
|
|
|
|
|
|
def get_requests_auth() -> Optional[tuple[str, str]]:
|
|
if not _has_auth():
|
|
return None
|
|
return TILES_AUTH_USERNAME, TILES_AUTH_PAT
|
|
|
|
|
|
def get_base_urls() -> list[str]:
|
|
return list(TILES_BASE_URLS)
|