gristlabs / grist-desktop

Desktop Grist, packaged with Electron
Apache License 2.0
154 stars 7 forks source link

Using .env file to set variables doesn't work in appimage #7

Closed tetricky closed 1 year ago

tetricky commented 1 year ago

The title says it all.

I have a need to work offline with data, on different computers, without making a full installation.

The electron app is a very useful potential solution, but I can't find how to connect to the appimage locally. The .env guidance doesn't seem to work for it.

I need to store and query grist data through the api on an offline machine, not suitable for running docker/podman.

paulfitz commented 1 year ago

If you are willing to start Grist from a terminal, you could do something like:

export GRIST_PORT=8484

before running it. The app might be in your Downloads folder, or in Applications in your home directory.

tetricky commented 1 year ago

I can access the application at localhost:port but I do not have permission to access it. Public access is on in the document sharing, but using the document link returns an error.

"There was an error: Access restricted to Electron user."

I can't see any settings in the electron app itself that allows me to set up access for a user. I suspect it might be because of how the appimage is packaged?

paulfitz commented 1 year ago

@tetricky I think you want the environment variable setting GRIST_ELECTRON_AUTH=none if you want to allow unlimited access outside of the app. The available settings of this variable are given in https://github.com/gristlabs/grist-electron#configure. By default, access outside the desktop app is prohibited, since typical users might not expect it.

tetricky commented 1 year ago

I can confirm that this is the magic incarnation that has allowed access. In case anyone else has a similar issue:

I use appimage launcher, and my appimages are installed locally in home/username/Applications by default. Open a terminal in the application directory, noting the grist appimage name (may vary from grist-electron-linux.AppImage based on version) application directory, and in bash:

export GRIST_PORT=8484
export GRIST_ELECTRON_AUTH=none
./grist-electron-linux.AppImage

In your grist document navigate to Share>Manage Users and Copy Link from 'Public Access'.

Access to the document via a browser, on localhost:8484, is now possible.

Closed as solved, with thanks.