> 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/on-premises-cs/konfigurace/overleaf-toolkit/github-synchronisation.md).

# Synchronizace s GitHubem

{% hint style="info" %}
Tato funkce byla vyvinuta [ayaka-notes/overleaf-pro](https://github.com/ayaka-notes/overleaf-pro), upraveno od [yu-i-i/overleaf-cep](https://github.com/yu-i-i/overleaf-cep). Byla zavedena od verze v6.2.0 a novější. Stále je ve stavu beta. Pokud narazíte na jakýkoli problém, potřebujeme vaši zpětnou vazbu.
{% endhint %}

{% columns %}
{% column %}

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

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

{% column %}

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

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

### Nastavit synchronizaci s GitHubem

{% hint style="warning" %}
Nejprve je třeba povolit [git-bridge](/on-premises/on-premises-cs/konfigurace/overleaf-toolkit/git-integration.md) před použitím synchronizace s GitHubem.

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

```dotenv
GIT_BRIDGE_ENABLED=true
```

{% endcode %}
{% endhint %}

Navštivte [nastavení pro vývojáře](https://github.com/settings/developers) abyste vytvořili svou aplikaci GitHub OAuth a zkopírovali své `CLIENT_ID` a `SECRET`.

**Poznámky**: vaše URL zpětného volání OAuth je: `${OVERLEAF_SITE_URL}/user/github-sync/oauth2/callback`.

Poté přidejte následující nastavení do souborů proměnných prostředí Overleafu.

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

```dotenv
# používá se k šifrování přístupového tokenu GitHubu uživatele.
# Jak vygenerovat: `openssl rand -hex 32`
GITHUB_TOKEN_CIPHER_PASSWORD=0123456789ABCDEFG # změňte na své

# Nastavení synchronizace GitHubu
GITHUB_SYNC_ENABLED=true
GITHUB_SYNC_CLIENT_ID=
GITHUB_SYNC_CLIENT_SECRET=

# OAuth callback je: ${OVERLEAF_SITE_URL}/user/github-sync/oauth2/callback
# (Volitelné) GITHUB_SYNC_PROXY_URL=http://10.0.0.1:10808
```

{% endcode %}

{% hint style="warning" %}
Před konfigurací URL zpětného volání GitHub OAuth se ujistěte `OVERLEAF_SITE_URL` je správně nastaveno.
{% endhint %}

Pokud se nacházíte v pevninské Číně, možná budete muset pro přístup ke GitHubu nakonfigurovat proxy. Nastavte následující proměnnou prostředí: `GITHUB_SYNC_PROXY_URL=http://10.0.0.1:10808`.

{% hint style="warning" %}
Nepoužívejte `127.0.0.1` pro hostitele proxy. Pokud proxy běží na hostitelském serveru, použijte LAN IP adresu serveru (např. `192.168.1.xx`) a ujistěte se, že proxy je nakonfigurována tak, aby přijímala připojení ze zařízení v místní síti.
{% 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/on-premises-cs/konfigurace/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.
