> 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/on-premises-no/konfigurasjon/overleaf-toolkit/github-synkronisering.md).

# GitHub-synkronisering

{% hint style="info" %}
Denne funksjonen er utviklet av [ayaka-notes/overleaf-pro](https://github.com/ayaka-notes/overleaf-pro), modifisert av [yu-i-i/overleaf-cep](https://github.com/yu-i-i/overleaf-cep). Det er introdusert fra v6.2.0 og senere. Det er fortsatt i betastatus. Vi trenger tilbakemeldingen din hvis du har problemer.
{% endhint %}

{% columns %}
{% column %}

<figure><img src="/files/4c1e4b675f728cc13a07d1144e626c3815f7977b" alt=""><figcaption></figcaption></figure>

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

{% column %}

<figure><img src="/files/489f5fb612e2a23f5ac56ef2b1b36d7c91bcd94b" alt=""><figcaption></figcaption></figure>

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

### Sett opp GitHub-synkronisering

{% hint style="warning" %}
Du må aktivere [git-bridge](/on-premises/on-premises-no/konfigurasjon/overleaf-toolkit/git-integration.md) før du bruker GitHub-synkronisering.

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

```dotenv
GIT_BRIDGE_ENABLED=true
```

{% endcode %}
{% endhint %}

Gå til [utviklerinnstillingene](https://github.com/settings/developers) for å opprette GitHub OAuth-applikasjonen din og kopiere din `CLIENT_ID` og `SECRET`.&#x20;

**Notater**: din OAuth-tilbakekallings-URL er: `${OVERLEAF_SITE_URL}/user/github-sync/oauth2/callback`.

Deretter legger du følgende innstillinger til Overleafs miljøvariabelfiler.

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

```dotenv
# brukes til å kryptere brukerens GitHub-tilgangstoken.
# Slik genereres den: `openssl rand -hex 32`
GITHUB_TOKEN_CIPHER_PASSWORD=0123456789ABCDEFG # endre til din egen

# Innstillinger for GitHub-synkronisering
GITHUB_SYNC_ENABLED=true
GITHUB_SYNC_CLIENT_ID=
GITHUB_SYNC_CLIENT_SECRET=

# OAuth-tilbakekallingen er: ${OVERLEAF_SITE_URL}/user/github-sync/oauth2/callback
# (Valgfritt) GITHUB_SYNC_PROXY_URL=http://10.0.0.1:10808
```

{% endcode %}

{% hint style="warning" %}
Før du konfigurerer GitHub OAuth-tilbakekallings-URL-en, må du sørge for `OVERLEAF_SITE_URL` at den er satt riktig.
{% endhint %}

Hvis du befinner deg i Fastlands-Kina, kan det hende du må konfigurere en proxy for å få tilgang til GitHub. Angi følgende miljøvariabel: `GITHUB_SYNC_PROXY_URL=http://10.0.0.1:10808`.

{% hint style="warning" %}
Ikke bruk `127.0.0.1` som proxy-vert. Hvis proxyen kjører på vertsserveren, bruk serverens LAN-IP (for eksempel `192.168.1.xx`)-adressen og sørg for at proxyen er konfigurert til å akseptere tilkoblinger fra enheter på det lokale nettverket.
{% 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/on-premises-no/konfigurasjon/overleaf-toolkit/github-synkronisering.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.
