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

chore(dev): use JAVA_HOME instead of hardcoded path #1351

Merged
merged 1 commit into from
Feb 2, 2023

Conversation

andrewazores
Copy link
Member

@andrewazores andrewazores commented Feb 1, 2023

Signed-off-by: Andrew Azores aazores@redhat.com

Welcome to Cryostat! 👋

Before contributing, make sure you have:

  • Read the contributing guidelines
  • Linked a relevant issue which this PR resolves
  • Linked any other relevant issues, PR's, or documentation, if any
  • Resolved all conflicts, if any
  • Rebased your branch PR on top of the latest upstream main branch
  • Attached at least one of the following labels to the PR: [chore, ci, docs, feat, fix, test]
  • Signed the last commit: git commit --amend --signoff

Fixes #1353

Description of the change:

Replaces a hardcoded path (assumes JDK11 installed in a Fedora-like location) with $JAVA_HOME

Signed-off-by: Andrew Azores <aazores@redhat.com>
@mergify mergify bot added the safe-to-test label Feb 1, 2023
@andrewazores andrewazores added the chore Refactor, rename, cleanup, etc. label Feb 1, 2023
@github-actions
Copy link
Contributor

github-actions bot commented Feb 1, 2023

Test image available:

$ CRYOSTAT_IMAGE=ghcr.io/cryostatio/cryostat:pr-1351-3d65a41ca36ee6b58cdfeb6900aecfe2b14d8124 sh smoketest.sh

Copy link
Member

@tthvo tthvo left a comment

Choose a reason for hiding this comment

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

Looks good to me! I think I havent used this script before. What is its use case?

@andrewazores
Copy link
Member Author

sh certs/generate-dev-certs.sh generate can be used to create a self-signed SSL certificate. The run.sh (or smoketest.sh which also invokes run.sh) script checks for these outputs and if they are found, configures the Cryostat container to use that certificate. When you go to https://localhost:8181 you'll be presented with a warning from your browser saying that the SSL cert could not be verified because it's self-signed, or something like that, and you can choose to add an exception and ignore the warning. Every subsequent run of smoketest.sh/run.sh will present the same SSL cert. This is a little bit closer to a real production setup where everything communicates with trusted SSL certs, as opposed to using unencrypted HTTP. You can do sh certs/generate-dev-certs.sh clean to undo all this.

@andrewazores andrewazores merged commit a01a6d0 into cryostatio:main Feb 2, 2023
@andrewazores andrewazores deleted the cert-generate-java-home branch February 2, 2023 01:57
@tthvo
Copy link
Member

tthvo commented Feb 2, 2023

Make sense to me! Thanks! I suppose if I don't generate these certs using this script, Cryostat will do it themselves somewhere in entrypoint.sh?

@andrewazores
Copy link
Member Author

Yup:

https://github.com/cryostatio/cryostat/blob/a01a6d07d55c9614aff699411d3e6956a4de115c/src/main/extras/app/entrypoint.bash#L72

This cert is generated at runtime and doesn't get persisted anywhere permanent, so it would be a different cert each time you re-run run.sh (or otherwise start a Cryostat container).

@tthvo
Copy link
Member

tthvo commented Feb 2, 2023

Ahh okayy! Thanks for explaining :D

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
chore Refactor, rename, cleanup, etc. safe-to-test
Projects
No open projects
Status: Done
Development

Successfully merging this pull request may close these issues.

[Bug] certs/generate-dev-certs.sh assumes /usr/lib/jvm/java-11-openjdk
2 participants