> For the complete documentation index, see [llms.txt](https://overleaf-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://overleaf-pro.ayaka.space/on-premises/ru/konfiguraciya/overleaf-toolkit/sinkhronizaciya-s-github.md).

# Синхронизация с GitHub

{% hint style="info" %}
Эта функция разработана [ayaka-notes/overleaf-pro](https://github.com/ayaka-notes/overleaf-pro), изменено [yu-i-i/overleaf-cep](https://github.com/yu-i-i/overleaf-cep). Он добавлен в версии v6.2.0 и позже. Он всё ещё находится в бета-статусе. Нам нужна ваша обратная связь, если у вас возникнут какие-либо проблемы.
{% endhint %}

{% columns %}
{% column %}

<figure><img src="/files/8083ee501e25c3d18e54fa85309e5d36ea8ab380" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/4cab103229be3273760801b9f1c684a2d6927dd3" alt=""><figcaption></figcaption></figure>
{% endcolumn %}

{% column %}

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

<figure><img src="/files/1c657176c743d4266cf5082525a66d7fc2a89f34" alt=""><figcaption></figcaption></figure>
{% endcolumn %}
{% endcolumns %}

### Настройка синхронизации GitHub

{% hint style="warning" %}
Вам нужно включить [git-bridge](/on-premises/ru/konfiguraciya/overleaf-toolkit/git-integration.md) сначала, прежде чем использовать синхронизацию GitHub.

{% code title="config/overleaf.rc" %}

```dotenv
GIT_BRIDGE_ENABLED=true
```

{% endcode %}
{% endhint %}

Перейдите в [настройки разработчика](https://github.com/settings/developers) чтобы создать ваше приложение GitHub OAuth и скопировать ваши `CLIENT_ID` и `SECRET`.&#x20;

**Примечания**: ваш URL обратного вызова OAuth: `${OVERLEAF_SITE_URL}/user/github-sync/oauth2/callback`.

Затем добавьте следующие настройки в ваши файлы переменных окружения Overleaf.

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

```dotenv
# используется для шифрования токена доступа GitHub пользователя.
# Как сгенерировать: `openssl rand -hex 32`
GITHUB_TOKEN_CIPHER_PASSWORD=0123456789ABCDEFG # замените на свой

# Настройки синхронизации GitHub
GITHUB_SYNC_ENABLED=true
GITHUB_SYNC_CLIENT_ID=
GITHUB_SYNC_CLIENT_SECRET=

# URL обратного вызова OAuth: ${OVERLEAF_SITE_URL}/user/github-sync/oauth2/callback
# (Необязательно) GITHUB_SYNC_PROXY_URL=http://10.0.0.1:10808
```

{% endcode %}

{% hint style="warning" %}
Перед настройкой URL обратного вызова GitHub OAuth убедитесь `OVERLEAF_SITE_URL` что он задан правильно.
{% endhint %}

Если вы находитесь в материковом Китае, вам может потребоваться настроить прокси для доступа к GitHub. Установите следующую переменную окружения: `GITHUB_SYNC_PROXY_URL=http://10.0.0.1:10808`.

{% hint style="warning" %}
Не используйте `127.0.0.1` для хоста прокси. Если прокси запущен на хост-сервере, используйте LAN-IP сервера (например, `192.168.1.xx`) адрес и убедитесь, что прокси настроен на приём подключений от устройств в локальной сети.
{% endhint %}


---

# 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://overleaf-pro.ayaka.space/on-premises/ru/konfiguraciya/overleaf-toolkit/sinkhronizaciya-s-github.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.
