Hearth documentation

Office

Word, Excel and PowerPoint files, and their OpenDocument equivalents, open in Hearth Office: an office engine that runs as a container of its own next to Hearth. Browsers load the editor from the engine's address. The engine never receives documents from the browser: it fetches and saves them through Hearth's server, which checks every request against the person's access at that moment. Hearth Office also turns office files into PDF for the PDF tools (Convert to PDF).

Without Hearth Office, office files can still be stored, shared and downloaded, but not edited.

The engine container

Add the engine to the compose file. The image is published by digest; use the one named in deploy/office/Dockerfile of the Hearth version you run, so the engine and Hearth match.

  hearth-office:
    image: ghcr.io/ifedan-ed/hearth-office@sha256:<digest from deploy/office/Dockerfile>
    restart: unless-stopped
    environment:
      WOPI_ENABLED: "true"
      EXAMPLE_ENABLED: "false"
      ADMINPANEL_ENABLED: "false"
      # The engine reaches Hearth on the private Docker network.
      ALLOW_PRIVATE_IP_ADDRESS: "true"
      JWT_SECRET: ${OFFICE_JWT_SECRET}
    volumes:
      - ./data/office/themes:/var/www/euro-office/documentserver/web-apps/apps/common/main/resources/themes:ro
      - ./data/office/fonts:/usr/share/fonts/truetype/hearth:ro
      - office-engine-db:/var/lib/postgresql
      - office-engine-files:/var/lib/euro-office/documentserver/App_Data/cache/files
    ports:
      - 127.0.0.1:8085:80
    healthcheck:
      test: ["CMD", "curl", "-fsS", "http://127.0.0.1/healthcheck"]
      interval: 30s
      retries: 5
      start_period: 120s
    mem_limit: 4g

The two volumes keep converted documents across engine updates, so a document's first open after an update does not wait for a new conversion. The engine keeps no other state; it is not part of the backup.

On the Hearth containers:

      OFFICE_SHARED_DIR: /data/office
      OFFICE_JWT_SECRET: ${OFFICE_JWT_SECRET}
    volumes:
      - ./data/office:/data/office

Give the engine its own address through your proxy, such as office.example.org, with WebSockets passed through (co-editing uses them) and framing allowed only by Hearth:

office.example.org {
	encode zstd gzip
	header Content-Security-Policy "frame-ancestors 'self' https://hearth.example.org"
	reverse_proxy 127.0.0.1:8085
}

Connecting Hearth to the engine

Hearth needs three addresses: the engine's for browsers, the engine's for Hearth's server, and Hearth's own for the engine. Set them once after the first start:

docker compose exec -T hearth /hearth office set \
  --hearth-office-url https://office.example.org \
  --hearth-office-internal-url http://hearth-office \
  --wopi-url http://hearth:8080 \
  --wopi-allow 172.31.184.0/24

--wopi-allow lists the networks the engine's requests may come from: the Docker network both containers are on. Requests from anywhere else are refused. The command also turns Office on.

hearth office show prints whether Office is on, the addresses and whether the engine answers.

Administration, Office

The editor's assistant (AI Tools in the editor) is switched on in Administration, Copilot, with the Copilot (Copilot). The engine needs a key to reach it:

# on the Hearth containers
      OFFICE_ENGINE_KEY: ${OFFICE_ENGINE_KEY}

OFFICE_ENGINE_KEY (at least 32 characters) is the key the engine presents to Hearth's assistant gateway. Give the same value to the engine in its AI settings (aiSettings in its NODE_CONFIG, provider address http://hearth:8080/api/v1/office/ai); deploy/docker-compose.yml in the repository has the complete block. Empty: no assistant in the editor.

Fonts

Documents look right only when the fonts they name are there.

Spelling and grammar

The editor's spelling and grammar check (Review tab) uses a LanguageTool server of your own. It needs no internet access: put it on an internal network that only Hearth can reach.

  hearth-languagetool:
    image: erikvl87/languagetool:6.8
    restart: unless-stopped
    environment:
      Java_Xms: 256m
      Java_Xmx: 1g
    networks:
      - proofing
    mem_limit: 1536m

networks:
  proofing:
    internal: true

Add the proofing network to the hearth container and set:

      LANGUAGETOOL_URL: http://hearth-languagetool:8010

The editor reaches LanguageTool only through Hearth, and nothing is kept.

Updating the engine

Take the digest from the new Hearth version's deploy/office/Dockerfile, change it in your compose file, and run docker compose up -d hearth-office. People with a document open lose their connection while the engine restarts, so do it at a quiet time.