Skip to content

Commit b154f8c

Browse files
authored
Merge pull request #50 from tma1-ai/greptime-standalone-config-auth
feat(greptime): default standalone server config + opt-in enforced static auth
2 parents c4d3473 + 1b5c34a commit b154f8c

40 files changed

Lines changed: 1711 additions & 1281 deletions

.env.dev.example

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,8 @@ DATABASE_URL="postgresql://postgres:postgres@localhost:5432/postgres"
4848
# GREPTIME_SQL_PORT="4002"
4949
# GREPTIME_SQL_READ_ONLY_HOST="localhost"
5050
# GREPTIME_DB="openfuse"
51-
# GREPTIME_USER="root"
52-
# GREPTIME_PASSWORD=""
51+
# GREPTIME_USER="openfuse"
52+
# GREPTIME_PASSWORD="" # empty -> local GreptimeDB runs without auth
5353
# GREPTIME_SQL_MAX_OPEN_CONNECTIONS="25"
5454
# GREPTIME_RAW_EVENTS_TABLE="raw_events"
5555
# LANGFUSE_GREPTIME_WRITE_MAX_FIELD_BYTES applies only when reactively truncating an oversized row.

.env.prod.example

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -242,10 +242,12 @@ GREPTIME_SQL_PORT="4002"
242242
# Optional dedicated read-only MySQL host; falls back to GREPTIME_SQL_HOST.
243243
# GREPTIME_SQL_READ_ONLY_HOST="greptimedb"
244244
GREPTIME_DB="openfuse"
245-
# Auth: empty for an unauthenticated single-node GreptimeDB. Set both for a
246-
# secured/managed deployment.
247-
# GREPTIME_USER=
248-
# GREPTIME_PASSWORD=
245+
# Auth: a non-empty password turns on enforced GreptimeDB static auth — the greptimedb container
246+
# generates a credentials file and starts with --user-provider, and the app authenticates with the
247+
# same user/password. These two values MUST match. Leave the password empty only for a single,
248+
# unauthenticated node you fully control. Set a strong password for any real deployment.
249+
GREPTIME_USER="openfuse"
250+
GREPTIME_PASSWORD="changeme-greptime-password" # CHANGEME
249251
# Max open connections in the MySQL read pool.
250252
# GREPTIME_SQL_MAX_OPEN_CONNECTIONS=25
251253
# Raw events table name (write-path source of truth).

.env.quickstart.example

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@ REDIS_AUTH="myredissecret"
2828

2929
# --- GreptimeDB (analytics event store) ---
3030
# Hosts are the docker-compose service name. gRPC 4001 = writes, MySQL 4002 = reads + migrations.
31+
# GreptimeDB auth is OFF here (no GREPTIME_PASSWORD) — fine for local eval, not for a shared host.
32+
# To enforce auth, set GREPTIME_PASSWORD (see .env.prod.example).
3133
GREPTIME_GRPC_URL="greptimedb:4001"
3234
GREPTIME_SQL_HOST="greptimedb"
3335
GREPTIME_SQL_PORT="4002"

