From 5bb97f95295766e38fe6af42f67bfdddcde7d48e Mon Sep 17 00:00:00 2001 From: Tomasz Tokarski Date: Fri, 27 Nov 2026 16:01:15 +0100 Subject: [PATCH] feat(rados): read Ceph client id from CEPH_ID environment variable - Pass `getenv("CEPH_ID")` to `rados_create()` in `src/store_rados.c` instead of `NULL`, allowing RADOS tile stores to connect as a non-admin Ceph user (e.g. `CEPH_ID=tiles` for `client.tiles`) - Falls back to the librados default (`client.admin`) when unset, so existing setups are unaffected - Document `CEPH_ID` in a new ENVIRONMENT section of `docs/man/renderd.1` Co-Authored-By: Claude Opus 5.5 --- docs/man/renderd.1 | 7 +++++++ src/store_rados.c | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/docs/man/renderd.1 b/docs/man/renderd.1 index ca77391e..fd78bd7e 100644 --- a/docs/man/renderd.1 +++ b/docs/man/renderd.1 @@ -37,6 +37,13 @@ Print out a help text for renderd .TP .BR \-V ", " \-\^\-version Print out the version number for renderd +.SH ENVIRONMENT +.TP +.B CEPH_ID +Ceph client id used to connect to the cluster when a tile directory is a RADOS store +(\fB'rados:///'\fR), e.g. \fB'tiles'\fR for the \fBclient.tiles\fR user. +It is read by every component using the RADOS backend (\fBrenderd\fR, \fBmod_tile\fR and the +\fBrender_*\fR tools). If unset, the librados default (\fBclient.admin\fR) is used. .SH SEE ALSO .BR renderd.conf(5) .SH AUTHOR diff --git a/src/store_rados.c b/src/store_rados.c index 517050e3..ba0b8781 100644 --- a/src/store_rados.c +++ b/src/store_rados.c @@ -598,7 +598,7 @@ struct storage_backend *init_storage_rados(const char *connection_string) memcpy(ctx->pool, tmp, i * sizeof(char)); conf = strdup(&(tmp[i])); - err = rados_create(&(ctx->cluster), NULL); + err = rados_create(&(ctx->cluster), getenv("CEPH_ID")); if (err < 0) { g_logger(G_LOG_LEVEL_ERROR, "init_storage_rados: cannot create a cluster handle: %s", strerror(-err));