Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rahti: add certificate to store #2146

Merged
merged 3 commits into from
Apr 29, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,5 @@ ENTRYPOINT ["./docker-entrypoint.sh"]
COPY empty-config.edn /rems/config/config.edn
COPY target/uberjar/rems.jar /rems/rems.jar
COPY docker-entrypoint.sh /rems/docker-entrypoint.sh

RUN chmod 664 /usr/local/openjdk-11/lib/security/cacerts
13 changes: 13 additions & 0 deletions docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,19 @@ cd rems

[ -z "$COMMANDS" ] && COMMANDS="run"

certfile=$(ls /rems/certs)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should this be documented somewhere?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.


if [ ! -z ${certfile} ] && [ "${certfile}" != "null" ] ; then
keytool -importcert -cacerts -noprompt \
-storepass changeit \
-file /rems/certs/${certfile} \
-alias ${certfile}

keytool -storepasswd -cacerts \
-storepass changeit \
-new $(head /dev/urandom | tr -dc A-Za-z0-9 | head -c 20)
fi

for COMMAND in $COMMANDS
do
if [ "${COMMAND}" = "run" ] ; then
Expand Down