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

keycloak server #11

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open

keycloak server #11

wants to merge 3 commits into from

Conversation

skanakal
Copy link
Contributor

Keycloak server

```
Confirm the action by typing `yes` when prompted.

# Important Notice
Copy link

Choose a reason for hiding this comment

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

IMO, it's better to use the WARNING.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is more of an Important Notice because it provides critical information about the intended use, lack of warranties, and the absence of official support. It doesn't explicitly warn of an immediate danger but clarifies important terms that users must be aware of before proceeding. so I believe, in its current form, "Important Notice" is the appropriate term....

Comment on lines 2 to 3
apt update -y
apt install -y docker*
Copy link

Choose a reason for hiding this comment

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

Why not use an openSUSE Leap VM?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Since the script is a sample for internal use, the choice between Ubuntu and openSUSE Leap may depend on what the individual is comfortable with.

Any more specific reasons why openSUSE Leap would be a better fit in this context or a dependency that Keycloak/rancher?

Copy link

Choose a reason for hiding this comment

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

Any more specific reasons why openSUSE Leap would be a better fit in this context or a dependency that Keycloak/rancher?

No specific reason at all other than the proverb eat your own dog food.

Comment on lines 22 to 24
mkdir -p /opt/keycloak/certs
cp certs/fullchain.pem /opt/keycloak/certs/
cp certs/key.pem /opt/keycloak/certs/
Copy link

Choose a reason for hiding this comment

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

Suggested change
mkdir -p /opt/keycloak/certs
cp certs/fullchain.pem /opt/keycloak/certs/
cp certs/key.pem /opt/keycloak/certs/
KEYCLOAK_CERTS=/opt/keycloak/certs
mkdir -p $KEYCLOAK_CERTS
cp certs/fullchain.pem $KEYCLOAK_CERTS
cp certs/key.pem $KEYCLOAK_CERTS

# terraform.tfvars

# AWS region to deploy the instance
region = "us-east-2"
Copy link

Choose a reason for hiding this comment

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

Since most of the team is based in India, could we use ap-south-1 for convenience?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I’ve included instructions in the README.md that guide users to customize the terraform.tfvars file with their specific AWS configurations, including the region. Just edit the terraform.tfvars file with the preferred region and other relevant settings.

end_time=$(( $(date +%s) + timeout ))

while [ $(date +%s) -lt $end_time ]; do
if curl -k -s -o /dev/null -w "%%{http_code}" -L https://${data.template_file.keycloak.vars.keycloak_server_name} | grep -q '^200$'; then
Copy link

Choose a reason for hiding this comment

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

A code comment explaining what this is doing would help everyone if something needs to be changed in future. Especially folks like me who aren't shell script experts.

variable "region" {
description = "AWS region"
type = string
default = "us-east-2"
Copy link

Choose a reason for hiding this comment

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

Same request about ap-south-1.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

removed a default region... so you need to set it up from tf.vars

Comment on lines 8 to 15
docker run -v $PWD/certs:/certs \
-e CA_SUBJECT="My own root CA" \
-e CA_EXPIRE="1825" \
-e SSL_EXPIRE="365" \
-e SSL_SUBJECT="${keycloak_server_name}" \
-e SSL_DNS="${keycloak_server_name}" \
-e SILENT="true" \
superseb/omgwtfssl
Copy link

@dharmit dharmit Aug 20, 2024

Choose a reason for hiding this comment

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

superseb/omgwtfssl was updated almost 6 years ago. Can we maybe create an image using it as base image and update it for CVEs and such?

EDIT: Just a simple apt/zypper/dnf update would suffice. However, if it's based on a container image that's no longer maintained, e.g. ubuntu 20.10, it might be better to find the Dockerfile and create our own image based on a openSUSE base, if possible, or simply use latest container of ubuntu/fedora whatever the original image is using.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I have updated the SSL creation process using Certbot.

@dharmit
Copy link

dharmit commented Sep 2, 2024

@skanakal thanks for the changes, and apologies for not being able to keep a tab on it. 👍🏽

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants