HoustonPutman commented on code in PR #5287:
URL: https://github.com/apache/solr/pull/5287#discussion_r4517525914
##########
solr/core/src/java/org/apache/solr/handler/configsets/UploadConfigSet.java:
##########
@@ -125,48 +148,184 @@ public SolrJerseyResponse uploadConfigSet(
} finally {
Files.deleteIfExists(tempZip);
}
- deleteUnusedFiles(configSetService, configSetName, filesToDelete);
+ }
- return response;
+ private void uploadFromRepository(
+ String configSetName,
+ String repositoryName,
+ String requestedLocation,
+ List<String> filesToDelete)
+ throws IOException {
+ try (BackupRepository repository =
coreContainer.newBackupRepository(repositoryName)) {
+ final String location = resolveRepositoryLocation(repository,
requestedLocation);
+ final URI source = repository.createDirectoryURI(location);
+ if (!repository.exists(source)) {
+ throw new SolrException(
+ SolrException.ErrorCode.BAD_REQUEST,
+ "The location " + source + " does not exist in the backup
repository");
Review Comment:
> * If it's not just me and folks feel like there are some valid security
concerns here, maybe a solr.xml setting or sysprop to gate the use of these
parameters would help? i.e.
`<allowBackupRepoConfigsetUpload>true</allowBackupRepoConfigsetUpload>`
I like this idea, but maybe as an option for the backup repo itself.
`<allowConfigSetUpload>`
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]