WSL/SLF GitLab Repository

Commit f83fce34 authored by Sam's avatar Sam
Browse files

add solr init container...

to change passwords and create non-admin user
parent 5e9db930
ARG EXTERNAL_REG
FROM ${EXTERNAL_REG}/bash:5.1.12
ARG MAINTAINER
LABEL maintainer="${MAINTAINER}"
RUN apk add --no-cache curl
COPY init.sh /
RUN chmod +x /init.sh
ENTRYPOINT ["/init.sh"]
\ No newline at end of file
#!/bin/sh
abort () {
echo "$@" >&2
exit 1
}
if [ -f "/run/secrets/solr_creds" ]; then
echo "Found solr credentials secret, sourcing..."
. "/run/secrets/solr_creds"
else
abort "ERROR: Solr credentials secret not found."
fi
echo "Sleeping 5 seconds."
sleep 5;
curl --user solr:SolrRocks \
http://solr:8983/solr/admin/authentication \
-H 'Content-type:application/json' \
-d '{"set-user": {"solr" : "'"${SOLR_ADMIN_PASS}"'" }}'
curl --user "solr:${SOLR_ADMIN_PASS}" \
http://solr:8983/solr/admin/authentication \
-H 'Content-type:application/json' \
-d '{"set-user": {"ckan":"'"${SOLR_CKAN_PASS}"'"}}'
curl --user "solr:${SOLR_ADMIN_PASS}" \
http://solr:8983/solr/admin/authorization \
-H 'Content-type:application/json' \
-d '{"set-user-role" : {"ckan": "basic"}}'
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment