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 2 commits
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
8 changes: 8 additions & 0 deletions docs/docker.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Deploy Rems in docker
Copy link
Contributor

Choose a reason for hiding this comment

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

could mention this file in the Dockerfile

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added a mention to Dockerfile


1. Build rems with lein or copy rems.jar to target/uberjar/rems.jar
2. Build rems docker image. Use the docker file located in the root directory of rems git.
Example command: `docker build /path/to/rems/git/root/dir/ -t rems:tag`
2. Mount your config.edn file to /rems/config/config.edn in the container (Optional)
3. Mount certificate to be added to rems certificate store to /rems/certs/.
This process currecntly supports only one certificate. (Optional)