Skip to content

Config file #36

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 7 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
68 changes: 27 additions & 41 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Grist Desktop App, built with Electron
# Grist Desktop

This is an Electron build of [Grist](https://github.com/gristlabs/grist-core/).
Use it to easily open and edit Grist spreadsheets on your computer. It does not
Expand All @@ -20,7 +20,7 @@ and [grist-omnibus](https://github.com/gristlabs/grist-omnibus/).

## Download

See https://github.com/gristlabs/grist-electron/releases
See https://github.com/gristlabs/grist-desktop/releases

## Screenshots

Expand All @@ -40,7 +40,7 @@ A [Doggy Daycare](https://templates.getgrist.com/vAcfEKLQf3YF/Doggie-Daycare) sp

![Grist on Windows 7](https://user-images.githubusercontent.com/118367/215295214-83c46e03-16f6-45d2-84dd-d26d34cb5f95.jpeg)

Grist Electron being used as a server on a LAN, on Windows 10 Pro (credit: [Sylvain_Page](https://community.getgrist.com/t/packaging-grist-as-an-electron-app/1233/29)).
Grist Desktop being used as a server on a LAN, on Windows 10 Pro (credit: [Sylvain_Page](https://community.getgrist.com/t/packaging-grist-as-an-electron-app/1233/29)).

![Grist on Windows 10 Pro](https://user-images.githubusercontent.com/118367/221203024-ac8ad72d-bb08-43dd-9447-f9a06cfbce3e.jpeg)

Expand All @@ -61,56 +61,42 @@ yarn run electron

## Configure

There's no configuration needed if you are just running this as a regular app
to view and edit Grist spreadsheets on your laptop.
There's no configuration needed if you are just running Grist Desktop as a
regular app to view and edit Grist spreadsheets on your laptop.
However, some aspects of Grist Desktop can be tuned with a configuration file.
The config file should be named `config.ini`, and placed in:

Some people use the app as a quick way to set up a simple Grist server
in a local network where everyone is trusted. Be sure you know what you're
doing - if you have any security concerns at all, I'd urge you to do a
proper Grist server installation - see https://support.getgrist.com/self-managed/
* `%APPDATA%\grist-desktop` on Windows
* `~/Library/Application Support` on macOS
* `~/.local/share/grist-desktop/` on Linux and all other platforms

If you are sure you are in a trusted environment, you can set some environment
variables to make Grist listen on a specific network interface and port:
A sample config file can be found [here](https://github.com/gristlabs/grist-desktop/blob/main/config.sample.ini).

```
GRIST_HOST=192.168.1.22 # IP address to serve from
GRIST_PORT=8484 # Port number to serve at
GRIST_ELECTRON_AUTH=strict # Auth strategy (strict, mixed, or none)
```
You can also use environment variables to configure Grist Desktop.
Environment variables have higher precedence over the config file.
See the comments in the sample config file for more information.

For developers: You can create a `.env` file in the root directory of the app
and set the environment variables there. If you are a Grist Desktop end user,
consider using the config file instead.

(You can create a `.env` file in the root directory of the app and set
the environment variables there). Set `GRIST_ELECTRON_AUTH` to `none`
to allow access across the network just as if you were using the app.
Set `GRIST_ELECTRON_AUTH` to `mixed` to allow anonymous access
across the network, but not logins. Set `GRIST_ELECTRON_AUTH` to `strict`
to require logins and to permit them only in the app.
### Note on using Grist Desktop as a server

It you use Grist on the network this way, be aware that data is being
If you are sure you are in a trusted environment, you can use the app as a
quick way to set up a simple Grist server, but be aware that data is being
sent using plain http and not encrypted https, so network traffic could be
readable in transit. And there is no login mechanism built in.

An experimental sandboxing mechanism is turned on by default, so that
formulas in a spreadsheet are limited in their effect. Sandboxing can be
turned off by setting:

```
GRIST_SANDBOX_FLAVOR=unsandboxed
```

It can be explicitly set by doing:

```
GRIST_SANDBOX_FLAVOR=pyodide
```
If you have security concerns, we recommend switching to a proper Grist server
installation instead - see https://support.getgrist.com/self-managed/

There are also `gvisor` and `macSandboxExec` sandbox
flavors, but they are not yet easy to use.
### Note on turning sandboxing off

If you turn off sandboxing, then the full raw power of Python will be available
to any Grist spreadsheet you open. So:
Sandboxing limits the effects of formulas in spreadsheets. If you turn it off,
the full raw power of Python will be available to any Grist spreadsheet you open. So:

* Use only with your own Grist spreadsheets, or
* Use with spreadsheets you trust, or
* Use only with spreadsheets you trust, or
* Turn sandboxing the heck back on, or
* Return to the YOLO days of opening spreadsheets and crossing your fingers.

Expand Down
65 changes: 65 additions & 0 deletions config.sample.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
; Grist Desktop configuration file
; Extraneous config items will be ignored.
; Environment variables override settings in this file.


; Login information is currently only effective when launching for the first time.
[login]

; Your username.
; Alternatively, set GRIST_DEFAULT_USERNAME
; username =

; Your email.
; Alternatively, set GRIST_DEFAULT_EMAIL
; email =


; You can use Grist Desktop as a simple Grist server, although is not recommended.
; See the README for more more info.
[server]

; IP address to serve Grist from.
; Alternatively, set GRIST_HOST
listen = localhost

; Port number to serve at.
; Alternatively, set GRIST_PORT
port = 47478

; Auth strategy. Possible values are: strict, mixed, none
; strict: require logins and to permit them only in the app.
; mixed: allow anonymous access across the network, but not logins.
; none: allow access across the network just as if you were using the app.
; Alternatively, set GRIST_DESKTOP_AUTH
; GRIST_ELECTRON_AUTH is deprecated, but still supported.
auth = strict


[sandbox]

; Possible flavors are: pyodide(recommended), gvisor, macSandboxExec, unsandboxed
; It is not recommended to set "unsandboxed", which turns sandboxing off. See README for more info.
; Alternatively, set GRIST_SANDBOX_FLAVOR
flavor = pyodide


[storage]

; Where .grist files will be stored. Defaults to your "Documents" folder.
; Alternatively, set GRIST_DATA_DIR
; documents =

; Grist instance files. Not really important for Grist Desktop.
; Defaults to %APPDATA%\grist-desktop on Windows, ~/Library/Application Support on macOS,
; or ~/.local/share/grist-desktop on Linux (and other non-officially-supported platforms).
; Alternatively, set GRIST_INST_DIR
; instance =

; Grist home sqlite3 database location. Should be kept safe. Defaults to "home.sqlite3" in the instance files folder.
; Alternatively, set TYPEORM_DATABASE
; homedb =

; Where Grist should search for plugins. Defaults to ".grist" under your home folder.
; Alternatively, set GRIST_USER_ROOT
; plugins =
Loading
Loading