Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Grist is the evolution of spreadsheets.

License

NotificationsYou must be signed in to change notification settings

gristlabs/grist-core

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Grist is a modern relational spreadsheet. It combines the flexibility of a spreadsheet with the robustness of a database.

  • grist-core (this repo) has what you need to run a powerful server for hosting spreadsheets.

  • grist-desktop is a Linux/macOS/Windows desktop app for viewing and editing spreadsheets stored locally.

  • grist-static is a fully in-browser build of Grist for displaying spreadsheets on a website without back-end support.

Grist is developed byGrist Labs, an NYC-based company 🇺🇸🗽. The French government 🇫🇷 organizationsANCT Données et Territoires andDINUM (Direction Interministérielle du Numérique) have also made significant contributions to the codebase.

Thegrist-core,grist-desktop, andgrist-static repositories are all open source (Apache License, Version 2.0).Grist Labs offers free and paid hosted services atgetgrist.com, sells an Enterprise product,and offerscloud packaging.

Questions? Feedback? Want to share what you're building with Grist? Join ourofficial Discord server or visit ourCommunity forum.

what-is-grist.mp4

Features ingrist-core

To see exactly what is present ingrist-core, you can run thedesktop app, or usedocker. The absolute fastest way to try Grist out is to visitdocs.getgrist.com and play with a spreadsheet there immediately – though if you do, please read the list ofextra extensions that are not ingrist-core.

However you try it, you'll quickly see that Grist is a hybrid database/spreadsheet, meaning that:

  • Columns work like they do in databases: they are named, and they hold one kind of data.
  • Columns can be filled by formula, spreadsheet-style, with automatic updates when referenced cells change.

This difference can confuse people coming directly from Excel or Google Sheets. Give it a chance! There's also aGrist for Spreadsheet Users article to help get you oriented. If you're coming from Airtable, you'll find the model familiar (and there's also ourGrist vs Airtable article for a direct comparison).

Here are some specific feature highlights of Grist:

  • Python formulas.
  • A portable, self-contained format.
    • Based on SQLite, the most widely deployed database engine.
    • Any tool that can read SQLite can read numeric and text data from a Grist file.
    • Enablesbackups that you can confidently restore in full.
    • Great for moving between different hosts.
  • Can be displayed on a static website withgrist-static – no special server needed.
  • A self-contained desktop app for viewing and editing locally:grist-desktop.
  • Convenient editing and formatting features.
    • Choices andchoice lists, for adding colorful tags to records.
    • References and reference lists, for cross-referencing records in other tables.
    • Attachments, to include media or document files in records.
    • Dates and times, toggles, and special numerics such as currency all have specialized editors and formatting options.
    • Conditional Formatting, letting you control the style of cells with formulas to draw attention to important information.
  • Drag-and-drop dashboards.
    • Charts,card views and acalendar widget for visualization.
    • Summary tables for summing and counting across groups.
    • Widget linking streamlines filtering and editing data.Grist has a unique approach to visualization, where you can lay out and link distinct widgets to show together,without cramming mixed material into a table.
    • Filter bar for quick slicing and dicing.
  • Incremental imports.
    • Import a CSV of the last three months activity from your bank...
    • ...and import new activity a month later without fuss or duplication.
  • Native forms. Create forms that feed directly into your spreadsheet without fuss.
  • Integrations.
  • Many templates to get you started, from investment research to organizing treasure hunts.
  • Access control options.
  • Self-maintainable.
    • Useful for intranet operation and specific compliance requirements.
  • Sandboxing options for untrusted documents.
    • On Linux or with Docker, you can enablegVisor sandboxing at the individual document level.
    • On macOS, you can use native sandboxing.
    • On any OS, including Windows, you can use a wasm-based sandbox.
  • Translated to many languages.
  • F1 key brings up some quick help. This used to go without saying, but in general Grist has good keyboard support.
  • We post progress on𝕏 or Twitter or whatever and publishmonthly newsletters.

If you are curious about where Grist is heading, seeour roadmap, drop a question inour forum, or browseour extensive documentation.

Features not ingrist-core