.github/workflows/release-images.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@ name: Release images
55
#
66
# Triggers:
77
# - push a `v*` tag (e.g. `v1.2.0`) -> versioned release: semver tags + `latest`
8-
# (non-`-rc` tags only get the floating major/minor and `latest`).
8+
# (pre-release tags like `v1.0.0-alpha.1` only get the exact `{{version}}`
9+
# tag; the floating major/minor and `latest` stay on the last stable tag).
910
# - manual run (workflow_dispatch) -> builds the chosen ref, tagged by commit sha
1011
# plus an optional custom tag input. Never moves `latest`.
1112
#
@@ -82,11 +83,11 @@ jobs:
8283
latest=false
8384
tags: |
8485
type=semver,pattern={{version}},enable=${{ github.event_name == 'push' }}
85-
type=semver,pattern={{major}}.{{minor}},enable=${{ github.event_name == 'push' && !contains(github.ref, '-rc') }}
86-
type=semver,pattern={{major}},enable=${{ github.event_name == 'push' && !contains(github.ref, '-rc') }}
86+
type=semver,pattern={{major}}.{{minor}},enable=${{ github.event_name == 'push' && !contains(github.ref, '-') }}
87+
type=semver,pattern={{major}},enable=${{ github.event_name == 'push' && !contains(github.ref, '-') }}
8788
type=sha
8889
type=raw,value=${{ github.event.inputs.tag }},enable=${{ github.event.inputs.tag != '' }}
89-
type=raw,value=latest,enable=${{ github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') && !contains(github.ref, '-rc') }}
90+
type=raw,value=latest,enable=${{ github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') && !contains(github.ref, '-') }}
9091
9192
- name: Build and push
9293
uses: docker/build-push-action@10e90e3645eae34f1e60eeb005ba3a3d33f178e8 # v6

README.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -43,23 +43,23 @@ Read [Known limitations](docs/known-limitations.md) before you deploy.
4343

4444
## 5-minute quickstart (Docker Compose)
4545

46-
Requirements: Docker and Docker Compose. The stack is `langfuse-web`, `langfuse-worker`, `greptimedb`, `postgres`, and `redis`, with object storage off by default. Both schemas migrate automatically inside the container on startup.
46+
Requirements: Docker and Docker Compose. The quickest path is the single `openfuse-standalone` container — web + worker in one process — wired to Postgres, Redis, and GreptimeDB. Both schemas migrate automatically on startup; object storage is off by default.
4747

4848
```bash
4949
git clone https://github.com/tma1-ai/openfuse.git
5050
cd openfuse
51-
cp .env.quickstart.example .env # working dev defaults — no edits needed
52-
docker compose up -d # builds web/worker, starts the full stack
51+
cp .env.quickstart.example .env # working dev defaults — no edits needed
52+
docker compose -f docker-compose.standalone.yml up -d # one app container + Postgres/Redis/GreptimeDB
5353
```
5454

55-
Open <http://localhost:3000>. The quickstart env auto-creates a demo project, so you can log in as `demo@example.com` / `langfuse-dev` or point any Langfuse SDK at the bundled keys (`pk-lf-1234567890` / `sk-lf-1234567890`) right away. Those values are insecure dev defaults — for a real deployment start from `.env.prod.example` and set your own secrets. Full guide: [deployment](docs/deployment.md).
55+
Open <http://localhost:3000>. The quickstart env auto-creates a demo project, so you can log in as `demo@example.com` / `langfuse-dev` or point any Langfuse SDK at the bundled keys (`pk-lf-1234567890` / `sk-lf-1234567890`) right away. Those values are insecure dev defaults — for a real deployment start from `.env.prod.example` and set your own secrets, including a GreptimeDB password (`GREPTIME_PASSWORD`) to turn on enforced auth on the analytics store. Full guide: [deployment](docs/deployment.md).
5656

57-
### Single container (standalone)
57+
### Split web + worker
5858

59-
For a single node, `tma1ai/openfuse-standalone` runs web + worker in one container (the GreptimeDB-standalone analogue):
59+
To scale web and worker independently, use the default `docker-compose.yml` (separate `langfuse-web` and `langfuse-worker` images) instead:
6060

6161
```bash
62-
docker compose -f docker-compose.standalone.yml up # then open http://localhost:3000
62+
docker compose up -d # builds web/worker, starts the full stack
6363
```
6464

6565
## Published images

README.zh.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -43,23 +43,23 @@ LLM trace 本质就是可观测性数据:带高基数上下文的、带时间
4343

4444
## 5 分钟快速开始(Docker Compose)
4545

46-
需要 Docker 和 Docker Compose。整套栈是 `langfuse-web``langfuse-worker``greptimedb``postgres``redis`,对象存储默认关闭。两套 schema 在容器启动时自动迁移
46+
需要 Docker 和 Docker Compose。最快的方式是单个 `openfuse-standalone` 容器——web + worker 跑在一个进程里——再接上 Postgres、Redis、GreptimeDB。两套 schema 在启动时自动迁移,对象存储默认关闭
4747

4848
```bash
4949
git clone https://github.com/tma1-ai/openfuse.git
5050
cd openfuse
51-
cp .env.quickstart.example .env # working dev defaults — no edits needed
52-
docker compose up -d # builds web/worker, starts the full stack
51+
cp .env.quickstart.example .env # working dev defaults — no edits needed
52+
docker compose -f docker-compose.standalone.yml up -d # 一个 app 容器 + Postgres/Redis/GreptimeDB
5353
```
5454

55-
打开 <http://localhost:3000>。quickstart 的 env 会自动创建一个 demo project,所以你可以直接用 `demo@example.com` / `langfuse-dev` 登录,或者把任意 Langfuse SDK 指向内置的 key(`pk-lf-1234567890` / `sk-lf-1234567890`)。这些是不安全的 dev 默认值——正式部署请从 `.env.prod.example` 出发、自己生成 secret。完整指南见[部署文档](docs/deployment.md)
55+
打开 <http://localhost:3000>。quickstart 的 env 会自动创建一个 demo project,所以你可以直接用 `demo@example.com` / `langfuse-dev` 登录,或者把任意 Langfuse SDK 指向内置的 key(`pk-lf-1234567890` / `sk-lf-1234567890`)。这些是不安全的 dev 默认值——正式部署请从 `.env.prod.example` 出发、自己生成 secret,并为分析存储设置 GreptimeDB 密码(`GREPTIME_PASSWORD`)以开启强制鉴权。完整指南见[部署文档](docs/deployment.md)
5656

57-
### 单容器(standalone)
57+
### 拆分 web + worker
5858

59-
单节点部署用 `tma1ai/openfuse-standalone`,把 web + worker 跑在一个容器里(GreptimeDB standalone 的对应物):
59+
要让 web worker 独立扩缩,改用默认的 `docker-compose.yml``langfuse-web``langfuse-worker` 两个独立镜像):
6060

6161
```bash
62-
docker compose -f docker-compose.standalone.yml up # then open http://localhost:3000
62+
docker compose up -d # builds web/worker, starts the full stack
6363
```
6464

6565
## 已发布镜像

docker-compose.build.yml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@ services:
4040
GREPTIME_SQL_HOST: ${GREPTIME_SQL_HOST:-greptimedb}
4141
GREPTIME_SQL_PORT: ${GREPTIME_SQL_PORT:-4002}
4242
GREPTIME_DB: ${GREPTIME_DB:-openfuse}
43-
GREPTIME_USER: ${GREPTIME_USER:-}
44-
GREPTIME_PASSWORD: ${GREPTIME_PASSWORD:-}
43+
GREPTIME_USER: ${GREPTIME_USER:-openfuse}
44+
GREPTIME_PASSWORD: ${GREPTIME_PASSWORD:-} # CHANGEME (set to enforce GreptimeDB auth; required for any non-local deployment)
4545
# Object storage is OPTIONAL: media, the OTel ingestion carrier, and the eval observation blob
4646
# store default to a local-file backend (shared volumes below), so no MinIO is started. Enable
4747
# the optional `minio` service with `--profile s3` for S3-backed storage / batch exports.
@@ -115,17 +115,17 @@ services:
115115
greptimedb:
116116
# GreptimeDB analytics store (replaces ClickHouse). Standalone mode exposes HTTP (4000),
117117
# gRPC (4001, ingest SDK), MySQL wire (4002, read path + migrations), Postgres wire (4003).
118+
# The entrypoint wrapper loads docker/greptimedb/config.toml as a tuning starting point and
119+
# turns on enforced static auth when GREPTIME_PASSWORD is set (empty -> no auth).
118120
image: docker.io/greptime/greptimedb:v1.1.1
119-
command:
120-
- standalone
121-
- start
122-
- --http-addr=0.0.0.0:4000
123-
- --rpc-bind-addr=0.0.0.0:4001
124-
- --mysql-addr=0.0.0.0:4002
125-
- --postgres-addr=0.0.0.0:4003
126-
- --data-home=/greptimedb_data
121+
entrypoint: ["/bin/sh", "/usr/local/bin/openfuse-greptime-entrypoint.sh"]
122+
environment:
123+
GREPTIME_USER: ${GREPTIME_USER:-openfuse}
124+
GREPTIME_PASSWORD: ${GREPTIME_PASSWORD:-} # CHANGEME (set to enforce GreptimeDB auth; required for any non-local deployment)
127125
volumes:
128126
- langfuse_greptimedb_data:/greptimedb_data
127+
- ./docker/greptimedb/config.toml:/etc/greptime/config.toml:ro
128+
- ./docker/greptimedb/entrypoint.sh:/usr/local/bin/openfuse-greptime-entrypoint.sh:ro
129129
ports:
130130
- "4000:4000"
131131
- "4001:4001"

docker-compose.dev.yml

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,23 +3,24 @@ services:
33
# GreptimeDB backend for the fork. Replaces ClickHouse as the analytics store; the read/write
44
# paths and the test harness target this. Standalone mode exposes HTTP (4000), gRPC (4001,
55
# ingest SDK), MySQL wire (4002, read pool + migrations), and Postgres wire (4003).
6+
# The entrypoint wrapper loads docker/greptimedb/config.toml as a tuning starting point.
7+
# Local dev leaves GREPTIME_PASSWORD empty, so auth stays off; set it to exercise
8+
# enforced static auth locally.
69
image: docker.io/greptime/greptimedb:v1.1.1
710
container_name: ${GREPTIME_CONTAINER_NAME:-langfuse-greptimedb}
8-
command:
9-
- standalone
10-
- start
11-
- --http-addr=0.0.0.0:4000
12-
- --rpc-bind-addr=0.0.0.0:4001
13-
- --mysql-addr=0.0.0.0:4002
14-
- --postgres-addr=0.0.0.0:4003
15-
- --data-home=/greptimedb_data
11+
entrypoint: ["/bin/sh", "/usr/local/bin/openfuse-greptime-entrypoint.sh"]
12+
environment:
13+
GREPTIME_USER: ${GREPTIME_USER:-openfuse}
14+
GREPTIME_PASSWORD: ${GREPTIME_PASSWORD:-}
1615
ports:
1716
- ${HOST_IP:-127.0.0.1}:${GREPTIME_HTTP_PORT:-4000}:4000
1817
- ${HOST_IP:-127.0.0.1}:${GREPTIME_GRPC_PORT:-4001}:4001
1918
- ${HOST_IP:-127.0.0.1}:${GREPTIME_MYSQL_PORT:-4002}:4002
2019
- ${HOST_IP:-127.0.0.1}:${GREPTIME_PG_PORT:-4003}:4003
2120
volumes:
2221
- langfuse_greptimedb_data:/greptimedb_data
22+
- ./docker/greptimedb/config.toml:/etc/greptime/config.toml:ro
23+
- ./docker/greptimedb/entrypoint.sh:/usr/local/bin/openfuse-greptime-entrypoint.sh:ro
2324
healthcheck:
2425
test: ["CMD", "curl", "-f", "http://localhost:4000/health"]
2526
interval: 5s

docker-compose.standalone.yml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,8 @@ services:
5252
GREPTIME_SQL_HOST: ${GREPTIME_SQL_HOST:-greptimedb}
5353
GREPTIME_SQL_PORT: ${GREPTIME_SQL_PORT:-4002}
5454
GREPTIME_DB: ${GREPTIME_DB:-openfuse}
55-
GREPTIME_USER: ${GREPTIME_USER:-}
56-
GREPTIME_PASSWORD: ${GREPTIME_PASSWORD:-} # CHANGEME (set if GreptimeDB auth is enabled)
55+
GREPTIME_USER: ${GREPTIME_USER:-openfuse}
56+
GREPTIME_PASSWORD: ${GREPTIME_PASSWORD:-} # CHANGEME (set to enforce GreptimeDB auth; required for any non-local deployment)
5757
# --- redis ---
5858
REDIS_HOST: ${REDIS_HOST:-redis}
5959
REDIS_PORT: ${REDIS_PORT:-6379}
@@ -78,18 +78,18 @@ services:
7878
greptimedb:
7979
# GreptimeDB analytics store. Standalone mode exposes HTTP (4000), gRPC (4001, ingest SDK),
8080
# MySQL wire (4002, read path + migrations), Postgres wire (4003).
81+
# The entrypoint wrapper loads docker/greptimedb/config.toml as a tuning starting point and
82+
# turns on enforced static auth when GREPTIME_PASSWORD is set (empty -> no auth).
8183
image: docker.io/greptime/greptimedb:v1.1.1
8284
restart: always
83-
command:
84-
- standalone
85-
- start
86-
- --http-addr=0.0.0.0:4000
87-
- --rpc-bind-addr=0.0.0.0:4001
88-
- --mysql-addr=0.0.0.0:4002
89-
- --postgres-addr=0.0.0.0:4003
90-
- --data-home=/greptimedb_data
85+
entrypoint: ["/bin/sh", "/usr/local/bin/openfuse-greptime-entrypoint.sh"]
86+
environment:
87+
GREPTIME_USER: ${GREPTIME_USER:-openfuse}
88+
GREPTIME_PASSWORD: ${GREPTIME_PASSWORD:-} # CHANGEME (set to enforce GreptimeDB auth; required for any non-local deployment)
9189
volumes:
9290
- langfuse_greptimedb_data:/greptimedb_data
91+
- ./docker/greptimedb/config.toml:/etc/greptime/config.toml:ro
92+
- ./docker/greptimedb/entrypoint.sh:/usr/local/bin/openfuse-greptime-entrypoint.sh:ro
9393
ports:
9494
- 127.0.0.1:4000:4000
9595
- 127.0.0.1:4002:4002

docker-compose.yml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@ services:
3939
GREPTIME_SQL_HOST: ${GREPTIME_SQL_HOST:-greptimedb}
4040
GREPTIME_SQL_PORT: ${GREPTIME_SQL_PORT:-4002}
4141
GREPTIME_DB: ${GREPTIME_DB:-openfuse}
42-
GREPTIME_USER: ${GREPTIME_USER:-}
43-
GREPTIME_PASSWORD: ${GREPTIME_PASSWORD:-} # CHANGEME (set if GreptimeDB auth is enabled)
42+
GREPTIME_USER: ${GREPTIME_USER:-openfuse}
43+
GREPTIME_PASSWORD: ${GREPTIME_PASSWORD:-} # CHANGEME (set to enforce GreptimeDB auth; required for any non-local deployment)
4444
LANGFUSE_USE_AZURE_BLOB: ${LANGFUSE_USE_AZURE_BLOB:-false}
4545
LANGFUSE_USE_OCI_NATIVE_OBJECT_STORAGE: ${LANGFUSE_USE_OCI_NATIVE_OBJECT_STORAGE:-false}
4646
LANGFUSE_OCI_AUTH_TYPE: ${LANGFUSE_OCI_AUTH_TYPE:-workload_identity}
@@ -118,18 +118,18 @@ services:
118118
greptimedb:
119119
# GreptimeDB analytics store (replaces ClickHouse). Standalone mode exposes HTTP (4000),
120120
# gRPC (4001, ingest SDK), MySQL wire (4002, read path + migrations), Postgres wire (4003).
121+
# The entrypoint wrapper loads docker/greptimedb/config.toml as a tuning starting point and
122+
# turns on enforced static auth when GREPTIME_PASSWORD is set (empty -> no auth).
121123
image: docker.io/greptime/greptimedb:v1.1.1
122124
restart: always
123-
command:
124-
- standalone
125-
- start
126-
- --http-addr=0.0.0.0:4000
127-
- --rpc-bind-addr=0.0.0.0:4001
128-
- --mysql-addr=0.0.0.0:4002
129-
- --postgres-addr=0.0.0.0:4003
130-
- --data-home=/greptimedb_data
125+
entrypoint: ["/bin/sh", "/usr/local/bin/openfuse-greptime-entrypoint.sh"]
126+
environment:
127+
GREPTIME_USER: ${GREPTIME_USER:-openfuse}
128+
GREPTIME_PASSWORD: ${GREPTIME_PASSWORD:-} # CHANGEME (set to enforce GreptimeDB auth; required for any non-local deployment)
131129
volumes:
132130
- langfuse_greptimedb_data:/greptimedb_data
131+
- ./docker/greptimedb/config.toml:/etc/greptime/config.toml:ro
132+
- ./docker/greptimedb/entrypoint.sh:/usr/local/bin/openfuse-greptime-entrypoint.sh:ro
133133
ports:
134134
- 127.0.0.1:4000:4000
135135
- 127.0.0.1:4001:4001

0 commit comments

Comments
 (0)