> 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/ru/konfiguraciya/overleaf-toolkit/github-synchronisation.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/2c600f2b328dec87b0d4a636d189d1a612f49ed1" 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` и `СЕКРЕТ`.

**Примечания**: ваш 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://ayakaleaf-pro.ayaka.space/on-premises/ru/konfiguraciya/overleaf-toolkit/github-synchronisation.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.