If you evaluate Grist by using the hosted version atgetgrist.com, be aware that it includes some extensions to Grist that aren't present ingrist-core. To be sure you're seeing exactly what is present ingrist-core, you can run thedesktop app, or usedocker. Here is a list of features you may see in Grist Labs' hosting or Enterprise offerings that are not ingrist-core, in chronological order of creation. If self-hosting, you can get access to a free trial of all of them using the Enterprise toggle on theAdmin Panel.

  • GristConnect (2022)
    • Any site that has plugins for letting Discourse use its logins (such as WordPress) can also let Grist use its logins.
    • GristConnect is a niche feature built for a specific client which you probably don't care about –OIDC andSAML supportis part ofgrist-core and covers most authentication use cases.
  • Azure back-end for document storage (2022)
    • Withgrist-core you can store document versions in anything S3-compatible, which covers a lot of services, but not Azure specifically. The Azure back-end fills that gap.
    • Unless you are a Microsoft shop you probably don't care about this.
  • Audit log streaming (2024)
    • Withgrist-core a lot of useful information is logged, but not organized specifically with auditing in mind. Audit log streaming supplies that organization, and a UI for setting things up.
    • Enterprises may care about this.
  • Advanced Admin Controls (2025)
    • This is a special page for a Grist installation administrator to monitor and edit user access to resources.
    • It uses a special set of administrative endpoints not present ongrist-core.
    • If you're going to be running a large Grist installation, with employees coming and going, you may care about this.
  • Grist Assistant (2025)
    • An AI Formula Assistant - limited to working with formulas - is present ingrist-core, but the newer Assistant can help with a wider range of tasks like building tables and dashboards and modifying data.
    • If you have many users who need help building documents or working with data, you may care about this one.
  • Invite Notifications (2025)
    • When a user is added to a document, or a workspace, or a site, with email notifications they will get emailed a link to access the resource.
    • This link isn't special, withgrist-core you can just send a link yourself or a colleague.
    • For a big Grist installation with users who aren't in close communication, emails might be nice? Hard to guess if you'll care about this one.
  • Document Change and Comment Notifications (2025)
    • You can achieve change notifications ingrist-core using webhooks, but it is less convenient.
    • People have been asking for this one for years. If you need an excuse to get your boss to pay for Grist, this might finally be the one that works?

Using Grist

To get the default version ofgrist-core running on your computerwithDocker, do:

docker pull gristlabs/gristdocker run -p 8484:8484 -it gristlabs/grist

Then visithttp://localhost:8484 in your browser. You'll be able to create, edit, import,and export documents. To preserve your work across docker runs, share a directory as/persist:

docker run -p 8484:8484 -v$PWD/persist:/persist -it gristlabs/grist

Get templates attemplates.getgrist.com for payroll,inventory management, invoicing, D&D encounter tracking, and a lotmore, or use any document you've created ondocs.getgrist.com.

If you need to change the port Grist runs on, set aPORT variable, don't just change theport mapping:

docker run --env PORT=9999 -p 9999:9999 -v $PWD/persist:/persist -it gristlabs/grist

To enable gVisor sandboxing, set--env GRIST_SANDBOX_FLAVOR=gvisor.This should work with default docker settings, but may not work in allenvironments.

You can find a lot more about configuring Grist, setting up authentication,and running it on a public server in ourSelf-Managed Grist handbook.

Using Grist with OpenRouter for Model Agnostic and Claude Support

(Instructions contributed by @lshalon)

Grist's AI Formula Assistant can be configured to use OpenRouter instead of connecting directly to OpenAI, allowing you to access a wide range of AI models including Anthropic's Claude models. This isn't the only way to use Claude models, but it's a good option if you want to use Claude models with Grist or intend to use other cheaper, faster, or potentially newer models. That's because this configuration gives you more flexibility in choosing the AI model that works best for your formula generation needs.To set up OpenRouter integration, configure the following environment variables:

Required: Set the endpoint to OpenRouter's API

ASSISTANT_CHAT_COMPLETION_ENDPOINT=https://openrouter.ai/api/v1/chat/completions

Required: Your OpenRouter API key

ASSISTANT_API_KEY=your_openrouter_api_key_here

Sign up for an OpenRouter API key athttps://openrouter.ai/

Optional: Specify which model to use (examples below)

ASSISTANT_MODEL=anthropic/claude-3.7-sonnet

or other options like

ASSISTANT_MODEL=deepseek/deepseek-r1-zero:free
ASSISTANT_MODEL=qwen/qwq-32b:free
ASSISTANT_MODEL=mistralai/mistral-saba

Optional: Set a larger context model for fallback

ASSISTANT_LONGER_CONTEXT_MODEL=anthropic/claude-3-opus-20240229

