WSL/SLF GitLab Repository

init.sh 730 Bytes
Newer Older
Sam's avatar
Sam committed
1
2
3
4
5
6
7
#!/bin/sh

abort () {
    echo "$@" >&2
    exit 1
}

8
9
if [ -z "$SOLR_CKAN_PASS" ]; then
    abort "ERROR: Solr passwords not set in environment."
Sam's avatar
Sam committed
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
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"}}'