> For the complete documentation index, see [llms.txt](https://ayakaleaf-pro.ayaka.space/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://ayakaleaf-pro.ayaka.space/on-premises/zh-cn/pei-zhi/overleaf-toolkit/public-access.md).

# 公开访问

您可以通过两种方式提供对您的 Overleaf 实例的访问：

* 与访客共享项目链接
* 允许用户自行注册（仅适用于 [ayaka-notes/overleaf-pro](https://github.com/ayaka-notes/overleaf-pro))

### 访客访问

{% hint style="info" %}
默认情况下，即使用户获得了项目共享链接，他们也必须 **登录** 之后才能加入协作项目编辑会话。
{% endhint %}

若要允许通过链接共享的项目匿名访问，请同时设置以下两个变量：

{% code title="config/variables.env" %}

```dotenv
OVERLEAF_ALLOW_ANONYMOUS_READ_AND_WRITE_SHARING=true
OVERLEAF_ALLOW_PUBLIC_ACCESS=true
```

{% endcode %}

`OVERLEAF_ALLOW_ANONYMOUS_READ_AND_WRITE_SHARING` 启用对通过链接共享的项目进行匿名读写。

`OVERLEAF_ALLOW_PUBLIC_ACCESS` 防止未认证用户被重定向到登录页面。

使用以下设置重新创建容器： `bin/up`。然后在隐私窗口中打开一个链接共享 URL。

### 公开注册

公开注册仅适用于 [ayaka-notes/overleaf-pro](https://github.com/ayaka-notes/overleaf-pro).

{% hint style="danger" %}
请注意，一旦启用公开注册， **任何人** 只要能访问您的 Overleaf 实例，都可以注册为用户。

注册过程不会验证电子邮件地址，因此请仅在内网或受信任的环境中使用，或者在不再需要注册时将其禁用。
{% endhint %}

默认情况下，Community Edition 和 Overleaf Pro 都不允许公开注册。

要启用它，请将以下内容添加到 `config/variables.env`:

{% code title="config/variables.env" %}

```dotenv
OVERLEAF_ALLOW_PUBLIC_REGISTRATION=true
```

{% endcode %}

使用以下设置重新创建容器： `bin/up`.

然后点击 **注册** 或访问 `/register`.

<figure><img src="/files/e1c1fb9b74fb69269baaf974cfa3d4211fedbbd9" alt=""><figcaption></figcaption></figure>

### 受限域名注册

受限域名公开注册仅适用于 [ayaka-notes/overleaf-pro](https://github.com/ayaka-notes/overleaf-pro).

在启用此功能之前，请先配置邮件发送，以便用户能够接收邀请和通知。参见 [电子邮件投递](/on-premises/zh-cn/pei-zhi/overleaf-toolkit/email-delivery.md).

然后将以下一行添加到 `config/variables.env`:

{% code title="config/variables.env" overflow="wrap" %}

```dotenv
OVERLEAF_ALLOW_PUBLIC_REGISTRATION=@example.domain
```

{% endcode %}

`OVERLEAF_ALLOW_PUBLIC_REGISTRATION` 可以设置为：

* `true` 允许任何能够访问该站点的人注册
* `@example.domain` 将注册限制为该域名下的电子邮件


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://ayakaleaf-pro.ayaka.space/on-premises/zh-cn/pei-zhi/overleaf-toolkit/public-access.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
