Skip to content

Grist

Grist คือ open-source spreadsheet ที่ผสมผสานความง่ายของ spreadsheet กับพลังของ database แบบ relational เข้าด้วยกัน รองรับ formula ขั้นสูง, automation, และ สามารถเชื่อมต่อกับ external database ได้

  • Spreadsheet + Database — ตารางแบบ spreadsheet ที่มี relational data, references, และ lookup
  • Formula engine ขั้นสูง — ใช้ Python expressions ได้เต็มรูปแบบ
  • Automation — สร้าง rules และ triggers ได้แบบ no-code
  • Self-hosted — รองรับ Docker, มี SSO/Auth ผ่าน OAuth2 Proxy
  • Import/Export — รองรับ CSV, Excel, PostgreSQL, MySQL

Docker Compose (แบบ Simple - localhost + port expose)

Section titled “Docker Compose (แบบ Simple - localhost + port expose)”

สำหรับ local หรือ internal network ที่ไม่ต้องการ reverse proxy:

services:
grist:
image: gristlabs/grist
container_name: grist
restart: unless-stopped
environment:
TZ: Asia/Bangkok
GRIST_SINGLE_ORG: my-org
GRIST_DEFAULT_EMAIL: admin@example.com
APP_HOME_URL: http://localhost:8484
volumes:
- ./grist:/persist
ports:
- "8484:8484"
networks:
- app-network
networks:
app-network:
driver: bridge

APP_HOME_URL ต้องตรงกับ URL ที่เข้าถึงจริง ถ้าเป็น localhost ก็ใช้ localhost

ใช้ oauth2-proxy ทำ authentication ก่อนเข้า Grist:

services:
grist:
image: gristlabs/grist
container_name: grist
restart: unless-stopped
environment:
TZ: Asia/Bangkok
GRIST_FORWARD_AUTH_HEADER: X-Forwarded-User
GRIST_FORWARD_AUTH_LOGOUT_PATH: /oauth2/sign_out
GRIST_SINGLE_ORG: my-org
GRIST_DEFAULT_EMAIL: admin@example.com
APP_HOME_URL: https://grist.example.com
volumes:
- ./grist:/persist
networks:
- app-network
oauth2-proxy:
image: quay.io/oauth2-proxy/oauth2-proxy:latest
container_name: oauth2-proxy-sheet
restart: unless-stopped
environment:
TZ: Asia/Bangkok
OAUTH2_PROXY_CLIENT_ID: your-client-id
OAUTH2_PROXY_CLIENT_SECRET: your-client-secret
OAUTH2_PROXY_REDIRECT_URL: https://grist.example.com/oauth2/callback
OAUTH2_PROXY_HTPASSWD_FILE: /etc/oauth2-proxy/htpasswd
OAUTH2_PROXY_COOKIE_SECRET: your-32-char-secret
OAUTH2_PROXY_COOKIE_SECURE: "true"
OAUTH2_PROXY_UPSTREAMS: http://grist:8484
OAUTH2_PROXY_HTTP_ADDRESS: "0.0.0.0:4180"
OAUTH2_PROXY_EMAIL_DOMAINS: "*"
OAUTH2_PROXY_CUSTOM_SIGN_IN_LOGO: https://www.getgrist.com/wp-content/uploads/2023/03/Grist-Logo.png
volumes:
- ./proxy/htpasswd:/etc/oauth2-proxy/htpasswd:ro
networks:
- app-network
ports:
- "4180:4180"
networks:
app-network:
driver: bridge
Terminal window
# ติดตั้ง apache2-utils ก่อน (macOS: brew install httpd)
htpasswd -c ./proxy/htpasswd admin
# พิมพ์ password ที่ต้องการ
VariableDescriptionExample
GRIST_SINGLE_ORGบังคับใช้ organization เดียวmy-org
GRIST_DEFAULT_EMAILdefault email สำหรับ adminadmin@example.com
APP_HOME_URLURL หลักที่เข้าถึง Gristhttps://grist.example.com
GRIST_FORWARD_AUTH_HEADERheader ที่ OAuth proxy ส่งมาX-Forwarded-User
GRIST_FORWARD_AUTH_LOGOUT_PATHlogout path ของ OAuth/oauth2/sign_out
GRIST_ORG_IN_PATHใส่ org ใน URL path แทน subdomaintrue
GRIST_SESSION_SECRETsecret สำหรับ encrypt sessionrandom-string
GRIST_DATA_DIRที่อยู่ data files/persist/data
GRIST_BACKUP_DIRที่อยู่ backup files/persist/backups
GRIST_IMPORT_DIRdirectory สำหรับ import/persist/imports
Avatar blackCat
ถ้าใช้ GRIST_SINGLE_ORG จะไม่ต้องเลือก org ตอนเข้าใช้ เหมาะสำหรับ self-hosted แบบ single tenant
VariableDescriptionExample
OAUTH2_PROXY_CLIENT_IDOAuth app client IDdummy
OAUTH2_PROXY_CLIENT_SECRETOAuth app client secretdummy
OAUTH2_PROXY_REDIRECT_URLcallback URL ที่ OAuth providerhttps://grist.example.com/oauth2/callback
OAUTH2_PROXY_HTPASSWD_FILEpath สำหรับ htpasswd file/etc/oauth2-proxy/htpasswd
OAUTH2_PROXY_COOKIE_SECRETsecret สำหรับ encrypt cookie (32 chars)12345678901234567890123456789012
OAUTH2_PROXY_EMAIL_DOMAINSอนุญาต email domains* (all) หรือ example.com
OAUTH2_PROXY_COOKIE_SECUREset cookie secure flagtrue ถ้า HTTPS
VariableDescriptionExample
OAUTH2_PROXY_UPSTREAMSbackend servicehttp://grist:8484
OAUTH2_PROXY_HTTP_ADDRESSlisten address0.0.0.0:4180
OAUTH2_PROXY_SKIP_AUTH_ROUTESroutes ที่ข้าม auth^/api(/.*)?$
Avatar blackCat
OAUTH2_PROXY_SKIP_AUTH_ROUTES ใช้ regex ถ้าต้องการให้ API routes ของ Grist เข้าถึงได้โดยไม่ต้อง login
Terminal window
OAUTH2_PROXY_PROVIDER=google
OAUTH2_PROXY_CLIENT_ID=your-google-client-id
OAUTH2_PROXY_CLIENT_SECRET=your-google-client-secret
OAUTH2_PROXY_EMAIL_DOMAINS=example.com
Terminal window
OAUTH2_PROXY_PROVIDER=github
OAUTH2_PROXY_CLIENT_ID=your-github-client-id
OAUTH2_PROXY_CLIENT_SECRET=your-github-client-secret
OAUTH2_PROXY_EMAIL_DOMAINS=example.com
VariableDescription
OAUTH2_PROXY_LOG_LEVELlog level: debug, info, warn, error
OAUTH2_PROXY_DISPLAY_HTPASSWD_FORMแสดง htpasswd login form ด้วย
MethodURL
Local (direct)http://localhost:8484
OAuth2 Proxyhttp://your-server:4180
With domainhttps://grist.example.com