Shield external portal jumps (keep EXTERNAL_* for later), serve /nav from static build, and proxy /book + /community to vertical Next apps with Caddy notes. Co-authored-by: Cursor <cursoragent@cursor.com>
18 lines
431 B
Python
18 lines
431 B
Python
"""PocketBase client singleton."""
|
|
|
|
from pocketbase import PocketBase
|
|
|
|
from .config import get_settings
|
|
|
|
_client: PocketBase | None = None
|
|
|
|
|
|
def get_pb() -> PocketBase:
|
|
global _client
|
|
s = get_settings()
|
|
if _client is None:
|
|
_client = PocketBase(s.pb_url)
|
|
if s.pb_admin_email and s.pb_admin_password:
|
|
_client.admins.auth_with_password(s.pb_admin_email, s.pb_admin_password)
|
|
return _client
|