[Bug 42109] New: OAI additional configuration should be moved to the interface
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42109 Bug ID: 42109 Summary: OAI additional configuration should be moved to the interface Initiative type: --- Sponsorship --- status: Product: Koha Version: Main Hardware: All OS: All Status: NEW Severity: enhancement Priority: P5 - low Component: Architecture, internals, and plumbing Assignee: koha-bugs@lists.koha-community.org Reporter: nick@bywatersolutions.com QA Contact: testopia@bugs.koha-community.org Currently we set some extar variables in a file like: marcxml: metadataPrefix: marcxml metadataNamespace: http://www.loc.gov/MARC21/slim http://www.loc.gov/standards/marcxml/schema/MARC21slim schema: http://www.loc.gov/MARC21/slim http://www.loc.gov/standards/marcxml/schema/MARC21slim.xsd expanded_avs: 1 include_items: 1 These options should be configurable in the interface -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42109 Nick Clemens (kidclamp) <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|koha-bugs@lists.koha-commun |kyle@bywatersolutions.com |ity.org | -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42109 Kyle M Hall (khall) <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42109 --- Comment #1 from Kyle M Hall (khall) <kyle@bywatersolutions.com> --- Created attachment 196940 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=196940&action=edit Bug 42109: Replace OAI-PMH:ConfFile with OAI-PMH:ExtendedMode The OAI-PMH:ConfFile system preference requires a local file on the server's filesystem to configure extended OAI-PMH mode. This makes configuration less portable and requires server-level access to manage. This patch replaces it with OAI-PMH:ExtendedMode, a new system preference that stores the YAML configuration directly in the database. The database update reads the existing config file contents and migrates them into the new preference. Test Plan: 1) Create a conf file and point OAI-PMH:ConfFile at it 2) Apply this patch 3) Run updatedatabase.pl 4) Go to Administration > System preferences > Web services 5) Search for OAI-PMH:ExtendedMode 6) Note the preference is now a textarea with YAML syntax highlighting 7) If you previously had OAI-PMH:ConfFile set to a file path, note the file contents have been migrated into the new preference 8) prove t/db_dependent/OAI/Server.t 9) prove t/db_dependent/Koha/OAI/Server/Repository.t -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42109 Kyle M Hall (khall) <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #196940|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42109 --- Comment #2 from Kyle M Hall (khall) <kyle@bywatersolutions.com> --- Created attachment 196942 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=196942&action=edit Bug 42109: Replace OAI-PMH:ConfFile with OAI-PMH:ExtendedMode The OAI-PMH:ConfFile system preference requires a local file on the server's filesystem to configure extended OAI-PMH mode. This makes configuration less portable and requires server-level access to manage. This patch replaces it with OAI-PMH:ExtendedMode, a new system preference that stores the YAML configuration directly in the database. The database update reads the existing config file contents and migrates them into the new preference. Test Plan: 1) Create a conf file and point OAI-PMH:ConfFile at it 2) Apply this patch 3) Run updatedatabase.pl 4) Go to Administration > System preferences > Web services 5) Search for OAI-PMH:ExtendedMode 6) Note the preference is now a textarea with YAML syntax highlighting 7) If you previously had OAI-PMH:ConfFile set to a file path, note the file contents have been migrated into the new preference 8) prove t/db_dependent/OAI/Server.t 9) prove t/db_dependent/Koha/OAI/Server/Repository.t -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42109 Kyle M Hall (khall) <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #196942|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42109 --- Comment #3 from Kyle M Hall (khall) <kyle@bywatersolutions.com> --- Created attachment 197780 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=197780&action=edit Bug 42109: Replace OAI-PMH:ConfFile with OAI-PMH:ExtendedMode The OAI-PMH:ConfFile system preference requires a local file on the server's filesystem to configure extended OAI-PMH mode. This makes configuration less portable and requires server-level access to manage. This patch replaces it with OAI-PMH:ExtendedMode, a new system preference that stores the YAML configuration directly in the database. The database update reads the existing config file contents and migrates them into the new preference. Test Plan: 1) Create a conf file and point OAI-PMH:ConfFile at it 2) Apply this patch 3) Run updatedatabase.pl 4) Go to Administration > System preferences > Web services 5) Search for OAI-PMH:ExtendedMode 6) Note the preference is now a textarea with YAML syntax highlighting 7) If you previously had OAI-PMH:ConfFile set to a file path, note the file contents have been migrated into the new preference 8) prove t/db_dependent/OAI/Server.t 9) prove t/db_dependent/Koha/OAI/Server/Repository.t -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42109 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42109 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #197780|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42109 --- Comment #4 from David Nind <david@davidnind.com> --- Created attachment 197825 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=197825&action=edit Bug 42109: Replace OAI-PMH:ConfFile with OAI-PMH:ExtendedMode The OAI-PMH:ConfFile system preference requires a local file on the server's filesystem to configure extended OAI-PMH mode. This makes configuration less portable and requires server-level access to manage. This patch replaces it with OAI-PMH:ExtendedMode, a new system preference that stores the YAML configuration directly in the database. The database update reads the existing config file contents and migrates them into the new preference. Test Plan: 1) Create a conf file and point OAI-PMH:ConfFile at it 2) Apply this patch 3) Run updatedatabase.pl 4) Go to Administration > System preferences > Web services 5) Search for OAI-PMH:ExtendedMode 6) Note the preference is now a textarea with YAML syntax highlighting 7) If you previously had OAI-PMH:ConfFile set to a file path, note the file contents have been migrated into the new preference 8) prove t/db_dependent/OAI/Server.t 9) prove t/db_dependent/Koha/OAI/Server/Repository.t Signed-off-by: David Nind <david@davidnind.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42109 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Text to go in the| |This enhancement replaces release notes| |the OAI-PMH:ConfFile system | |preference with a new | |system preference | |OAI-PMH:ExtendedMode. | | | |Instead of having the | |additional configuration | |for OAI-PMH in a file on | |the server, the details can | |be directly added using the | |staff interface. | | | |Note: If you previously had | |the OAI-PMH:ConfFile system | |preference set to a file | |path, the file contents | |will be migrated into the | |new system preference. CC| |david@davidnind.com --- Comment #5 from David Nind <david@davidnind.com> --- Testing notes (using KTD): 1. Create a file and add the details from the bug description: - vi /etc/koha/sites/kohadev/oai.conf - paste in: marcxml: metadataPrefix: marcxml metadataNamespace: http://www.loc.gov/MARC21/slim http://www.loc.gov/standards/marcxml/schema/MARC21slim schema: http://www.loc.gov/MARC21/slim http://www.loc.gov/standards/marcxml/schema/MARC21slim.xsd expanded_avs: 1 include_items: 1 2. Update the OAI-PMH:ConfFile system preference with the file path: /etc/koha/sites/kohadev/oai.conf -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42109 David Cook <dcook@prosentient.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |dcook@prosentient.com.au --- Comment #6 from David Cook <dcook@prosentient.com.au> --- Overall, I think that sounds like a pretty good idea. My only hesitation is with the user specifying the xsl_file. I suppose that XSLT is executed using Koha::XSLT::Base which uses Koha::XSLT::Security so that's good. That said, depending on the errors returned by the process there might be the ability to indirectly disclose server information (xsl_file gets its existence validated if it's a file, so you could compare successful and unsuccessful times to figure out if certain files and directories exist), although I suppose that's a problem would exist with any XSLT system preference. -- I'm curious what files get used in practice in the wild. Usually for this kind of preference I'd use Cwd::abs_path($filename) to get the canonical pathname and make sure the base filepath matches one I've configured for that instance, so they can't traverse the system. It might be worthwhile having "base_xslt_paths" or something in koha-conf.xml or another configuration file. I imagine some people might include XSLTs in /etc/koha/sites/<instancename>/file.xsl, so could always do a mix of /etc/koha/sites/<instancename> and /usr/share/koha/opac/htdocs or something. Just a thought... -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org