With this configuration, Grist's AI Formula Assistant will route requests through OpenRouter to your specified model. This allows you to:

Access Anthropic's Claude models which excel at understanding context and generating accurate formulasSwitch between different AI models without changing your Grist configurationTake advantage of OpenRouter's routing capabilities to optimize for cost, speed, or quality

You can find the available models and their identifiers on the OpenRouter website.Note: Make sure not to set the OPENAI_API_KEY variable when using OpenRouter, as this would override the OpenRouter configuration.

Available Docker images

The default Docker image isgristlabs/grist. This contains all ofthe standard Grist functionality, as well as extra source-availablecode for enterprise customers taken from thegrist-ee repository. Thisextra code is not under a free or open source license. By default,however, the code from thegrist-ee repository is completely inertand inactive. This code becomes active only when enabled from theadministrator panel.

If you would rather use an image that contains exclusively free andopen source code, thegristlabs/grist-oss Docker image is availablefor this purpose. It is by default functionally equivalent to thegristlabs/grist image.

The administrator panel

You can turn on a special admininistrator panel to inspect the statusof your installation. Just visit/admin on your Grist server forinstructions. Since it is useful for the admin panel to beavailable even when authentication isn't set up, you can give it aspecial access key by settingGRIST_BOOT_KEY.

docker run -p 8484:8484 -e GRIST_BOOT_KEY=secret -it gristlabs/grist

The boot page should then be available at/admin?boot-key=<GRIST_BOOT_KEY>. We are collecting probes forcommon problems there. If you hit a problem that isn't covered, itwould be great if you could add a probe for it inBootProbes.You may instead file an issue so someone else can add it.

Building from source

To build Grist from source, follow these steps:

yarn installyarn run buildyarn run install:pythonyarn start# Grist will be available at http://localhost:8484/

Grist formulas in documents will be run using Python executed directly on yourmachine. You can configure sandboxing using aGRIST_SANDBOX_FLAVORenvironment variable.

  • On macOS,export GRIST_SANDBOX_FLAVOR=macSandboxExecuses the nativesandbox-exec command for sandboxing.
  • On Linux withgVisor's runscinstalled,export GRIST_SANDBOX_FLAVOR=gvisor is an option.
  • On any OS including Windows,export GRIST_SANDBOX_FLAVOR=pyodide is available.

These sandboxing methods have been written for our own use at Grist Labs andmay need tweaking to work in your own environment - pull requestsvery welcome here!

If you wish to include Grist Labs enterprise extensions in your build,the steps are as follows. Note that this will add non-OSS code to yourbuild. It will also place a directory callednode_modules one levelup, at the same level as the Grist repo. If that is a problem for you,just move everything into a subdirectory first.

yarn install./buildtools/checkout-ext-directory.sh grist-eeyarn install --cwd ext --modules-folder ../../node_modules/WEBPACK_EXTRA_MODULE_PATHS=../node_modules yarn buildyarn run install:pythonWEBPACK_EXTRA_MODULE_PATHS=../node_modules yarn start# Grist will be available at http://localhost:8484/

The enterprise code will by default not be used. You need to explicitly enableit in theAdmin Panel.

Logins

Like git, Grist has features to track document revision history. So for full operation,Grist expects to know who the user modifying a document is. Until it does, it operatesin a limited anonymous mode. To get you going, the docker image is configured so thatwhen you click on the "sign in" button Grist will attribute your work toyou@example.com.Change this by settingGRIST_DEFAULT_EMAIL:

docker run --env GRIST_DEFAULT_EMAIL=my@email -p 8484:8484 -v $PWD/persist:/persist -it gristlabs/grist

You can change your name inProfile Settings intheUser Menu.

For multi-user operation, or if you wish to access Grist across thepublic internet, you'll want to connect it to your own Single Sign-On service.There are a lot of ways to do this, includingSAML and forward authentication.Grist has been tested withAuthentik,Auth0,and Google/Microsoft sign-ins viaDex.

Translations

We useWeblate to manage translations.Thanks to everyone who is pitching in. Thanks especially to the ANCT developers whodid the hard work of making a good chunk of the application localizable. Merci beaucoup !

Translation status

Translation detail

Why free and open source software

This repository,grist-core, is maintained by Grist Labs. Our flagship product available atgetgrist.com is built from the code you see here, combined with business-specific software designed to scale to many users, handle billing, etc.

