Files
chatgpt-ui/guide/configuration.html
github-actions[bot] 3360252d06 Deploy to GitHub pages
2023-04-18 02:45:52 +00:00

46 lines
19 KiB
HTML

<!DOCTYPE html>
<html lang="en-US">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1">
<meta name="generator" content="VuePress 2.0.0-beta.61">
<style>
:root {
--c-bg: #fff;
}
html.dark {
--c-bg: #22272e;
}
html, body {
background-color: var(--c-bg);
}
</style>
<script>
const userMode = localStorage.getItem('vuepress-color-scheme');
const systemDarkMode = window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches;
if (userMode === 'dark' || (userMode !== 'light' && systemDarkMode)) {
document.documentElement.classList.toggle('dark', true);
}
</script>
<title>Configuration Reference | ChatGPT UI</title><meta name="description" content="A ChatGPT web client">
<link rel="preload" href="/chatgpt-ui/assets/style-ad6949cb.css" as="style"><link rel="stylesheet" href="/chatgpt-ui/assets/style-ad6949cb.css">
<link rel="modulepreload" href="/chatgpt-ui/assets/app-525ee8ad.js"><link rel="modulepreload" href="/chatgpt-ui/assets/framework-5866ffd3.js"><link rel="modulepreload" href="/chatgpt-ui/assets/configuration.html-a7684ba6.js"><link rel="modulepreload" href="/chatgpt-ui/assets/configuration.html-ed512da6.js"><link rel="prefetch" href="/chatgpt-ui/assets/index.html-f32af385.js" as="script"><link rel="prefetch" href="/chatgpt-ui/assets/buymeacoffee.html-f20ec2fb.js" as="script"><link rel="prefetch" href="/chatgpt-ui/assets/development.html-117eb2b5.js" as="script"><link rel="prefetch" href="/chatgpt-ui/assets/problems.html-3485ea96.js" as="script"><link rel="prefetch" href="/chatgpt-ui/assets/quick-start.html-5d24620c.js" as="script"><link rel="prefetch" href="/chatgpt-ui/assets/index.html-a9203641.js" as="script"><link rel="prefetch" href="/chatgpt-ui/assets/buymeacoffee.html-22a781eb.js" as="script"><link rel="prefetch" href="/chatgpt-ui/assets/configuration.html-0ef661b4.js" as="script"><link rel="prefetch" href="/chatgpt-ui/assets/development.html-b8d21bb5.js" as="script"><link rel="prefetch" href="/chatgpt-ui/assets/problems.html-f1039fc4.js" as="script"><link rel="prefetch" href="/chatgpt-ui/assets/quick-start.html-91a3ce5d.js" as="script"><link rel="prefetch" href="/chatgpt-ui/assets/404.html-60b35caa.js" as="script"><link rel="prefetch" href="/chatgpt-ui/assets/index.html-18d42ac0.js" as="script"><link rel="prefetch" href="/chatgpt-ui/assets/buymeacoffee.html-138309cb.js" as="script"><link rel="prefetch" href="/chatgpt-ui/assets/development.html-df5e9336.js" as="script"><link rel="prefetch" href="/chatgpt-ui/assets/problems.html-84e6145b.js" as="script"><link rel="prefetch" href="/chatgpt-ui/assets/quick-start.html-b336d0c1.js" as="script"><link rel="prefetch" href="/chatgpt-ui/assets/index.html-d042d854.js" as="script"><link rel="prefetch" href="/chatgpt-ui/assets/buymeacoffee.html-5158290f.js" as="script"><link rel="prefetch" href="/chatgpt-ui/assets/configuration.html-99825d43.js" as="script"><link rel="prefetch" href="/chatgpt-ui/assets/development.html-989a2b06.js" as="script"><link rel="prefetch" href="/chatgpt-ui/assets/problems.html-dabd58d0.js" as="script"><link rel="prefetch" href="/chatgpt-ui/assets/quick-start.html-fc1bc91c.js" as="script"><link rel="prefetch" href="/chatgpt-ui/assets/404.html-87d54bd8.js" as="script">
</head>
<body>
<div id="app"><!--[--><div class="theme-container"><!--[--><header class="navbar"><div class="toggle-sidebar-button" title="toggle sidebar" aria-expanded="false" role="button" tabindex="0"><div class="icon" aria-hidden="true"><span></span><span></span><span></span></div></div><span><a href="/chatgpt-ui/" class=""><!----><span class="site-name">ChatGPT UI</span></a></span><div class="navbar-items-wrapper" style=""><!--[--><!--]--><nav class="navbar-items can-hide"><!--[--><div class="navbar-item"><a href="/chatgpt-ui/" class="" aria-label="Guide"><!--[--><!--]--> Guide <!--[--><!--]--></a></div><div class="navbar-item"><a class="external-link" href="https://github.com/WongSaang/chatgpt-ui/releases" rel="noopener noreferrer" target="_blank" aria-label="Changelog"><!--[--><!--]--> Changelog <span><svg class="external-link-icon" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path><polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg><span class="external-link-icon-sr-only">open in new window</span></span><!--[--><!--]--></a></div><div class="navbar-item"><div class="navbar-dropdown-wrapper"><button class="navbar-dropdown-title" type="button" aria-label="Select language"><span class="title">Languages</span><span class="arrow down"></span></button><button class="navbar-dropdown-title-mobile" type="button" aria-label="Select language"><span class="title">Languages</span><span class="right arrow"></span></button><ul style="display:none;" class="navbar-dropdown"><!--[--><li class="navbar-dropdown-item"><a aria-current="page" href="/chatgpt-ui/guide/configuration.html" class="router-link-active router-link-exact-active router-link-active" aria-label="English"><!--[--><!--]--> English <!--[--><!--]--></a></li><li class="navbar-dropdown-item"><a href="/chatgpt-ui/zh/guide/configuration.html" class="" aria-label="简体中文"><!--[--><!--]--> 简体中文 <!--[--><!--]--></a></li><!--]--></ul></div></div><!--]--></nav><!--[--><!--]--><button class="toggle-color-mode-button" title="toggle color mode"><svg style="" class="icon" focusable="false" viewBox="0 0 32 32"><path d="M16 12.005a4 4 0 1 1-4 4a4.005 4.005 0 0 1 4-4m0-2a6 6 0 1 0 6 6a6 6 0 0 0-6-6z" fill="currentColor"></path><path d="M5.394 6.813l1.414-1.415l3.506 3.506L8.9 10.318z" fill="currentColor"></path><path d="M2 15.005h5v2H2z" fill="currentColor"></path><path d="M5.394 25.197L8.9 21.691l1.414 1.415l-3.506 3.505z" fill="currentColor"></path><path d="M15 25.005h2v5h-2z" fill="currentColor"></path><path d="M21.687 23.106l1.414-1.415l3.506 3.506l-1.414 1.414z" fill="currentColor"></path><path d="M25 15.005h5v2h-5z" fill="currentColor"></path><path d="M21.687 8.904l3.506-3.506l1.414 1.415l-3.506 3.505z" fill="currentColor"></path><path d="M15 2.005h2v5h-2z" fill="currentColor"></path></svg><svg style="display:none;" class="icon" focusable="false" viewBox="0 0 32 32"><path d="M13.502 5.414a15.075 15.075 0 0 0 11.594 18.194a11.113 11.113 0 0 1-7.975 3.39c-.138 0-.278.005-.418 0a11.094 11.094 0 0 1-3.2-21.584M14.98 3a1.002 1.002 0 0 0-.175.016a13.096 13.096 0 0 0 1.825 25.981c.164.006.328 0 .49 0a13.072 13.072 0 0 0 10.703-5.555a1.01 1.01 0 0 0-.783-1.565A13.08 13.08 0 0 1 15.89 4.38A1.015 1.015 0 0 0 14.98 3z" fill="currentColor"></path></svg></button><!----></div></header><!--]--><div class="sidebar-mask"></div><!--[--><aside class="sidebar"><nav class="navbar-items"><!--[--><div class="navbar-item"><a href="/chatgpt-ui/" class="" aria-label="Guide"><!--[--><!--]--> Guide <!--[--><!--]--></a></div><div class="navbar-item"><a class="external-link" href="https://github.com/WongSaang/chatgpt-ui/releases" rel="noopener noreferrer" target="_blank" aria-label="Changelog"><!--[--><!--]--> Changelog <span><svg class="external-link-icon" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path><polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg><span class="external-link-icon-sr-only">open in new window</span></span><!--[--><!--]--></a></div><div class="navbar-item"><div class="navbar-dropdown-wrapper"><button class="navbar-dropdown-title" type="button" aria-label="Select language"><span class="title">Languages</span><span class="arrow down"></span></button><button class="navbar-dropdown-title-mobile" type="button" aria-label="Select language"><span class="title">Languages</span><span class="right arrow"></span></button><ul style="display:none;" class="navbar-dropdown"><!--[--><li class="navbar-dropdown-item"><a aria-current="page" href="/chatgpt-ui/guide/configuration.html" class="router-link-active router-link-exact-active router-link-active" aria-label="English"><!--[--><!--]--> English <!--[--><!--]--></a></li><li class="navbar-dropdown-item"><a href="/chatgpt-ui/zh/guide/configuration.html" class="" aria-label="简体中文"><!--[--><!--]--> 简体中文 <!--[--><!--]--></a></li><!--]--></ul></div></div><!--]--></nav><!--[--><!--]--><ul class="sidebar-items"><!--[--><li><p tabindex="0" class="sidebar-item sidebar-heading active">Guide <!----></p><ul style="" class="sidebar-item-children"><!--[--><li><a href="/chatgpt-ui/" class="sidebar-item" aria-label="Introduction"><!--[--><!--]--> Introduction <!--[--><!--]--></a><!----></li><li><a href="/chatgpt-ui/guide/quick-start.html" class="sidebar-item" aria-label="Quick Start"><!--[--><!--]--> Quick Start <!--[--><!--]--></a><!----></li><li><a aria-current="page" href="/chatgpt-ui/guide/configuration.html" class="router-link-active router-link-exact-active router-link-active sidebar-item active" aria-label="Configuration Reference"><!--[--><!--]--> Configuration Reference <!--[--><!--]--></a><ul style="" class="sidebar-item-children"><!--[--><li><a aria-current="page" href="/chatgpt-ui/guide/configuration.html#database" class="router-link-active router-link-exact-active sidebar-item" aria-label="Database"><!--[--><!--]--> Database <!--[--><!--]--></a><!----></li><li><a aria-current="page" href="/chatgpt-ui/guide/configuration.html#email-verification" class="router-link-active router-link-exact-active sidebar-item" aria-label="Email verification"><!--[--><!--]--> Email verification <!--[--><!--]--></a><!----></li><li><a aria-current="page" href="/chatgpt-ui/guide/configuration.html#api-proxy" class="router-link-active router-link-exact-active sidebar-item" aria-label="API Proxy"><!--[--><!--]--> API Proxy <!--[--><!--]--></a><!----></li><li><a aria-current="page" href="/chatgpt-ui/guide/configuration.html#backend-csrf-whitelist" class="router-link-active router-link-exact-active sidebar-item" aria-label="Backend CSRF whitelist"><!--[--><!--]--> Backend CSRF whitelist <!--[--><!--]--></a><!----></li><li><a aria-current="page" href="/chatgpt-ui/guide/configuration.html#client-configuration" class="router-link-active router-link-exact-active sidebar-item" aria-label="Client Configuration"><!--[--><!--]--> Client Configuration <!--[--><!--]--></a><!----></li><li><a aria-current="page" href="/chatgpt-ui/guide/configuration.html#user-registration-control" class="router-link-active router-link-exact-active sidebar-item" aria-label="User Registration Control"><!--[--><!--]--> User Registration Control <!--[--><!--]--></a><!----></li><li><a aria-current="page" href="/chatgpt-ui/guide/configuration.html#web-search-function-control" class="router-link-active router-link-exact-active sidebar-item" aria-label="Web Search Function Control"><!--[--><!--]--> Web Search Function Control <!--[--><!--]--></a><!----></li><li><a aria-current="page" href="/chatgpt-ui/guide/configuration.html#frugal-mode-control" class="router-link-active router-link-exact-active sidebar-item" aria-label="Frugal Mode Control"><!--[--><!--]--> Frugal Mode Control <!--[--><!--]--></a><!----></li><!--]--></ul></li><li><a href="/chatgpt-ui/guide/problems.html" class="sidebar-item" aria-label="Encountering Issues"><!--[--><!--]--> Encountering Issues <!--[--><!--]--></a><!----></li><li><a href="/chatgpt-ui/guide/development.html" class="sidebar-item" aria-label="Development Guide"><!--[--><!--]--> Development Guide <!--[--><!--]--></a><!----></li><li><a href="/chatgpt-ui/guide/buymeacoffee.html" class="sidebar-item" aria-label="Donation"><!--[--><!--]--> Donation <!--[--><!--]--></a><!----></li><!--]--></ul></li><!--]--></ul><!--[--><!--]--></aside><!--]--><!--[--><main class="page"><!--[--><!--]--><div class="theme-default-content"><!--[--><!--]--><div><h1 id="configuration-reference" tabindex="-1"><a class="header-anchor" href="#configuration-reference" aria-hidden="true">#</a> Configuration Reference</h1><h2 id="database" tabindex="-1"><a class="header-anchor" href="#database" aria-hidden="true">#</a> Database</h2><p>By default, the backend uses the built-in Sqlite to store data. If an external database is not connected, the data will be lost after the container is destroyed.</p><p>The <code>chatgpt-ui-wsgi-server</code> image provides the environment variable <code>DB_URL</code> to configure the connection to an external database. The following table shows the link format of the <code>DB_URL</code>.</p><table><thead><tr><th>DB</th><th>LINK</th></tr></thead><tbody><tr><td>PostgreSQL</td><td>postgres://USER:PASSWORD@HOST:PORT/DATABASE_NAME</td></tr><tr><td>MySQL</td><td>mysql://USER:PASSWORD@HOST:PORT/DATABASE_NAME</td></tr><tr><td>SQLite</td><td>sqlite:///PATH</td></tr></tbody></table><p>For example, if I am using PostgreSQL, the configuration is as follows:</p><div class="language-text line-numbers-mode" data-ext="text"><pre class="language-text"><code>backend-wsgi-server:
image: wongsaang/chatgpt-ui-wsgi-server:latest
environment:
- DB_URL=postgres://postgres:postgrespw@localhost:49153/chatgpt
</code></pre><div class="line-numbers" aria-hidden="true"><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div></div></div><h2 id="email-verification" tabindex="-1"><a class="header-anchor" href="#email-verification" aria-hidden="true">#</a> Email verification</h2><p>If you open the user registration feature and need to send email activation links to users, you need to configure the following environment variables in the <code>wsgi-server</code> service:</p><table><thead><tr><th>Parameters</th><th>Description</th><th>Default</th></tr></thead><tbody><tr><td>ACCOUNT_EMAIL_VERIFICATION</td><td>E-mail authentication method, optional value: none, optional, mandatory</td><td>optional</td></tr><tr><td>EMAIL_HOST</td><td>SMTP server address</td><td>smtp.mailgun.org</td></tr><tr><td>EMAIL_PORT</td><td>SMTP server port</td><td>587</td></tr><tr><td>EMAIL_HOST_USER</td><td>User name</td><td>-</td></tr><tr><td>EMAIL_HOST_PASSWORD</td><td>Password</td><td>-</td></tr><tr><td>EMAIL_USE_TLS</td><td>Whether to encrypt</td><td>True</td></tr><tr><td>EMAIL_FROM</td><td>From email</td><td>webmaster@localhost</td></tr></tbody></table><h2 id="api-proxy" tabindex="-1"><a class="header-anchor" href="#api-proxy" aria-hidden="true">#</a> API Proxy</h2><p>If you are unable to request the OpenAI API address due to network restrictions, you can configure a proxy in the <code>wsgi-server</code> service. You will need to search for how to set up a proxy server on your own.</p><p>For example:</p><div class="language-text line-numbers-mode" data-ext="text"><pre class="language-text"><code>backend-wsgi-server:
image: wongsaang/chatgpt-ui-wsgi-server:latest
environment:
- OPENAI_API_PROXY=https://openai.proxy.com/v1
</code></pre><div class="line-numbers" aria-hidden="true"><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div></div></div><h2 id="backend-csrf-whitelist" tabindex="-1"><a class="header-anchor" href="#backend-csrf-whitelist" aria-hidden="true">#</a> Backend CSRF whitelist</h2><p>If you encounter <code>CSRF verification failed</code> while accessing the management background, your <code>APP_DOMAIN</code> may not be configured correctly. Under the <code>wsgi-server</code> service, there is an environment variable <code>wsgi-server</code>. Its value should be the address and port of <code>backend-web-server</code>, default: <code>localhost:9000</code>.</p><p>Suppose I have resolved the domain name <code>chagpt.com</code> to the server, and my <code>backend-web-server</code> service is bound to port 9000. The correct configuration is as follows:</p><div class="language-text line-numbers-mode" data-ext="text"><pre class="language-text"><code>backend-wsgi-server:
image: wongsaang/chatgpt-ui-wsgi-server:latest
environment:
- APP_DOMAIN=chagpt.com:9000
</code></pre><div class="line-numbers" aria-hidden="true"><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div></div></div><h2 id="client-configuration" tabindex="-1"><a class="header-anchor" href="#client-configuration" aria-hidden="true">#</a> Client Configuration</h2><table><thead><tr><th>Parameter</th><th>Description</th><th>Default Value</th></tr></thead><tbody><tr><td>SERVER_DOMAIN</td><td>Server Address</td><td>http://backend-web-server</td></tr><tr><td>DEFAULT_LOCALE</td><td>Default Language</td><td>en</td></tr><tr><td>NUXT_PUBLIC_APP_NAME</td><td>Application Name</td><td>ChatGPT UI</td></tr><tr><td>NUXT_PUBLIC_TYPEWRITER</td><td>Enable Typewriter Effect [true/false]</td><td>true</td></tr><tr><td>NUXT_PUBLIC_TYPEWRITER_DELAY</td><td>Typewriter Effect Delay in milliseconds</td><td>50</td></tr></tbody></table><h2 id="user-registration-control" tabindex="-1"><a class="header-anchor" href="#user-registration-control" aria-hidden="true">#</a> User Registration Control</h2><p>After deployment, there is an <code>open_registration</code> setting under <code>Chat-&gt;Settings</code> in the admin panel to control whether user registration is allowed. The default value is <code>True</code> (allowing user registration). If not needed, please change it to <code>False</code>.</p><h2 id="web-search-function-control" tabindex="-1"><a class="header-anchor" href="#web-search-function-control" aria-hidden="true">#</a> Web Search Function Control</h2><p>This feature is disabled by default. You can enable it in the admin panel under <code>Chat-&gt;Settings</code>. There is a setting called <code>open_web_search</code>, set its value to <code>True</code>.</p><h2 id="frugal-mode-control" tabindex="-1"><a class="header-anchor" href="#frugal-mode-control" aria-hidden="true">#</a> Frugal Mode Control</h2><p>This feature is enabled by default. You can disable it in the <code>Chat-&gt;Settings</code> section of the management backend. There is a setting called <code>open_frugal_mode_control</code> in Settings. Set its value to <code>False</code>.</p></div><!--[--><!--]--></div><footer class="page-meta"><!----><div class="meta-item last-updated"><span class="meta-item-label">Last Updated: </span><!----></div><div class="meta-item contributors"><span class="meta-item-label">Contributors: </span><span class="meta-item-info"><!--[--><!--[--><span class="contributor" title="email: rafiwx@gmail.com">Rafi</span><!--[-->, <!--]--><!--]--><!--[--><span class="contributor" title="email: iluozan@126.com">AI&amp;I</span><!----><!--]--><!--]--></span></div></footer><nav class="page-nav"><p class="inner"><span class="prev"><a href="/chatgpt-ui/guide/quick-start.html" class="" aria-label="Quick Start"><!--[--><!--]--> Quick Start <!--[--><!--]--></a></span><span class="next"><a href="/chatgpt-ui/guide/problems.html" class="" aria-label="Encountering Issues"><!--[--><!--]--> Encountering Issues <!--[--><!--]--></a></span></p></nav><!--[--><!--]--></main><!--]--></div><!----><!--]--></div>
<script type="module" src="/chatgpt-ui/assets/app-525ee8ad.js" defer></script>
</body>
</html>