nomadro/apps/ebook/backend/app/db.py
eric d93a355fd5 Migrate navmini/ebook/nomadweb into apps/ as same-origin portal subpaths.
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>
2026-09-28 03:30:34 -05:00

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