Grist Labs is an open-core company. We offer Grist hosting as a service, with free and paid plans. We also develop and sell features related to Grist using a proprietary license, targeted at the needs of enterprises with large self-managed installations.

We see data portability and autonomy as a key value, andgrist-core is an essential part of that. We are committed to maintaining and improving thegrist-core codebase, and to be thoughtful about how proprietary offerings impact data portability and autonomy.

By opening its source code and offering anOSI-approved free license, Grist benefits its users:

  • Developer community. The freedom to examine source code, make bug fixes, and developnew features is a big deal for a general-purpose spreadsheet-like product, where there is avery long tail of features vital to someone somewhere.
  • Increased trust. Because anyone can examine the source code, “security by obscurity” is notan option. Vulnerabilities in the code can be found by others and reported before they causedamage.
  • Independence. Grist is available to you regardless of the fortunes of the Grist Labs business,since it is open source and can be self-hosted. Using our hosted solution is convenient, but youare not locked in.
  • Price flexibility. If you are low on funds but have time to invest, self-hosting is a greatoption to have. And DIY users may have the technical savvy and motivation to delve in and make improvements,which can benefit all users of Grist.
  • Extensibility. For developers, having the source open makes it easier to build extensions (such asCustom Widgets). You can more easily include Grist in your pipeline. And if a feature is missing, you can just take the source code and build on top of it.

For more on Grist Labs' history and principles, see ourAbout Us page.

Sponsors

Reviews

Environment variables

Grist can be configured in many ways. Here are the main environment variables it is sensitive to:

