You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tika.apache.org by "dschmidt (via GitHub)" <gi...@apache.org> on 2026/10/21 12:04:21 UTC
[PR] TIKA-4988: Activate catalog presets from the command line and environment (TIKA_PRESETS) [tika]
dschmidt opened a new pull request, #3383:
URL: https://github.com/apache/tika/pull/3383
A catalog preset could only be activated through the config file (`"presets": {"thumbnail": true}` plus `-c`), so the Docker image needed a mounted file for a single boolean. tika-server now takes `--preset <name>`, repeatable, and the environment variable `TIKA_PRESETS` as a comma-separated list; either is the equivalent of `"<name>": true` and never defines preset content.
The names go through `ConfigOverrides`/`ConfigMerger` into the `presets` object of the startup config, once for the front end's `TikaLoader` (which builds the `PresetRegistry` the preset routes check) and once in `createServerConfig` for the forks, so the workers keep receiving the resolved config over stdin and never read the environment. A name the config file already has keeps the file's value, including `false`; a name the catalog does not know fails startup as before. The startup log names the source of each activation.
Tests: `ConfigMergerTest` (merge semantics), `TikaServerConfigTest` (option and env parsing, deduplication), and `PresetActivationIntegrationTest`, which starts the real server with `--preset` and with `TIKA_PRESETS` against a test catalog entry and checks the preset route end to end, plus the unknown-name startup failure. `IntegrationTestBase` can now pass environment variables to the server process.
Docs: server page (presets section, options table), Docker page, CHANGES. tika-grpc has no preset routes; tika-app is out of scope.
https://issues.apache.org/jira/browse/TIKA-4988
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: dev-unsubscribe@tika.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] TIKA-4988: Activate catalog presets from the command line and environment (TIKA_PRESETS) [tika]
Posted by "tballison (via GitHub)" <gi...@apache.org>.
tballison commented on PR #3383:
URL: https://github.com/apache/tika/pull/3383#issuecomment-6316575366
Thank you @dschmidt !
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: dev-unsubscribe@tika.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] TIKA-4988: Activate catalog presets from the command line and environment (TIKA_PRESETS) [tika]
Posted by "tballison (via GitHub)" <gi...@apache.org>.
tballison merged PR #3383:
URL: https://github.com/apache/tika/pull/3383
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: dev-unsubscribe@tika.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] TIKA-4988: Activate catalog presets from the command line and environment (TIKA_PRESETS) [tika]
Posted by "tballison (via GitHub)" <gi...@apache.org>.
tballison commented on PR #3383:
URL: https://github.com/apache/tika/pull/3383#issuecomment-6315897708
Couple of nits from my :robot: I don't agree with the bot's choice of overrides. I think commandline should be allowed to override the config.json as long as the logging is clear that that is what is happening.
I didn't look closely, does this PR throw if a requested preset doesn't exist?
```
Maintainer decision
- Should the CLI/env override an inline definition? The second commit (aee135edd5) makes --preset X / TIKA_PRESETS=X replace the file's entry with
true, including an inline object. Two consequences:
- Silent: say the file defines its own thumbnail object and TIKA_PRESETS=thumbnail is set, e.g. baked into a derived image or Helm values. The
operator's content is quietly swapped for the catalog's. The log line says "activated by", not "replaced".
- Confusing: naming a preset that exists only inline (--preset mine) fails startup with "true activates a catalog preset…", a true the user never
wrote.
I'd recommend: an object entry in the file wins, or fail startup on that conflict. A false/null/absent entry becomes true, which keeps "the CLI
wins over false". Either way the docs and testPresetsOverrideTheConfigsOwnEntries change.
Edge cases
1. /async doesn't see CLI/env presets. TikaServerProcess.java:552 builds AsyncResource(tikaServerConfig.getConfigPath()) from the raw file, and the
tuple deserializer accepts a preset field. So --preset thumbnail plus an /async tuple with preset=thumbnail gets PRESET_NOT_FOUND, which
contradicts "the same as "name": true". Fix it by feeding /async the merged config, or document that /async only reads the file.
2. A malformed presets value is now silently accepted. If the file has "presets": "thumbnail" or an array, startup used to fail ("must be an
object"). With any --preset, getOrCreateObject overwrites it with an object instead. Throw in ConfigMerger when presets exists and isn't an
object.
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: dev-unsubscribe@tika.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] TIKA-4988: Activate catalog presets from the command line and environment (TIKA_PRESETS) [tika]
Posted by "dschmidt (via GitHub)" <gi...@apache.org>.
dschmidt commented on PR #3383:
URL: https://github.com/apache/tika/pull/3383#issuecomment-6316611410
You're very welcome, hope to finally land the integration in OpenCloud soon :)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: dev-unsubscribe@tika.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org