A service-specific username or password takes precedence over the
global OCIS_NATS_CREDS and OCIS_NATS_CREDS_FILE variables. The
descriptions of the creds variables said that a set creds value always
replaces the username and the password. Add the exception to each
creds variable that has a service-specific variable, and to
services/nats/README.md.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
- The search, sharing, storage-users, ocs and gateway config structs
now have a method that returns the stream.NatsConfig. Before, the
same literal was in 7 places. A new NATS field then needed 7 edits.
A test fails when a field of stream.NatsConfig is not mapped.
- Remove the CredsFile and Creds fields from shared.Cache. No service
copied these fields from the commons, so they had no effect.
- Add a changelog entry for the provider cache persistence fix of the
gateway service.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
- A service-specific username or password now takes precedence over the
global NATS JWT credentials. Before, OCIS_NATS_CREDS_FILE always
replaced a value like GRAPH_CACHE_AUTH_USERNAME. The service registry
uses the same rule for MICRO_REGISTRY_AUTH_USERNAME and
MICRO_REGISTRY_AUTH_PASSWORD.
- The NATS health check keeps one connection and uses it again for each
probe. Before, each probe read the .creds file and opened a new
connection. A probe could read a rotated file before the write was
complete. The proxy, ocs and gateway services now build the check once.
- The startup check of the store credentials runs only for the nats-js
and nats-js-kv store types. Other store types do not use the
credentials.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This reverts commit 5b7d19de45.
With only the global variables, an operator cannot set different
credentials for one NATS connection. The service-specific variables
let the more specific scope win again.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
The reva store cannot return an error for invalid NATS credentials. It
only logs the error, and each store operation fails later. The config
validation of each service with a store now checks the credentials. An
invalid value now stops the service at startup.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
nats.UserCredentials reads the creds file only in its callbacks. The
custom lazyCredsFileOption function did the same work, so remove it.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Reva reads the key "cache_disable_persistence". The gateway sent
"disable_persistence", so reva ignored the setting.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Remove the service-specific NATS credentials variables. Only
OCIS_NATS_CREDS_FILE and OCIS_NATS_CREDS remain. The service registry
also uses these two variables and no longer reads
MICRO_REGISTRY_AUTH_CREDS_FILE and MICRO_REGISTRY_AUTH_CREDS.
Remove the envdecode logic that let the more specific scope win,
because only one scope remains.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
The create home cache of the gateway (create_personal_space_cache_config)
got the NATS credentials, but it had no TLS settings. With TLS on the
NATS server, this cache could not connect.
Add CreateHomeCacheEnableTLS, CreateHomeCacheTLSInsecure and
CreateHomeCacheTLSRootCACertificate with the same variables as the
provider cache, and pass them to reva.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
storeOptions checked the NATS credentials and called os.Exit(1) on an
error. ReconnectedCB calls Init, and Init runs storeOptions again. If
a reconnect happened while a rotated .creds file was only partly
written, the service stopped. In the same path, nats.UserCredentials
reads the file once when the option is applied. When this read
failed, the error was ignored and the connection had no credentials.
Now only the first call checks the credentials, at startup. Later
calls do not check the file. For a file, they set the JWT callbacks
without a read. The callbacks read the file on each connect, so a
partly written file fails only that connect attempt, and NATS
retries it.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Each config has two fields for the NATS credentials: CredsFile
(OCIS_NATS_CREDS_FILE;<SERVICE>_..._CREDS_FILE) and Creds
(OCIS_NATS_CREDS;<SERVICE>_..._CREDS). envdecode sets each field on
its own, and the content always won. Example: OCIS_NATS_CREDS set
globally and GRAPH_CACHE_CREDS_FILE set for the service. The graph
cache then used the global content and ignored the service file.
The registry already used a different rule: the registry variables
take precedence over the global variables.
Use the registry rule everywhere. After envdecode decodes a struct,
it resolves each CredsFile/Creds pair: when the file comes from a
more specific environment variable than the content, the content is
cleared. In the same scope the content still wins. A value from the
config file has the lowest scope, because environment variables
override the config file.
Update the descriptions of the Creds fields, the nats README, and the
changelog.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
go-masker copies a field without a mask tag unchanged, also a nested
struct. A mask:"password" tag thus has an effect only when every
parent field on the path has mask:"struct". Several parent fields did
not have this tag, and some secret fields had no mask tag.
- Add mask:"struct" to the proxy fields OIDC, OIDC.UserinfoCache,
PreSignedURL, PreSignedURL.SigningKeys, ServiceAccount and Events,
and to the shared Commons.Cache field.
- Add mask:"password" to the AuthPassword fields of the proxy and of
the shared cache, and to ServiceAccountSecret.
- Add a test that sets a marker in every secret field of the proxy
config and checks that the debug output does not show it. The test
also fails when a secret-like field has no mask:"password" tag.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The nats service README did not tell that the embedded nats service
cannot run in operator (JWT) mode. Add a section that describes the
.creds variables, the registry variables, and the steps to use an
external NATS cluster in JWT mode. Add the same note to the changelog.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The search service and the storage-users event stream build
stream.NatsConfig field by field. They did not set CredsFile and
Creds, so these two connections did not use the JWT credentials.
The NATS server rejected them with "Authorization Violation".
A test of "ocis server" against a NATS server in operator mode
found this. The compiler cannot find a missing field in a struct
literal.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The proxy health check used Events.Cluster, the cluster ID of the
event system, as the NATS address. The check thus never reached the
NATS server.
The check now uses Events.Endpoint. The proxy uses NATS only to
publish events, and an empty endpoint disables the events. So the
check returns no error when the endpoint is empty.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A NATS server in operator (JWT) mode authenticates a client with a
user JWT and an NKey seed. oCIS could connect to NATS only with a
username and a password.
All NATS connections now accept JWT credentials: events, caches,
persistent stores, the service registry, and the health checks.
- OCIS_NATS_CREDS_FILE: the path of a .creds file
(nats.UserCredentials). The file is read again on each reconnect.
- OCIS_NATS_CREDS: the content of a .creds file
(nats.UserCredentialBytes). It takes precedence over the file.
- Each events, cache and store struct has the fields CredsFile and
Creds with a per-service override, for example
PROXY_EVENTS_CREDS_FILE.
- The registry reads MICRO_REGISTRY_AUTH_CREDS_FILE and
MICRO_REGISTRY_AUTH_CREDS. If they are empty, it uses the
OCIS_NATS_* variables.
- store.Credentials is passed next to each store.Authentication call.
The revaconfig maps pass the new reva keys.
- The new checks.NewNatsCheckWithConfig uses the authentication and
TLS settings of the service. The NATS health checks connected
without credentials and without TLS before.
This change needs the reva commit with pkg/natsauth and the natsjs
plugin with the NatsOptions option. go.mod and vendor/ follow when
these changes are pushed.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The release workflow built the oCIS image locally only to run a Trivy
gate against it. The Alpine edge pin for vips makes that build break
whenever the rolling repository drops the pinned revision, failing the
whole release for a reason unrelated to the release content.
Image building, scanning and publishing already happen in the
owncloud-docker/ocis repository, which keeps a per-minor .trivyignore.
Disable the job and unwire it from the downstream jobs, matching
stable-8.1, stable-8.2 and master.
Signed-off-by: Julian Koberg <julian.koberg@kiteworks.com>
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
The release filesystem scan (Trivy, fs scan of services/idp/pnpm-lock.yaml)
flagged 7 HIGH vulnerabilities in axios 1.19.0, all fixed in 1.20.0. Only the
8.0 line is affected, as services/idp no longer exists on 8.1, 8.2 and master.
Also adds the 8.0.9 section to CHANGELOG.md, which the 8.0.9 release commit
did not regenerate.
Signed-off-by: Julian Koberg <julian.koberg@kiteworks.com>
* fix: the public share configuration and fixed graceful shutdown
* fix: [OCISDEV-1433] remove GRPC_MAX_CONNECTION_AGE
The setting closed healthy grpc connections on a timer so that clients would redo
their DNS lookup. It never helped against the failure it was reached for - a
connection whose peer stopped answering - because the age limit is enforced by
the server, the grace period was left at infinity so a request already in flight
was never ended, and any value without a unit suffix silently disabled it again.
Detecting a peer that stops answering is now the job of the grpc clients, which
ping the peer while a request is in flight. The servers here got the matching
enforcement policy so they accept those pings; the client side arrives with the
next reva bump.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
* fix: Added the new variable OCDAV_DISABLE_PROPFIND_PUBLIC_LINK_RESOLUTION that disable the resolution of public link shares when answering PROPFIND requests.
* chore: bump reva
* fix: The keepalive added to grpc clinet
* chore: bump reva
* build(deps): bump go 1.26.8, grpc-go dependency
---------
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
Change the documented introductionVersion of the
OCIS_LDAP_INSTANCE_MAPPER_CACHE_TTL environment variable from 8.0.0 to 8.3.0.
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Backport of #12739. Bump reva (stable-8.0 backport, reva#730, merged as
40663c5) to pick up the fix for upload sessions whose node metadata can no
longer be read, and wire up the new Orphaned session filter:
ocis storage-users uploads sessions --orphaned
ocis storage-users uploads sessions --orphaned --clean
backports: https://github.com/owncloud/ocis/pull/12739
Signed-off-by: Julian Koberg <julian.koberg@kiteworks.com>
Co-authored-by: kobergj <jkoberg@owncloud.com>
fix(graph): [stable-8.0] set correct introductionVersion 8.2.0 for GRAPH_RECEIVED_SHARES_STAT_TIMEOUT
PR #12862 merged this env var with introductionVersion:"NEXT", a placeholder
the docs process rejects. The variable was introduced in 8.2.0 (matching
master and stable-8.2), so pin it to 8.2.0.