VariablePurpose
ALLOWED_WEBHOOK_DOMAINScomma-separated list of permitted domains to use in webhooks (e.g. webhook.site,zapier.com). You can set this to* to allow all domains, but if doing so, we recommend using a carefully locked-down proxy (seeGRIST_PROXY_FOR_UNTRUSTED_URLS) if you do not entirely trust users. Otherwise services on your internal network may become vulnerable to manipulation.
APP_DOC_URLdoc worker url, set when starting an individual doc worker (other servers will find doc worker urls via redis)
APP_DOC_INTERNAL_URLlikeAPP_DOC_URL but used by the home server to reach the server using an internal domain name resolution (like in a docker environment). It only makes sense to define this value in the doc worker. Defaults toAPP_DOC_URL.
APP_HOME_URLurl prefix for home api (home and doc servers need this)
APP_HOME_INTERNAL_URLlikeAPP_HOME_URL but used by the home and the doc servers to reach any home workers using an internal domain name resolution (like in a docker environment). Defaults toAPP_HOME_URL
APP_STATIC_URLurl prefix for static resources
APP_STATIC_INCLUDE_CUSTOM_CSSset to "true" to include custom.css (from APP_STATIC_URL) in static pages
APP_UNTRUSTED_URLURL at which to serve/expect plugin content.
GRIST_ACTION_HISTORY_MAX_ROWSMaximum number of rows allowed in ActionHistory before pruning (up to a 1.25 grace factor). Defaults to 1000.⚠️ A too low value may make the "Work on a copy" featuremalfunction
GRIST_ACTION_HISTORY_MAX_BYTESMaximum number of rows allowed in ActionHistory before pruning (up to a 1.25 grace factor). Defaults to 1Gb.⚠️ A too low value may make the "Work on a copy" featuremalfunction
GRIST_ADAPT_DOMAINset to "true" to support multiple base domains (careful, host header should be trustworthy)
GRIST_ALLOW_AUTOMATIC_VERSION_CHECKINGWhether Grist is allowed to automatically check if a newer Grist version is available. Defaults to "true" on the defaultgrist andgrist-ee Docker images. Defaults false ingrist-oss and everywhere else.
GRIST_ALLOW_DEPRECATED_BARE_ORG_DELETEIf set, the deprecated DELETE /api/orgs/:orgId endpoint is available.
GRIST_APP_ROOTdirectory containing Grist sandbox and assets (specifically the sandbox and static subdirectories).
GRIST_ATTACHMENT_THRESHOLD_MBattachment storage limit per document beyond which Grist will recommend external storage (if available). Defaults to 50MB.
GRIST_BACKUP_DELAY_SECSwait this long after a doc change before making a backup
GRIST_BOOT_KEYif set, offer diagnostics at /boot/GRIST_BOOT_KEY
GRIST_BROADCAST_TIMEOUT_MSSet the maximum time a web client has to accept a broadcast message about a document before being disconnected (default: 1 minute).
GRIST_DATA_DIRDirectory in which to store documents. Defaults todocs/ relative to the Grist application directory. In Grist's default Docker image, its default value is /persist/docs so that it will be used as a mounted volume.
GRIST_DEFAULT_EMAILif set, login as this user if no other credentials presented
GRIST_DEFAULT_PRODUCTif set, this controls enabled features and limits of new sites. See names of PRODUCTS in Product.ts.
GRIST_DEFAULT_LOCALELocale to use as fallback when Grist cannot honour the browser locale.
GRIST_DOMAINin hosted Grist, Grist is served from subdomains of this domain. Defaults to "getgrist.com".
GRIST_EXPERIMENTAL_PLUGINSenables experimental plugins
GRIST_EXTERNAL_ATTACHMENTS_MODErequired to enable external storage for attachments. Set to "snapshots" to enable external storage. Default value is "none". Note that when enabled, asnapshot storage has to be configured as well.
GRIST_ENABLE_REQUEST_FUNCTIONenables the REQUEST function. This function performs HTTP requests in a similar way torequests.request. This function presents a significant security risk, since it can let users call internal endpoints when Grist is available publicly. This function can also cause performance issues. Unset by default.
GRIST_HIDE_UI_ELEMENTScomma-separated list of UI features to disable. Allowed names of parts:helpCenter,billing,templates,createSite,multiSite,multiAccounts,sendToDrive,tutorials,supportGrist,themes. If a part also exists in GRIST_UI_FEATURES, it will still be disabled.
GRIST_HOSThostname to use when listening on a port.
GRIST_PROXY_FOR_UNTRUSTED_URLSFull URL of proxy for delivering webhook payloads. Default value isdirect for delivering payloads without proxying.
HTTPS_PROXY or https_proxyFull URL of reverse web proxy (corporate proxy) for fetching the custom widgets repository or the OIDC config from the issuer.
GRIST_ID_PREFIXfor subdomains of form o-, expect or produce o-${GRIST_ID_PREFIX}.
GRIST_IGNORE_SESSIONif set, Grist will not use a session for authentication.
GRIST_INCLUDE_CUSTOM_SCRIPT_URLif set, will load the referenced URL in a<script> tag on all app pages.
GRIST_INST_DIRpath to Grist instance configuration files, for Grist server.
GRIST_LIST_PUBLIC_SITESif set to true, sites shared with the public will be listed for anonymous users. Defaults to false.
GRIST_MANAGED_WORKERSif set, Grist can assume that if a url targeted at a doc worker returns a 404, that worker is gone
GRIST_MAX_NEW_USER_INVITES_PER_ORGif set, limits the number of invites to new users per org. Once exceeded, additional invites are blocked until invited users log in for the first time or are uninvited
GRIST_MAX_BILLING_MANAGERS_PER_ORGif set, limits the number of billing managers per org
GRIST_MAX_PARALLEL_REQUESTS_PER_DOCmax number of concurrent API requests allowed per document (default is 10, set to 0 for unlimited)
GRIST_MAX_UPLOAD_ATTACHMENT_MBmax allowed size for attachments (0 or empty for unlimited).
GRIST_MAX_UPLOAD_IMPORT_MBmax allowed size for imports (except .grist files) (0 or empty for unlimited).
GRIST_OFFER_ALL_LANGUAGESif set, all translated langauages are offered to the user (by default, only languages with a special 'good enough' key set are offered to user).
GRIST_ORG_IN_PATHif true, encode org in path rather than domain
GRIST_PAGE_TITLE_SUFFIXa string to append to the end of the<title> in HTML documents. Defaults to" - Grist". Set to_blank for no suffix at all.
GRIST_PROXY_AUTH_HEADERDeprecated, and interpreted as a synonym for GRIST_FORWARD_AUTH_HEADER.
GRIST_ROUTER_URLoptional url for an api that allows servers to be (un)registered with a load balancer
GRIST_SERVE_SAME_ORIGINset to "true" to access home server and doc workers on the same protocol-host-port as the top-level page, same as for custom domains (careful, host header should be trustworthy)
GRIST_SERVERSthe types of server to setup. Comma separated values which may contain "home", "docs", static" and/or "app". Defaults to "home,docs,static".
GRIST_SESSION_COOKIEif set, overrides the name of Grist's cookie
GRIST_SESSION_DOMAINif set, associates the cookie with the given domain - otherwise defaults to GRIST_DOMAIN
GRIST_SESSION_SECRETa key used to encode sessions
GRIST_SKIP_BUNDLED_WIDGETSif set, Grist will ignore any bundled widgets included via NPM packages.
GRIST_SQLITE_MODEif set towal, use SQLite inWAL mode, if set tosync, use SQLite withSYNCHRONOUS=full
GRIST_ANON_PLAYGROUNDWhen set tofalse deny anonymous users access to the home page (but documents can still be shared to anonymous users). Defaults totrue.
GRIST_FORCE_LOGINSetting it totrue is similar to settingGRIST_ANON_PLAYGROUND: false but it blocks any anonymous access (thus any document shared publicly actually requires the users to be authenticated before consulting them)
GRIST_SINGLE_ORGset to an org "domain" to pin client to that org
GRIST_TEMPLATE_ORGset to an org "domain" to show public docs from that org
GRIST_HELP_CENTERset the help center link ref
GRIST_TERMS_OF_SERVICE_URLif set, adds terms of service link
FREE_COACHING_CALL_URLset the link to the human help (example: email adress or meeting scheduling tool)
GRIST_CONTACT_SUPPORT_URLset the link to contact support on error pages (example: email adress or online form)
GRIST_ONBOARDING_VIDEO_IDset the ID of the YouTube video shown on the homepage and during onboarding
GRIST_CUSTOM_COMMON_URLSoverwrite the default commons URLs. Its value is expected to be a JSON object and a subset of theICommonUrls interface.
GRIST_SUPPORT_ANONif set to 'true', show UI for anonymous access (not shown by default)
GRIST_SUPPORT_EMAILif set, give a user with the specified email support powers. The main extra power is the ability to share sites, workspaces, and docs with all users in a listed way.
GRIST_OPEN_GRAPH_PREVIEW_IMAGEthe URL of the preview image when sharing the link on websites like social medias or chat applications.
GRIST_TELEMETRY_LEVELthe telemetry level. Can be set to:off (default),limited, orfull.
GRIST_THROTTLE_CPUif set, CPU throttling is enabled
GRIST_TRUST_PLUGINSif set, plugins are expect to be served from the same host as the rest of the Grist app, rather than from a distinct host. Ordinarily, plugins are served from a distinct host so that the cookies used by the Grist app are not automatically available to them. Enable this only if you understand the security implications.
GRIST_USER_ROOTan extra path to look for plugins in - Grist will scan for plugins in$GRIST_USER_ROOT/plugins.
GRIST_UI_FEATUREScomma-separated list of UI features to enable. Allowed names of parts:helpCenter,billing,templates,createSite,multiSite,multiAccounts,sendToDrive,tutorials,supportGrist,themes. If a part also exists in GRIST_HIDE_UI_ELEMENTS, it won't be enabled.
GRIST_UNTRUSTED_PORTif set, plugins will be served from the given port. This is an alternative to setting APP_UNTRUSTED_URL.
GRIST_WIDGET_LIST_URLa url pointing to a widget manifest, by defaulthttps://github.com/gristlabs/grist-widget/releases/download/latest/manifest.json is used
GRIST_LOG_HTTPWhen set totrue, log HTTP requests and responses information. Defaults tofalse.
GRIST_LOG_HTTP_BODYWhen this variable andGRIST_LOG_HTTP are set totrue , log the body along with the HTTP requests.⚠️ Be aware it may leak confidential information in the logs.⚠️ Defaults tofalse.
GRIST_LOG_AS_JSONWhen this variable is set totrue or a truthy value, output log lines in JSON as opposed to a plain text format.
GRIST_LOG_API_DETAILSWhen this variable is set totrue or a truthy value, log the API calls details.
COOKIE_MAX_AGEsession cookie max age, defaults to 90 days; can be set to "none" to make it a session cookie
HOME_PORTport number to listen on for REST API server; if set to "share", add API endpoints to regular grist port.
PORTport number to listen on for Grist server
REDIS_URLoptional redis server for browser sessions and db query caching
GRIST_SNAPSHOT_TIME_CAPoptional. Define the caps for tracking buckets. Usage: {"hour": 25, "day": 32, "isoWeek": 12, "month": 96, "year": 1000}
GRIST_SNAPSHOT_KEEPoptional. Number of recent snapshots to retain unconditionally for a document, regardless of when they were made
GRIST_PROMCLIENT_PORToptional. If set, serve the Prometheus metrics on the specified port number.⚠️ Be sure to use a port which is not publicly exposed⚠️.
GRIST_ENABLE_SCIMoptional. If set, enable theSCIM API Endpoint (experimental)
GRIST_OIDC_...optional. Environment variables used to configure OpenID authentification. SeeOpenID Connect documentation for full related list of environment variables.
GRIST_SAML_...optional. Environment variables used to configure SAML authentification. SeeSAML documentation for full related list of environment variables.
GRIST_IDP_EXTRA_PROPSoptional. If set, defines which extra fields returned by your identity provider will be stored in the users table of the home database (in theoptions.ssoExtraInfo object). Usage: 'onekey,anotherkey'.
GRIST_FEATURE_FORM_FRAMINGoptional. Configures a border around a rendered form that is added for security reasons; Can be set to:border orminimal. Defaults toborder.
GRIST_TRUTHY_VALUESoptional. Comma-separated list of extra words that should be considered as truthy by the data engine beyond english defaults. Ex: "oui,ja,si"
GRIST_FALSY_VALUESoptional. Comma-separated list of extra words that should be considered as falsy by the data engine beyond english defaults. Ex: "non,nein,no"
GRIST_ENABLE_USER_PRESENCEoptional, enabled by default. If set to 'false', disables all user presence features.

