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

[Accelerator 4] Configuring different super admins for each server #250

Merged
merged 2 commits into from
Jan 7, 2025
Merged
Show file tree
Hide file tree
Changes from all 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
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,13 @@ Function Set-Hostnames {
Find-Replace $DEPLOYMENT_TOML_FILE "IS_HOSTNAME" "$( $PROPERTIES.'IS_HOSTNAME' )"
}

# A function to replace the admin credentials in the temp deployment.toml with their actual values from configure.properties
Function Set-AdminCredentials {
Find-Replace $DEPLOYMENT_TOML_FILE "APIM_ADMIN_USERNAME" "$( $PROPERTIES.'APIM_ADMIN_USERNAME' )"
Find-Replace $DEPLOYMENT_TOML_FILE "APIM_ADMIN_PASSWORD" "$( $PROPERTIES.'APIM_ADMIN_PASSWORD' )"
Find-Replace $DEPLOYMENT_TOML_FILE "APIM_ADMIN_NAME" "$( $PROPERTIES.'APIM_ADMIN_NAME' )"
}

# A utility function to create a database.
Function Add-Database {
param ([string]$DB_USER, [string]$DB_PASS, [string]$DB_HOST, [string]$DB_NAME)
Expand Down Expand Up @@ -224,6 +231,11 @@ Write-Output "[INFO] Configuring the hostnames..."
Set-Hostnames
Write-Output "[INFO] Hostnames configurations completed!"

Write-Output "============================================"
Write-Output "[INFO] Configuring the admin credentials..."
Set-AdminCredentials
Write-Output "[INFO] Admin credentials configurations completed!"

Write-Output "============================================"
Write-Output "[INFO] Configuring the datasources..."
Set-Datasources
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,12 @@ echo -e "================================================\n"
sed -i -e 's|APIM_HOSTNAME|'${APIM_HOSTNAME}'|g' ${DEPLOYMENT_TOML_FILE}
sed -i -e 's|IS_HOSTNAME|'${IS_HOSTNAME}'|g' ${DEPLOYMENT_TOML_FILE}

echo -e "\nReplace admin credentials \n"
echo -e "================================================\n"
sed -i -e 's|APIM_ADMIN_USERNAME|'${APIM_ADMIN_USERNAME}'|g' ${DEPLOYMENT_TOML_FILE}
sed -i -e 's|APIM_ADMIN_PASSWORD|'${APIM_ADMIN_PASSWORD}'|g' ${DEPLOYMENT_TOML_FILE}
sed -i -e 's|APIM_ADMIN_NAME|'${APIM_ADMIN_NAME}'|g' ${DEPLOYMENT_TOML_FILE}

echo -e "\nConfigure datasources \n"
echo -e "================================================\n"
configure_datasources;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,11 @@ APIM_HOSTNAME=localhost
IS_HOSTNAME=localhost
BI_HOSTNAME=localhost

# Specify the super admin credentials you want to configure
[email protected]
APIM_ADMIN_PASSWORD=wso2123
APIM_ADMIN_NAME=am_admin

# Specify the deployment.toml file containing the required configurations based on the APIM version being used
# As an example if APIM 4.3.0 version is used change the file name to wso2am-4.3.0-deployment.toml in the same file path
PRODUCT_CONF_PATH=repository/resources/wso2am-4.4.0-deployment.toml
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ base_path = "${carbon.protocol}://${carbon.host}:${carbon.management.port}"
server_role = "default"

[super_admin]
username = "[email protected]"
password = "wso2123"
username = "APIM_ADMIN_USERNAME"
password = "APIM_ADMIN_PASSWORD"
create_admin_account = true

[tenant_mgt]
Expand Down Expand Up @@ -270,7 +270,7 @@ username = "$ref{super_admin.username}@carbon.super"

[apim.throttling.jms]
password = "$ref{super_admin.password}"
username = "admin!wso2.com!carbon.super"
username = "APIM_ADMIN_NAME!wso2.com!carbon.super"
#start_delay = "5m"

#[apim.throttling.event_sync]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,12 @@ Function Set-Hostnames {
Find-Replace $DEPLOYMENT_TOML_FILE "BI_HOSTNAME" "$( $PROPERTIES.'BI_HOSTNAME' )"
}

