ChatSite Web and Overleaf Feature¶
ChatSite is the web/service entry point for the Chat series. The Overleaf editor feature lives here and calls ChatOL as a tool module; ChatOL does not serve the web application.
What It Provides¶
- A shared ChatLogin
/loginpage,/login/sessionbootstrap endpoint, and/login/assets/*resources for the standard-library ChatSite hub. The Hub uses the ChatLogin UI-only dependency and keeps the default login copy Chinese-first. - An
/overleaffeature workspace for Overleaf editing. - Server-side Settings for the Overleaf endpoint, Overleaf credentials/session, OpenAI model, and OpenAI API key.
- Project and file browsing against the configured Overleaf instance.
- Single-file reading through Overleaf's internal doc download route.
- Existing doc saves through Overleaf's real-time OT update channel.
- New root-level text file creation through ChatOL upload.
- Project compile with authenticated PDF/log artifact preview.
- Conversation history with one OpenAI Responses API tool named
overleaf. - Per-conversation OpenAI Responses API state: each conversation stores its own
previous_response_idchain so model/tool context is isolated across chats.
Runtime Boundary¶
ChatSite owns:
- HTTP serving and static assets
- login credential authority from the configured single ChatSite admin account
- ChatLogin-backed browser sessions in a separate
auth.sqlite3 - user-facing Settings
- conversation state
- service deployment and nginx/public entry
ChatOL owns:
- Overleaf login/session bootstrap using Overleaf tool credentials from Settings or the private Overleaf deployment env
- project/file workflow primitives
- compile/download APIs
- Overleaf-specific data models and errors
Environment¶
Required for login:
CHATSITE_WEB_ADMIN_PASSWORDorCHATSITE_WEB_ADMIN_PASSWORD_FILE
Recommended for deployment:
CHATSITE_WEB_ADMIN_EMAIL, defaultadmin@example.testCHATSITE_WEB_HOST, default127.0.0.1CHATSITE_WEB_PORT, default18082CHATSITE_WEB_DATA_DIR, default~/.chatarch/chatsiteCHATSITE_WEB_PUBLIC_URL, default built from host/port; must be an HTTP(S) origin and is trusted for browser write origins and Secure cookie selectionCHATSITE_WEB_ALLOWED_ORIGINS, optional comma-separated extra HTTP(S) origins for browser writesCHATSITE_WEB_SECURE_COOKIE, optionaltrue/false; defaults fromCHATSITE_WEB_PUBLIC_URLCHATSITE_OVERLEAF_DEFAULT_URL, defaulthttp://127.0.0.1:8090CHATSITE_OVERLEAF_ENV_FILE, points at an existing private Overleaf.envOPENAI_API_KEYorCHATSITE_OPENAI_API_KEYOPENAI_BASE_URL, defaulthttps://api.openai.com/v1OPENAI_MODELorCHATSITE_WEB_OPENAI_MODEL, defaultgpt-5.5
Do not commit passwords, session cookies, API keys, or deployment .env files.
chatsite.sqlite3 remains authoritative for Settings, Overleaf transport
secrets, conversations, messages, and compile artifacts. Browser login sessions
are stored separately in auth.sqlite3 through ChatLogin as token digests with
TTL, CSRF secrets, bounded capacity, logout revocation, and credential-rotation
revocation. Older local sessions rows are not accepted as a fallback; users may
need to sign in again after upgrading.