Skip to content
Merged
Show file tree
Hide file tree
Changes from 6 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: 1 addition & 1 deletion .github/workflows/build-pull.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:
inputs:
release_tag:
description: 'Test Build the RPM in pull request.'
required: false
required: true
default: ''

permissions:
Expand Down
3 changes: 3 additions & 0 deletions scripts/bootstrap_openchami.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ generate_environment_file() {
local short_name=$(hostname -s)
local dns_name=$(hostname -d)
local system_fqdn=$(hostname)

sed -i "s/^SYSTEM_NAME=.*/SYSTEM_NAME=${short_name}/" /etc/openchami/configs/openchami.env
sed -i "s/^SYSTEM_DOMAIN=.*/SYSTEM_DOMAIN=${dns_name}/" /etc/openchami/configs/openchami.env
sed -i "s/^SYSTEM_URL=.*/SYSTEM_URL=${system_fqdn}/" /etc/openchami/configs/openchami.env
Expand All @@ -40,10 +41,12 @@ generate_environment_file() {

acme_correction() {
local system_fqdn=$(hostname)
primary_ip=$(hostname -I | awk '{print $1}')
sed -i "s|-d .* \\\\|-d ${system_fqdn} \\\\|" /etc/containers/systemd/acme-deploy.container
sed -i "s/^ContainerName=.*/ContainerName=${system_fqdn}/" /etc/containers/systemd/acme-register.container
sed -i "s/^HostName=.*/HostName=${system_fqdn}/" /etc/containers/systemd/acme-register.container
sed -i "s|-d .* \\\\|-d ${system_fqdn} \\\\|" /etc/containers/systemd/acme-register.container
sed -i "s|--add-host='demo\.openchami\.cluster:[0-9\.]*'|--add-host='${system_fqdn}:${primary_ip}'|" /etc/containers/systemd/opaal.container
}

# Check and create secrets with random passwords if needed
Expand Down
8 changes: 8 additions & 0 deletions scripts/openchami-certificate-update
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ update_dns() {
local system_fqdn=$1
local short_name="${system_fqdn%%.*}"
local dns_name="${system_fqdn#*.}"
local primary_ip=$(hostname -I | awk '{print $1}')

# Update names in environment and acme containers
sed -i "s/^SYSTEM_NAME=.*/SYSTEM_NAME=${short_name}/" /etc/openchami/configs/openchami.env
Expand All @@ -18,10 +19,17 @@ update_dns() {
sed -i "s/^ContainerName=.*/ContainerName=${system_fqdn}/" /etc/containers/systemd/acme-register.container
sed -i "s/^HostName=.*/HostName=${system_fqdn}/" /etc/containers/systemd/acme-register.container
sed -i "s|-d .* \\\\|-d ${system_fqdn} \\\\|" /etc/containers/systemd/acme-register.container
sed -i "s|--add-host='demo\.openchami\.cluster:[0-9\.]*'|--add-host='${system_fqdn}:${primary_ip}'|" /etc/containers/systemd/opaal.container

# Reload systemD after .container changes
systemctl daemon-reload

# Re-apply Certificates
systemctl restart acme-deploy
systemctl restart haproxy

# Restart OpenCHAMI target to ensure all certificates are updated
systemctl restart openchami.target
}

help_page() {
Expand Down