Document viewer
The viewer is a separate container that draws documents in the browser. It is built from the open-source Collabora Online, without branding. The server stays in charge: the viewer only gets a document when the server has decided a particular person may see it, and for that viewing only.
Wiring
GOVERNATE_VIEWER_URL=https://viewer.example.com
GOVERNATE_WOPI_URL=http://governate.internal:8080
GOVERNATE_VIEWER_URLis the viewer's address as your users' browsers reach it.GOVERNATE_WOPI_URLis the server's address as the viewer reaches it. It can be an internal address. If it is not set, the public address is used.
The viewer must be configured to accept your server as its document source and your public address as the page allowed to embed it.
What happens when someone opens a file
- The server checks the person, the file's permissions and limits, and the licence, and writes a record.
- It creates a viewing session with a random token, valid for 30 minutes and for that file and person only.
- The page embeds the viewer and passes it the token.
- The viewer asks the server for the document with that token. The server decrypts the stored
.gvfand sends the content, along with what this person may do: edit, print, copy, and the watermark text. - If editing is allowed, the viewer sends changes back and the server re-encrypts them under the same file key.
Where readable content exists
While a document is open, its readable content is in the viewer's memory and working files. Treat the viewer's machine like the server's: on your network, with no access for anyone who should not see documents.
Without a viewer
Leave GOVERNATE_VIEWER_URL empty. Protecting, sharing, permissions and the command-line tool all work. Text files still open in the browser, because this website shows them itself (see Protecting files); documents do not.