AI Formula Assistant related variables (all optional):

VariablePurpose
ASSISTANT_API_KEYoptional. An API key to pass when making requests to an external AI conversational endpoint.
ASSISTANT_CHAT_COMPLETION_ENDPOINToptional. A chat-completion style endpoint to call. Not needed if OpenAI is being used.
ASSISTANT_MODELoptional. If set, this string is passed along in calls to the AI conversational endpoint.
ASSISTANT_LONGER_CONTEXT_MODELoptional. If set, requests that fail because of a context length limitation will be retried with this model set.
OPENAI_API_KEYoptional. Synonym for ASSISTANT_API_KEY that assumes an OpenAI endpoint is being used. Sign up for an account on OpenAI and then generate a secret keyhere.

At the time of writing, the AI Assistant is known to function against OpenAI chat completion endpoints (those ending in/v1/chat/completions).It is also known to function against the chat completion endpoint provided byllama-cpp-python and byLM Studio. For useful results, the LLM should be on par with GPT 3.5 or above.

Sandbox related variables:

VariablePurpose
GRIST_SANDBOX_FLAVORcan be gvisor, pynbox, unsandboxed, docker, or macSandboxExec. If set, forces Grist to use the specified kind of sandbox.
GRIST_SANDBOXa program or image name to run as the sandbox. See NSandbox.ts for nerdy details.

