# Editing documents

Chill allows editing documents directly from the web interface using two different methods:
- **Collabora Online**: An online office suite that allows multiple users to edit the same document simultaneously in their browser.
- **WebDAV (LibreOffice Desktop)**: Use your local LibreOffice installation to edit documents stored on the server.

This document explains how to set up these features for development.

## Editing with Collabora Online

To make Collabora Online work in a development environment, the Collabora server and your local Symfony server must be able to communicate with each other. This is typically achieved using a tunnel like **ngrok**.

### 1. Install Collabora

You can install Collabora Online (CODE) on a remote server or run it locally (e.g., using Docker).

### 2. Serve the local Symfony server via ngrok

Collabora needs to access your local development server through a public URL. Use ngrok to expose your local server:

```bash
# assuming your symfony server is running on port 8000
ngrok http 8000
```

### 3. Configure Collabora to trust the ngrok domain

Collabora must be configured to allow connections from your ngrok domain. This is done by adding your ngrok domain to the `aliasgroup` in Collabora's configuration (usually `coolwsd.xml` or via environment variables if using Docker).

For example, if you are using Docker, you might add:
`-e "aliasgroup1=https://your-ngrok-subdomain.ngrok-free.app"`

### 4. Browse the development instance through ngrok

To use the feature, you must access your Chill instance using the ngrok URL (e.g., `https://your-ngrok-subdomain.ngrok-free.app`) instead of `localhost`.

1. Open your browser and go to your ngrok URL.
2. Navigate to a document.
3. Click on "Edit with Collabora".

## Editing with WebDAV (LibreOffice Desktop)

This feature allows you to open documents directly in your desktop's LibreOffice.

- **Local HTTP**: If you are serving your application through `http` on `localhost`, it should work without any additional configuration.
- **Local HTTPS**: If you are using `https` locally, LibreOffice might have trouble with self-signed certificates. In this case, it is recommended to use an **ngrok domain** as described above to provide a valid HTTPS connection.

!!! tip

    The web interface of ngrok (usually available at `http://127.0.0.1:4040`) allows you to easily inspect the requests from and to your web server. This is extremely useful for understanding how Collabora or LibreOffice interacts with the application and for debugging WOPI or WebDAV requests.
