Commit Graph

22479 Commits

Author SHA1 Message Date
Martin
eb9fae42fd Merge pull request #12060 from paul43210/fix/uploadready-add-resourceid
[docs-only] fix: add ResourceID field to UploadReady event with file's node ID
2026-03-14 10:02:27 +01:00
Paul Faure
4a2004784c docs: add reva #560 link to changelog
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-14 09:52:46 +01:00
Paul Faure
c778609044 fix: add ResourceID field to UploadReady event with file's node ID
The UploadReady event's FileRef.ResourceId.OpaqueId is set to the space
root ID (required for CS3 gateway path resolution via WalkPath). This
means consumers that need the file's actual node ID for Graph API URLs
get the space root instead.

Add a separate ResourceID field (following the BytesReceived pattern)
that carries the file's actual resource identifier with the correct
OpaqueId set to session.NodeID().

Upstream: https://github.com/owncloud/reva/pull/XXXXX

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-14 09:52:46 +01:00
Martin
3ac19ca463 Merge pull request #12112 from owncloud/fix/ci-codacy-2
fix: ci, codacy, skip artifact upload when no tests run i.e. doc only…
2026-03-13 11:07:30 +01:00
Michal Klos
297a00fc44 fix: ci, codacy, skip artifact upload when no tests run i.e. doc only change 2026-03-13 10:26:25 +01:00
Martin
953dc0f319 Automated changelog update [skip ci] 2026-03-13 08:59:47 +00:00
Martin
e687a05800 Merge pull request #12103 from paul43210/fix/search-indexspace-docid-lookup
perf(search): use O(1) DocID lookup instead of full search in IndexSpace
2026-03-13 09:57:18 +01:00
Martin
0c6e574d15 Merge pull request #12104 from paul43210/fix/search-bleve-optimize
enhancement(search): optimize bleve index after bulk reindexing
2026-03-13 09:57:15 +01:00
Paul Faure
0d95d40f7c docs: add doc comments to Lookup mock call methods
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-12 20:37:48 -04:00
kobergj
90655c56a3 Automated changelog update [skip ci] 2026-03-12 07:30:11 +00:00
kobergj
dd99e6daf1 Merge pull request #12102 from kobergj/TestBlobstoreCli
Add CLI command to test Blobstore
2026-03-12 08:27:18 +01:00
Paul Faure
eb357f820d perf(search): use O(1) DocID lookup instead of full search in IndexSpace
Replace the per-file Search() call in IndexSpace with a direct Lookup()
using Bleve's DocIDQuery. The old approach parsed a KQL query string,
compiled it, and ran a full-text search for each file — taking 600-950ms
per file on large indexes. The new approach does an O(1) document lookup
by ID and compares mtime/Extracted fields in memory.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-12 07:45:15 +01:00
Paul Faure
728a7b4d8d fix: name parameters in forceMerger interface to satisfy inamedparam linter
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-12 07:44:29 +01:00
Paul Faure
6270553209 enhancement(search): optimize bleve index after bulk reindexing
Add an Optimizer optional interface and Bleve.Optimize() method that
triggers ForceMerge to compact all index segments into one. Called
automatically after IndexSpace completes its walk. Over time, writes
create multiple segments that degrade query performance — compaction
consolidates them for faster searches.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-12 07:44:29 +01:00
Sawjan Gurung
1a5aeeb2e9 Automated changelog update [skip ci] 2026-03-12 05:03:56 +00:00
Sawjan Gurung
39192c7bea ci: use existing servers (#12100)
* ci: enable k8s setup for remaining suites

Signed-off-by: Saw-jan <saw.jan.grg3e@gmail.com>

* ci: use existing servers

Signed-off-by: Saw-jan <saw.jan.grg3e@gmail.com>

* ci: fix

Signed-off-by: Saw-jan <saw.jan.grg3e@gmail.com>

* test: fix tests

Signed-off-by: Saw-jan <saw.jan.grg3e@gmail.com>

* test: increase timeout

Signed-off-by: Saw-jan <saw.jan.grg3e@gmail.com>

* ci: fix mail setup

Signed-off-by: Saw-jan <saw.jan.grg3e@gmail.com>

* test: increase timeout

Signed-off-by: Saw-jan <saw.jan.grg3e@gmail.com>

* ci: fix tika

Signed-off-by: Saw-jan <saw.jan.grg3e@gmail.com>

* test: fix csp directives

Signed-off-by: Saw-jan <saw.jan.grg3e@gmail.com>

* ci: merge ocm provider configs

Signed-off-by: Saw-jan <saw.jan.grg3e@gmail.com>

* test: fix notification tests

Signed-off-by: Saw-jan <saw.jan.grg3e@gmail.com>

* ci: fix script file

Signed-off-by: Saw-jan <saw.jan.grg3e@gmail.com>

* ci: enable ocm server logs

Signed-off-by: Saw-jan <saw.jan.grg3e@gmail.com>

* ci: fix pattern

Signed-off-by: Saw-jan <saw.jan.grg3e@gmail.com>

* ci: fix cluster wait

Signed-off-by: Saw-jan <saw.jan.grg3e@gmail.com>

* ci: run auth-app only when required

Signed-off-by: Saw-jan <saw.jan.grg3e@gmail.com>

* test: fix sharing tests

Signed-off-by: Saw-jan <saw.jan.grg3e@gmail.com>

* test: fix tests

Signed-off-by: Saw-jan <saw.jan.grg3e@gmail.com>

---------

Signed-off-by: Saw-jan <saw.jan.grg3e@gmail.com>
2026-03-12 10:46:13 +05:45
Julian Koberg
15b1c38e38 fix: adjust to comments from CR
Signed-off-by: Julian Koberg <julian.koberg@kiteworks.com>
2026-03-11 08:55:54 +01:00
Martin
0ca881b400 Automated changelog update [skip ci] 2026-03-11 07:49:51 +00:00
Martin
c65dff7fac Merge pull request #12070 from paul43210/fix/csp-font-src
fix(proxy): add data: to font-src CSP to allow bundled KaTeX fonts
2026-03-11 08:47:29 +01:00
Paul Faure
d4367fb224 fix(proxy): update tests and example configs for font-src data: CSP change
Update acceptance tests and all deployment example CSP configs to include
'data:' in font-src, consistent with the default csp.yaml change.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-10 22:22:17 -04:00
Julian Koberg
1d2c329e66 feat: add cli command to test the blobstore
Signed-off-by: Julian Koberg <julian.koberg@kiteworks.com>
2026-03-10 16:40:00 +01:00
Paul Faure
d8984c4c06 docs: add changelog for CSP font-src fix
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-10 11:08:52 +01:00
Paul Faure
ece1043ca2 fix(proxy): add data: to font-src CSP to allow bundled KaTeX fonts
The bundled Web UI CSS (from owncloud/web) inlines the KaTeX_Size3 font
as a base64 data:font/woff2 URI. The default CSP sets font-src to 'self'
only, which blocks these data URIs and produces a console error on every
page load:

  Loading the font 'data:font/woff2;base64,...' violates the following
  Content Security Policy directive: "font-src 'self'".

Add 'data:' to font-src, matching the existing pattern where img-src
already permits data: URIs.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-10 11:08:52 +01:00
Martin
4fba74c1f7 Automated changelog update [skip ci] 2026-03-10 08:20:45 +00:00
Martin
296609da98 Merge pull request #12095 from paul43210/fix/search-incomplete-extraction
fix(search): prevent incomplete Tika extractions from blocking re-index
2026-03-10 09:18:11 +01:00
Martin
03bfabec55 Merge pull request #12094 from paul43210/feature/kql-numeric-range-queries
feat(kql): support numeric range queries
2026-03-10 09:17:38 +01:00
Michal Klos
983dc5f7b5 fix: X-XSS-Protection header (#12092) 2026-03-10 09:15:35 +01:00
Sawjan Gurung
d65dd806de ci: use script to prepare ocis charts (#12081)
ci: fix path



ci: fix wopi servers



ci: conditional resources

Signed-off-by: Saw-jan <saw.jan.grg3e@gmail.com>
2026-03-10 12:58:43 +05:45
Paul Faure
b52af29f8e refactor(kql): extract dateTimeQuery helper to further reduce walk() complexity
Extracts DateTimeNode handling into dateTimeQuery(), same pattern as
numericQuery(). Brings walk() cyclomatic complexity from 36 to ~30,
well below the SonarCloud threshold of 35.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-08 17:45:13 -04:00
Paul Faure
b1218d868a docs: add changelog for incomplete extraction fix
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-08 17:38:23 -04:00
Paul Faure
8471094c1d fix(search): prevent incomplete Tika extractions from blocking re-index
Two changes to fix permanently stuck index entries:

1. (Option D) Validate Tika responses: if MetaRecursive() returns an
   empty metadata list, treat it as an error. This prevents Tika HTTP 200
   responses with no actual content from being accepted as successful
   extractions.

2. (Option B) Add Extracted field to Resource: a boolean that is set to
   true only when UpsertItem completes successfully. The IndexSpace skip
   check now requires Extracted:true in addition to matching id+mtime.
   Documents that were written with incomplete extraction data will be
   automatically re-processed on the next reindex.

Background: When Tika returns HTTP 200 but its child processes (OCR,
ImageMagick) fail due to resource limits (EAGAIN, OOM), the Go Tika
client receives metadata headers but no X-TIKA:content. The doc gets
written to Bleve with the correct mtime, and subsequent reindexes skip
it forever because the id+mtime check passes.

Fixes: #12093

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-08 17:36:30 -04:00
Paul Faure
d5e3e16397 refactor(kql): extract numericQuery helper to reduce walk() complexity
Fixes SonarCloud gocyclo finding — walk() cyclomatic complexity
was 40 (threshold 35). Extracted numeric range query building
into a separate numericQuery() function.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-08 00:16:15 -05:00
Paul Faure
4b7349037f feat(kql): support numeric range queries (>=, <=, >, <)
Add NumericRestrictionNode to the KQL PEG grammar so that range
operators work with numeric values, not just DateTimes. This enables
queries like `size>=1048576`, `photo.iso>=100`, `photo.fNumber>=2.8`,
and `photo.focalLength<50`.

Changes:
- ast: add NumericNode with Key, Operator, Value (float64)
- kql/dictionary.peg: add NumericRestrictionNode and Number rules
- kql/factory.go: add buildNumericNode()
- kql/cast.go: add toFloat64()
- bleve/compiler.go: compile NumericNode to NumericRangeQuery

Fixes: #12093

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-07 23:51:08 -05:00
ownClouders
8b5bffcff9 Automated changelog update [skip ci] 2026-03-08 00:38:03 +00:00
ownClouders
928b8d4823 [tx] updated from transifex 2026-03-08 00:35:19 +00:00
Roman Perekhod
0ee201628c Automated changelog update [skip ci] 2026-03-06 13:07:59 +00:00
Roman Perekhod
b5b4d25e45 Merge pull request #12087 from owncloud/feat/bump-reva-ce3149532498
[full-ci] feat: bump reva to latest
2026-03-06 14:05:21 +01:00
kobergj
26587468e7 Merge pull request #12090 from owncloud/DeepDiver1975-patch-1
[full-ci] ci: use plugins/s3:1.4.0
2026-03-06 13:58:06 +01:00
Martin
3fc236be96 Merge pull request #12000 from paul43210/fix/search-skip-tika-reindex
fix(search): skip Tika re-extraction when file content has not changed
2026-03-06 11:39:25 +01:00
Thomas Müller
4106776808 ci: use plugins/s3:1.4.0 2026-03-06 11:20:24 +01:00
Paul Faure
1163f51496 fix(search): guard uint64-to-int64 conversion to prevent overflow (gosec G115)
Clamp ContentExtractionSizeLimit to math.MaxInt64 before casting to
int64 for io.LimitReader.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-06 10:52:30 +01:00
Paul Faure
d54727c9ea docs(search): note race condition in engine.Update GoDoc
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-06 10:52:30 +01:00
Paul Faure
329482e8ec refactor(search): address review — tags-only update, sentinel error, GoDoc
- UpdateTags now updates only the tags field instead of all basic
  metadata (name, size, mimetype, path, parentID), per reviewer
  feedback that those are structural fields not metadata.
- Removed refreshMetadata helper that was over-reaching.
- Introduced ErrResourceNotFound sentinel in engine package so
  UpdateTags can distinguish "not indexed" (fallback to UpsertItem)
  from connectivity or other errors (log and stop).
- Added GoDoc example for the Update mutateFn callback.
- Added test for non-retriable error path.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-06 10:52:30 +01:00
Paul Faure
ee9b6f3007 refactor(search): replace Retrieve with Update, remove checksum guard
Address reviewer feedback:
- Remove checksum field from index (bloats index, not searched)
- Remove skipUnchangedContent guard (not needed with UpdateTags path)
- Replace engine.Retrieve() with engine.Update(id, mutateFn) that does
  get+mutate+set internally, avoiding public exposure of raw retrieval
- Simplify UpdateTags to use engine.Update() with mutation function

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-06 10:52:30 +01:00
Paul Faure
dd0d8fe923 refactor(search): extract storeExtractedMetadata to reduce UpsertItem complexity
Moves the metadata-storage block from UpsertItem into a dedicated helper
method to bring cognitive complexity below the SonarCloud threshold of 15.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-06 10:52:30 +01:00
Paul Faure
de7cc1670b refactor(search): extract skipUnchangedContent to reduce cognitive complexity
Move the checksum fast-path logic into a dedicated helper method to
bring UpsertItem below the SonarCloud cognitive complexity threshold
of 15.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-06 10:52:30 +01:00
Paul Faure
d7df509043 test(search): add coverage for checksum fast-path and UpdateTags
Add tests for:
- UpsertItem skips Tika when checksum unchanged
- UpsertItem runs Tika when checksum differs
- UpsertItem runs Tika when resource not yet indexed
- UpdateTags preserves Tika content when resource is indexed
- UpdateTags falls back to full UpsertItem when not indexed

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-06 10:52:30 +01:00
Paul Faure
eaa02c3d4d fix(search): skip Tika re-extraction when file content has not changed
Tag events (TagsAdded/TagsRemoved) previously called UpsertItem which
triggered a full Tika content extraction for metadata-only changes.
Additionally, UpsertItem's SetArbitraryMetadata writeback bumped the
mtime, causing IndexSpace to call UpsertItem again — running Tika
twice per file. On servers with large libraries this caused a
denial-of-service from runaway convert/tesseract processes.

Fix by:
- Adding UpdateTags() to the Searcher interface for tag-only updates
  that preserve existing Tika-extracted content
- Adding Retrieve() to the Engine interface to load indexed resources
- Comparing the content checksum (already computed by decomposedfs on
  upload) in UpsertItem to skip Tika and the metadata writeback when
  the blob has not been written to
- Extracting refreshMetadata() helper shared by both code paths

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-06 10:52:30 +01:00
Martin
f11c315607 Automated changelog update [skip ci] 2026-03-06 09:08:38 +00:00
Martin
1333fe7c13 Merge pull request #12078 from paul43210/fix/search-photo-case-sensitive
fix(search): use case-insensitive analyzer for photo metadata fields
2026-03-06 10:06:05 +01:00