Forward authentication variables:

VariablePurpose
GRIST_FORWARD_AUTH_HEADERif set, trust the specified header (e.g. "x-forwarded-user") to contain authorized user emails, and enable "forward auth" logins.
GRIST_FORWARD_AUTH_LOGIN_PATHif GRIST_FORWARD_AUTH_HEADER is set, Grist will listen at this path for logins. Defaults to/auth/login.
GRIST_FORWARD_AUTH_LOGOUT_PATHif GRIST_FORWARD_AUTH_HEADER is set, Grist will forward to this path when user logs out.

Forward authentication supports two modes, distinguished byGRIST_IGNORE_SESSION:

  1. With sessions, and forward-auth on login endpoints.

    For example, using traefik reverse proxy withtraefik-forward-auth middleware:

    • GRIST_IGNORE_SESSION: do NOT set, or set to a falsy value.
    • Make sure your reverse proxy applies the forward auth middleware toGRIST_FORWARD_AUTH_LOGIN_PATH andGRIST_FORWARD_AUTH_LOGOUT_PATH.
    • If you want to allow anonymous access in some cases, make sure all other paths are free ofthe forward auth middleware. Grist will trigger it as needed by redirecting toGRIST_FORWARD_AUTH_LOGIN_PATH. Once the user is logged in, Grist will use sessions toidentify the user until logout.
  2. With no sessions, and forward-auth on all endpoints.

    For example, using HTTP Basic Auth and server configuration that sets the header (specified inGRIST_FORWARD_AUTH_HEADER) to the logged-in user.

  • GRIST_IGNORE_SESSION: set totrue. Grist sessions will not be used.
  • Make sure your reverse proxy sets the header you specified for all requests that may needlogin information. It is imperative that this header cannot be spoofed by the user, sinceGrist will trust whatever is in it.