# A function to replace the admin credentials in the temp deployment.toml with their actual values from configure.properties
Function Set-AdminCredentials {
Find-Replace $DEPLOYMENT_TOML_FILE "IS_ADMIN_USERNAME" "$( $PROPERTIES.'IS_ADMIN_USERNAME' )"
Find-Replace $DEPLOYMENT_TOML_FILE "IS_ADMIN_PASSWORD" "$( $PROPERTIES.'IS_ADMIN_PASSWORD' )"
}

# A utility function to create a database.
Function Add-Database {
param ([string]$DB_USER, [string]$DB_PASS, [string]$DB_HOST, [string]$DB_NAME)
Expand Down Expand Up @@ -200,6 +206,11 @@ Write-Output "[INFO] Configuring the hostnames..."
Set-Hostnames
Write-Output "[INFO] Hostnames configurations completed!"

Write-Output "============================================"
Write-Output "[INFO] Configuring the admin credentials..."
Set-AdminCredentials
Write-Output "[INFO] Admin credentials configurations completed!"

Write-Output "============================================"
Write-Output "[INFO] Configuring the datasources..."
Set-Datasources
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,10 @@ echo -e "================================================\n"
sed -i -e 's|IS_HOSTNAME|'${IS_HOSTNAME}'|g' ${DEPLOYMENT_TOML_FILE}
sed -i -e 's|APIM_HOSTNAME|'${APIM_HOSTNAME}'|g' ${DEPLOYMENT_TOML_FILE}

echo -e "\nReplace admin credentials \n"
echo -e "================================================\n"
sed -i -e 's|IS_ADMIN_USERNAME|'${IS_ADMIN_USERNAME}'|g' ${DEPLOYMENT_TOML_FILE}
sed -i -e 's|IS_ADMIN_PASSWORD|'${IS_ADMIN_PASSWORD}'|g' ${DEPLOYMENT_TOML_FILE}

echo -e "\nConfigure datasources \n"
echo -e "================================================\n"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
</Validation>
<AdminHandler>org.wso2.financial.services.accelerator.consent.mgt.extensions.admin.impl.DefaultConsentAdminHandler</AdminHandler>
<ConsentAPICredentials>
<Username>admin@wso2.com</Username>
<Username>is_admin@wso2.com</Username>
<Password>wso2123</Password>
</ConsentAPICredentials>
<Payments>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@
{% if financial_services.consent.api_credentials.username is defined %}
<Username>{{financial_services.consent.api_credentials.username}}</Username>
{% else %}
<Username>admin@wso2.com</Username>
<Username>is_admin@wso2.com</Username>
{% endif %}
{% if financial_services.consent.api_credentials.password is defined %}
<Password>{{financial_services.consent.api_credentials.password}}</Password>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ APIM_HOSTNAME=localhost
BI_HOSTNAME=localhost
IS_PRODUCT=wso2is-7.0.0

# Specify the super admin credentials you want to configure
[email protected]
IS_ADMIN_PASSWORD=wso2123

# Specify the deployment.toml file containing the required configurations based on the IS version being used
# As an example if IS 7.0.0 version is used change the file name to wso2is-7.0.0-deployment.toml in the same file path
PRODUCT_CONF_PATH=repository/resources/wso2is-7.0.0-deployment.toml
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ enable_email_domain = true

#================configs related to user-mgt.xml=============
[super_admin]
username = "[email protected]"
password = "wso2123"
username = "IS_ADMIN_USERNAME"
password = "IS_ADMIN_PASSWORD"
create_admin_account = true

[realm_manager]
Expand Down
Loading