-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
MIR-1320 MIR support for Solr authentication and Solr cloud (#1012)
* mir support for solr authentication and solr cloud * add tika server to wizard * allow admin and indexer to search and admin to index --------- Co-authored-by: Thomas Scheffler <[email protected]>
- Loading branch information
1 parent
703af95
commit 166ef63
Showing
21 changed files
with
528 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
upload local config set for main | ||
upload local config set for classification | ||
create collection for core main | ||
create collection for core classification |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,14 @@ | ||
MCR.Solr.ServerURL=http\://localhost\:${solr.port}/ | ||
MCR.Solr.DelayIndexing_inMS=200 | ||
|
||
MCR.Solr.Server.Auth.Admin.Class=org.mycore.solr.auth.MCRSolrBasicPropertyAuthentication | ||
MCR.Solr.Server.Auth.Admin.Password=alleswirdgut | ||
MCR.Solr.Server.Auth.Admin.Username=admin | ||
MCR.Solr.Server.Auth.Index.Class=org.mycore.solr.auth.MCRSolrBasicPropertyAuthentication | ||
MCR.Solr.Server.Auth.Index.Password=alleswirdgut | ||
MCR.Solr.Server.Auth.Index.Username=indexer | ||
MCR.Solr.Server.Auth.Search.Class=org.mycore.solr.auth.MCRSolrBasicPropertyAuthentication | ||
MCR.Solr.Server.Auth.Search.Password=alleswirdgut | ||
MCR.Solr.Server.Auth.Search.Username=searcher | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Submodule solr
deleted from
1f1a29
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
FROM solr:8.11 | ||
USER root | ||
RUN apt-get update && \ | ||
apt-get -y install sudo | ||
COPY --chown=root:root docker-entrypoint.sh ./ | ||
RUN chmod 555 docker-entrypoint.sh | ||
CMD ["bash", "docker-entrypoint.sh"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,108 @@ | ||
#!/usr/bin/bash | ||
# | ||
# This file is part of *** M y C o R e *** | ||
# See http://www.mycore.de/ for details. | ||
# | ||
# MyCoRe is free software: you can redistribute it and/or modify | ||
# it under the terms of the GNU General Public License as published by | ||
# the Free Software Foundation, either version 3 of the License, or | ||
# (at your option) any later version. | ||
# | ||
# MyCoRe is distributed in the hope that it will be useful, | ||
# but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
# GNU General Public License for more details. | ||
# | ||
# You should have received a copy of the GNU General Public License | ||
# along with MyCoRe. If not, see <http://www.gnu.org/licenses/>. | ||
# | ||
|
||
set -e | ||
unset SOLR_USER SOLR_UID SOLR_GROUP SOLR_GID \ | ||
SOLR_CLOSER_URL SOLR_DIST_URL SOLR_ARCHIVE_URL SOLR_DOWNLOAD_URL SOLR_DOWNLOAD_SERVER SOLR_KEYS SOLR_SHA512 | ||
|
||
function fixDirectoryRights() { | ||
find "$1" \! -user "$2" -exec chown "$2:$2" '{}' + | ||
} | ||
|
||
echo "Running solr entry script as user: $(whoami)" | ||
if [ "$(id -u)" -eq 0 ]; then | ||
fixDirectoryRights /var/solr/ solr | ||
exec /usr/bin/sudo -E -u solr "PATH=$PATH" "$(pwd)/$0"; | ||
exit 0; | ||
fi | ||
|
||
function solrpass() { | ||
printf "%s %s" "$(echo -n "$2$1"|openssl dgst -sha256 -binary|openssl dgst -sha256 -binary|openssl base64)" "$(echo -n "$2"|openssl base64)" | ||
} | ||
|
||
secruity_json=/var/solr/data/security.json; | ||
|
||
|
||
echo "{" > $secruity_json | ||
echo " \"authentication\":{" >> $secruity_json | ||
echo " \"blockUnknown\": true," >> $secruity_json | ||
echo " \"class\":\"solr.BasicAuthPlugin\"," >> $secruity_json | ||
echo " \"credentials\": {" >> $secruity_json | ||
|
||
if [ -n "$SOLR_SEARCH_USER" ]; then | ||
echo " \"${SOLR_SEARCH_USER}\":\"$(solrpass $SOLR_SEARCH_PASSWORD $(openssl rand 10))\"," >> $secruity_json | ||
fi | ||
|
||
if [ -n "$SOLR_INDEX_USER" ]; then | ||
echo " \"${SOLR_INDEX_USER}\":\"$(solrpass $SOLR_INDEX_PASSWORD $(openssl rand 10))\"," >> $secruity_json | ||
fi | ||
|
||
if [ -n "$SOLR_ADMIN_USER" ]; then | ||
echo " \"${SOLR_ADMIN_USER}\":\"$(solrpass $SOLR_ADMIN_PASSWORD $(openssl rand 10))\"" >> $secruity_json | ||
fi | ||
|
||
echo " }," >> $secruity_json | ||
echo " \"realm\":\"My Solr users\"," >> $secruity_json | ||
echo " \"forwardCredentials\": false" >> $secruity_json | ||
echo " }," >> $secruity_json | ||
echo " \"authorization\":{" >> $secruity_json | ||
echo " \"class\":\"solr.RuleBasedAuthorizationPlugin\"," >> $secruity_json | ||
echo " \"permissions\":[" >> $secruity_json | ||
|
||
if [ -n "$SOLR_SEARCH_USER" ]; then | ||
echo " {" >> $secruity_json | ||
echo " \"name\":\"read\"," >> $secruity_json | ||
echo " \"role\":[\"searcher\",\"indexer\",\"admin\"]" >> $secruity_json | ||
echo " }," >> $secruity_json | ||
fi | ||
|
||
if [ -n "$SOLR_INDEX_USER" ]; then | ||
echo " {" >> $secruity_json | ||
echo " \"name\":\"update\"," >> $secruity_json | ||
echo " \"role\":[\"indexer\",\"admin\"]" >> $secruity_json | ||
echo " }," >> $secruity_json | ||
fi | ||
|
||
if [ -n "$SOLR_ADMIN_USER" ]; then | ||
echo " {" >> $secruity_json | ||
echo " \"name\":\"all\"," >> $secruity_json | ||
echo " \"role\":\"admin\"" >> $secruity_json | ||
echo " }" >> $secruity_json | ||
fi | ||
echo "]," >> $secruity_json | ||
echo " \"user-role\":{" >> $secruity_json | ||
|
||
if [ -n "$SOLR_SEARCH_USER" ]; then | ||
echo " \"${SOLR_SEARCH_USER}\":\"searcher\"," >> $secruity_json | ||
fi | ||
|
||
if [ -n "$SOLR_INDEX_USER" ]; then | ||
echo " \"${SOLR_INDEX_USER}\":\"indexer\"," >> $secruity_json | ||
fi | ||
|
||
if [ -n "$SOLR_ADMIN_USER" ]; then | ||
echo " \"${SOLR_ADMIN_USER}\":\"admin\"" >> $secruity_json | ||
fi | ||
|
||
echo " }" >> $secruity_json | ||
echo " }" >> $secruity_json | ||
echo "}" >> $secruity_json | ||
|
||
(/opt/docker-solr/scripts/wait-for-solr.sh;/opt/solr/bin/solr zk cp $secruity_json zk:security.json -z localhost:9983)& | ||
/opt/docker-solr/scripts/solr-foreground -c; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
{ | ||
"authentication": { | ||
"blockUnknown": true, | ||
"class": "solr.BasicAuthPlugin", | ||
"credentials": { | ||
"searcher": "0QWhQdOGUMTkjxqE0rPodHKa2gUEnRZnZ837YP/L4aw= 7A==", | ||
"indexer": "0QWhQdOGUMTkjxqE0rPodHKa2gUEnRZnZ837YP/L4aw= 7A==", | ||
"admin": "0QWhQdOGUMTkjxqE0rPodHKa2gUEnRZnZ837YP/L4aw= 7A==" | ||
}, | ||
"realm": "My Solr users", | ||
"forwardCredentials": false | ||
}, | ||
"authorization": { | ||
"class": "solr.RuleBasedAuthorizationPlugin", | ||
"permissions": [ | ||
{ | ||
"name": "read", | ||
"role": [ | ||
"searcher", | ||
"indexer", | ||
"admin" | ||
] | ||
}, | ||
{ | ||
"name": "update", | ||
"role": [ | ||
"indexer", | ||
"admin" | ||
] | ||
}, | ||
{ | ||
"name": "all", | ||
"role": "admin" | ||
} | ||
], | ||
"user-role": { | ||
"searcher": "searcher", | ||
"indexer": "indexer", | ||
"admin": "admin" | ||
} | ||
} | ||
} |
Oops, something went wrong.