When using forward authentication, you may wish to also set the following variables:

  • GRIST_FORCE_LOGIN=true to disable anonymous access.

Plugins:

Grist has a plugin system, used internally. One useful thing you cando with it is include custom widgets in a build of Grist. Custom widgetsare usually made available just by settingGRIST_WIDGET_LIST_URL,but that has the downside of being an external dependency, which canbe awkward for offline use or for archiving. Plugins offer an alternative.

To "bundle" custom widgets as a plugin:

  • Add a subdirectory ofplugins, e.g.plugins/my-widgets.Alternatively, you can set theGRIST_USER_ROOT environmentvariable to any path you want, and then createplugins/my-widgetswithin that.
  • Add amanifest.yml file in that subdirectory that looks likethis:
name: My Widgetscomponents:  widgets: widgets.json
  • Thewidgets.json file should be in the format produced bythegrist-widgetrepository, and should be placed in the same directory asmanifest.yml. Any material inplugins/my-widgetswill be served by Grist, and relative URLs can be used inwidgets.json.
  • Once all files are in place, restart Grist. Your widgets shouldnow be available in the custom widgets dropdown, along withany others fromGRIST_WIDGET_LIST_URL.
  • If you like, you can add multiple plugin subdirectories, withmultiple sets of widgets, and they'll all be made available.

Google Drive integrations:

VariablePurpose
GOOGLE_CLIENT_IDset to the Google Client Id to be used with Google API client
GOOGLE_CLIENT_SECRETset to the Google Client Secret to be used with Google API client
GOOGLE_API_KEYset to the Google API Key to be used with Google API client (accessing public files)
GOOGLE_DRIVE_SCOPEset to the scope requested for Google Drive integration (defaults to drive.file)

Database variables:

VariablePurpose
TYPEORM_DATABASEdatabase filename for sqlite or database name for other db types
TYPEORM_HOSThost for db
TYPEORM_LOGGINGset to 'true' to see all sql queries
TYPEORM_PASSWORDpassword to use
TYPEORM_PORTport number for db if not the default for that db type
TYPEORM_TYPEset to 'sqlite' or 'postgres'
TYPEORM_USERNAMEusername to connect as
TYPEORM_EXTRAany other properties to pass to TypeORM in JSON format

Docker-only variables:

VariablePurpose
GRIST_DOCKER_USERoptional. When the container runs as the root user, this is the user the Grist services run as. Overrides the default.
GRIST_DOCKER_GROUPoptional. When the container runs as the root user, this is the group the Grist services run as. Overrides the default.

Testing:

VariablePurpose
GRIST_TESTING_SOCKETa socket used for out-of-channel communication during tests only.
GRIST_TEST_HTTPS_OFFSETif set, adds https ports at the specified offset. This is useful in testing.
GRIST_TEST_SSL_CERTif set, contains filename of SSL certificate.
GRIST_TEST_SSL_KEYif set, contains filename of SSL private key.
GRIST_TEST_LOGINallow fake unauthenticated test logins (suitable for dev environment only).
GRIST_TEST_ROUTERif set, then the home server will serve a mock version of router api at /test/router
GREP_TESTSpattern for selecting specific tests to run (e.g.env GREP_TESTS=ActionLog yarn test).

Tests

Tests are run automatically as part of CI when a PR is opened. However, it can be helpful to run tests locallybefore pushing your changes to GitHub. First, you'll want to make sure you've installed all dependencies:

yarn installyarn install:python

Then, you can run the main test suite like so:

yarn test

Python tests may also be run locally. (Note: currently requires Python 3.10 - 3.11.)

yarn test:python

For running specific tests, you can specify a pattern with theGREP_TESTS variable:

env GREP_TESTS=ChoiceList yarn testenv GREP_TESTS=summary yarn test:python

License

This repository,grist-core, is released under theApache License, Version 2.0, which is anOSI-approved free software license. See LICENSE.txt and NOTICE.txt for more information.

About

Grist is the evolution of spreadsheets.

Topics

Resources

License

Contributing

Security policy

Stars

Watchers

Forks

Sponsor this project

 

[8]ページ先頭

©2009-2025 Movatter.jp