API server for Synology Spreadsheet
5.6K
Spreadsheet API is not part of the Office package. This image provides a proxy service between clients and DSM. Each worker is dedicated to a single user and a single spreadsheet. An user can have multiple workers for different spreadsheets at the same time.
Note: It is DISCOURAGED to run the container and Office on the same DSM. The server can consume significant resources, especially if there are numerous active spreadsheets. The server performs essential computations when loading spreadsheets.
| Docker Image Tag | Synology Office |
|---|---|
3.4.1 | 3.7.0 or higher |
3.3.2 | 3.6.0 ~ 3.6.2 |
Run the server with
docker run -e AUTH_SECRET=secret-key-for-auth-token -p '3000:3000' synology/spreadsheet-api:{tagname}
Below summarizes available environment variables (those with * are required):
| Variables | Default | Description |
|---|---|---|
| AUTH_SECRET * | NA | The secret key for JWT token. The server cannot run without this variable. |
| METRICS_TOKEN | NA | Monitor server health by retrieving real-time metrics with the token. Keep it secret as the metrics may contain confidential data. Metrics are inaccessible if it is not set. |
| LOKI_HOST | NA | Send warnings and errors to a Loki server running on this URL. Keep it secret as the logs may contain confidential data. Logs are printed to stdout if it is not set. |
| HOST | 0.0.0.0 | The address the server listens to. |
| PORT | 3000 | The port the server listens to. |
| WORKER_TIMEOUT | 600,000 | Time (milliseconds) before closing an inactive worker. |
| USER_TIMEOUT | 60,000 | Time (milliseconds) before closing an user with no worker. |
By default, the setup above only accepts HTTP connections. The following tools can be used to handle secure connections (HTTPS):
Create jobs to collect metrics
# prometheus.yml
scrape_configs:
- job_name: 'system-metrics'
metrics_path: '/spreadsheets/admin/fastifyMetrics'
params:
metrics_token: ['{your METRICS_TOKEN}']
static_configs:
- targets: ['{your Spreadsheet API server ip}']
- job_name: 'user-metrics'
metrics_path: '/spreadsheets/admin/metrics'
params:
metrics_token: ['{your METRICS_TOKEN}']
static_configs:
- targets: ['{your Spreadsheet API server ip}']
Run a Loki server on the URL specified by LOKI_HOST to collect logs.
# loki.yml
target: all
server:
http_listen_port: 3100
ingester:
lifecycler:
address: 127.0.0.1
ring:
kvstore:
store: inmemory
replication_factor: 1
final_sleep: 0s
wal:
dir: /tmp/loki/wal
chunk_idle_period: 30m
chunk_retain_period: 0s
max_transfer_retries: 0
schema_config:
configs:
- from: 2018-04-15
store: boltdb
object_store: filesystem
schema: v11
index:
prefix: index_
period: 168h
storage_config:
boltdb:
directory: /tmp/loki/index
filesystem:
directory: /tmp/loki/chunks
docker-compose.yml below)prometheus & loki data sources in UI# docker-compose.yml
volumes:
grafana-data-vol:
services:
prometheus:
image: prom/prometheus:latest
command: [ "--config.file=/etc/prometheus/prometheus.yml" ]
volumes:
- ./prometheus/prometheus.yml:/etc/prometheus/prometheus.yml
ports:
- "9090:9090"
loki:
image: grafana/loki
ports:
- 3100:3100
command: [ "-config.file=/etc/loki/loki.yml" ]
volumes:
- ./loki/loki.yml:/etc/loki/loki.yml
- ./loki/index:/tmp/loki/index
- ./loki/chunks:/tmp/loki/chunks
- ./loki/wal:/tmp/loki/wal
grafana:
image: grafana/grafana
volumes:
- grafana-data-vol:/var/lib/grafana
ports:
- 3000:3000
environment:
- GF_SECURITY_ADMIN_USER={your username}
- GF_SECURITY_ADMIN_PASSWORD={your password}
- GF_SERVER_DOMAIN={your server domain}
Content type
Image
Digest
sha256:f991f0146…
Size
388.2 MB
Last updated
about 1 year ago
docker pull synology/spreadsheet-api