# Etapa 4

Antes de poder usar o aplicativo, atualize o arquivo de configuração e execute um comando de reconfiguração. Primeiro, abra o arquivo de configuração do GitLab com seu editor de texto preferido. Este exemplo usa `nano`:

```
sudo nano /etc/gitlab/gitlab.rb

```

Procure a linha de configuração `external_url`. Atualize-o para corresponder ao seu domínio e certifique-se de alterar `http` para `https` para redirecionar automaticamente os usuários para o site protegido pelo certificado Let's Encrypt:

{% code title="/etc/gitlab/gitlab.rb" %}

```
...
## GitLab URL
##! URL on which GitLab will be reachable.
##! For more details on configuring external_url see:
##! https://docs.gitlab.com/omnibus/settings/configuration.html#configuring-the-external-url-for-gitlab
##!
##! Note: During installation/upgrades, the value of the environment variable
##! EXTERNAL_URL will be used to populate/replace this value.
##! On AWS EC2 instances, we also attempt to fetch the public hostname/IP
##! address from AWS. For more details, see:
##! https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instancedata-data-retrieval.html
external_url 'https://your_domain'
...
```

{% endcode %}

Em seguida, encontre a configuração letsencrypt \['contact\_emails']. Se estiver usando o nano, você pode habilitar um prompt de pesquisa pressionando `CTRL+W`. Escreva letsencrypt\['contact\_emails'] no prompt e pressione `ENTER`. Essa configuração define uma lista de endereços de e-mail que o projeto Let’s Encrypt pode usar para contatá-lo se houver problemas com seu domínio. É recomendável descomentar e preencher para se informar sobre quaisquer problemas que possam ocorrer:

{% code title="/etc/gitlab/gitlab.rb" %}

```
letsencrypt['contact_emails'] = ['sammy@example.com']
```

{% endcode %}

Depois de fazer as alterações, salve e feche o arquivo. Se estiver usando o `nano`, você pode fazer isso pressionando `CTRL+X`, `Y` e `ENTER`.

Execute o seguinte comando para reconfigurar o GitLab:

```
sudo gitlab-ctl reconfigure
```

Isso inicializará o GitLab usando as informações que ele pode encontrar sobre seu servidor. Este é um processo totalmente automatizado, portanto, você não precisará responder a nenhum prompt. O processo também irá configurar um certificado Let’s Encrypt para o seu domínio.


---

# Agent Instructions: 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:

```
GET https://liedsons-organization.gitbook.io/gitlab-no-ubuntu/~/changes/v2SMoF2OR3hlOcgvW1pm/instalacao-e-configuracao-script/etapa-4.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
