144 lines
5.2 KiB
HTML
144 lines
5.2 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<title>Configuration - DearDiary</title>
|
|
<link rel="stylesheet" href="../css/styles.css">
|
|
<link rel="stylesheet" href="../css/docs.css">
|
|
</head>
|
|
<body>
|
|
<nav class="navbar">
|
|
<div class="nav-container">
|
|
<a href="../" class="logo">
|
|
<svg width="32" height="32" viewBox="0 0 100 100"><defs><linearGradient id="g" x1="0%" y1="0%" x2="100%" y2="100%"><stop offset="0%" style="stop-color:#6d28d9"/><stop offset="100%" style="stop-color:#4c1d95"/></linearGradient></defs><rect width="100" height="100" rx="20" fill="url(#g)"/><path d="M25 25 L75 25 L75 80 L25 80 Z" fill="none" stroke="white" stroke-width="3"/><path d="M35 40 L65 40 M35 50 L65 50 M35 60 L55 60" stroke="white" stroke-width="2"/></svg>
|
|
DearDiary
|
|
</a>
|
|
<div class="nav-links">
|
|
<a href="../">Home</a>
|
|
<a href="../docs/" class="active">Docs</a>
|
|
<a href="../blog/">Blog</a>
|
|
<a href="${GIT_URL}" target="_blank">Git Repository</a>
|
|
</div>
|
|
</div>
|
|
</nav>
|
|
|
|
<div class="docs-layout">
|
|
<aside class="docs-sidebar">
|
|
<div class="sidebar-section">
|
|
<h3>Getting Started</h3>
|
|
<a href="installation.html">Installation</a>
|
|
<a href="quick-start.html">Quick Start</a>
|
|
</div>
|
|
<div class="sidebar-section">
|
|
<h3>Configuration</h3>
|
|
<a href="configuration.html" class="active">Environment</a>
|
|
<a href="api.html">API Reference</a>
|
|
</div>
|
|
<div class="sidebar-section">
|
|
<h3>Features</h3>
|
|
<a href="ai-providers.html">AI Providers</a>
|
|
<a href="events.html">Events</a>
|
|
<a href="export-import.html">Export & Import</a>
|
|
</div>
|
|
</aside>
|
|
|
|
<main class="docs-content">
|
|
<h1>Configuration</h1>
|
|
|
|
<p>DearDiary uses environment variables for configuration. Create a <code>.env</code> file in the project root.</p>
|
|
|
|
<h2>Environment Variables</h2>
|
|
|
|
<table>
|
|
<tr>
|
|
<th>Variable</th>
|
|
<th>Default</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
<tr>
|
|
<td><code>BACKEND_JWT_SECRET</code></td>
|
|
<td><em>Required</em></td>
|
|
<td>Secret key for JWT token signing. Generate a strong random string.</td>
|
|
</tr>
|
|
<tr>
|
|
<td><code>BACKEND_PORT</code></td>
|
|
<td>3001</td>
|
|
<td>Port for the backend API server</td>
|
|
</tr>
|
|
<tr>
|
|
<td><code>BACKEND_CORS_ORIGIN</code></td>
|
|
<td>*</td>
|
|
<td>CORS allowed origins (comma-separated)</td>
|
|
</tr>
|
|
<tr>
|
|
<td><code>BACKEND_REGISTRATION_ENABLED</code></td>
|
|
<td>false</td>
|
|
<td>Allow new user registration (true/false)</td>
|
|
</tr>
|
|
<tr>
|
|
<td><code>BACKEND_DATABASE_URL</code></td>
|
|
<td>file:/data/deardiary.db</td>
|
|
<td>SQLite database path</td>
|
|
</tr>
|
|
<tr>
|
|
<td><code>BACKEND_MEDIA_DIR</code></td>
|
|
<td>/data/media</td>
|
|
<td>Directory for uploaded media files</td>
|
|
</tr>
|
|
<tr>
|
|
<td><code>BACKEND_DEFAULT_USER_EMAIL</code></td>
|
|
<td>-</td>
|
|
<td>Email for default admin user (created on first start)</td>
|
|
</tr>
|
|
<tr>
|
|
<td><code>BACKEND_DEFAULT_USER_PASSWORD</code></td>
|
|
<td>-</td>
|
|
<td>Password for default admin user</td>
|
|
</tr>
|
|
<tr>
|
|
<td><code>BACKEND_DEFAULT_AI_PROVIDER</code></td>
|
|
<td>groq</td>
|
|
<td>Default AI provider (groq, openai, anthropic, ollama, lmstudio)</td>
|
|
</tr>
|
|
<tr>
|
|
<td><code>BACKEND_DEFAULT_AI_MODEL</code></td>
|
|
<td>llama-3.3-70b-versatile</td>
|
|
<td>Default AI model</td>
|
|
</tr>
|
|
<tr>
|
|
<td><code>BACKEND_DEFAULT_AI_API_KEY</code></td>
|
|
<td>-</td>
|
|
<td>Default API key for AI provider</td>
|
|
</tr>
|
|
<tr>
|
|
<td><code>BACKEND_DEFAULT_AI_BASE_URL</code></td>
|
|
<td>-</td>
|
|
<td>Custom API base URL (for local providers)</td>
|
|
</tr>
|
|
</table>
|
|
|
|
<h2>Example .env File</h2>
|
|
<pre><code>BACKEND_JWT_SECRET=your-super-secret-key-change-this
|
|
BACKEND_CORS_ORIGIN=https://your-domain.com
|
|
BACKEND_REGISTRATION_ENABLED=false
|
|
BACKEND_DEFAULT_USER_EMAIL=admin@your-domain.com
|
|
BACKEND_DEFAULT_USER_PASSWORD=change-me-after-login
|
|
BACKEND_DEFAULT_AI_PROVIDER=groq
|
|
BACKEND_DEFAULT_AI_API_KEY=your-groq-api-key</code></pre>
|
|
|
|
<h2>Using System Default AI Settings</h2>
|
|
<p>When <code>BACKEND_DEFAULT_AI_*</code> variables are set, all new users will use those settings by default. Users can override these in their personal settings.</p>
|
|
|
|
<div class="tip">
|
|
<strong>Tip:</strong> For production, always set <code>BACKEND_REGISTRATION_ENABLED=false</code> and create the admin user via <code>BACKEND_DEFAULT_USER_EMAIL</code> and <code>BACKEND_DEFAULT_USER_PASSWORD</code>.
|
|
</div>
|
|
|
|
<div class="next-steps">
|
|
<a href="installation.html" class="btn">← Installation</a>
|
|
<a href="api.html" class="btn btn-primary">Next: API Reference →</a>
|
|
</div>
|
|
</main>
|
|
</div>
|
|
</body>
|
|
</html> |