Skip to content

feat(deploy): sync cubemaster custom ports with .env config#210

Merged
fslongjin merged 1 commit into
TencentCloud:masterfrom
luzhixing12345:fix-install
May 14, 2026
Merged

feat(deploy): sync cubemaster custom ports with .env config#210
fslongjin merged 1 commit into
TencentCloud:masterfrom
luzhixing12345:fix-install

Conversation

@luzhixing12345
Copy link
Copy Markdown
Contributor

Related to #172

Problem

During self-build deployment, users may change CUBE_SANDBOX_MYSQL_PORT or CUBE_SANDBOX_REDIS_PORT to avoid host port conflicts. However, CubeMaster still uses the default hardcoded addresses (127.0.0.1:3306 and 127.0.0.1:6379) from the static config file, causing service startup failures.

As a result, CubeMaster cannot connect to MySQL during initialization and the one-click installation fails.

Solution

This PR patches the generated CubeMaster config during installation and synchronizes the MySQL/Redis addresses with the values provided in the one-click environment configuration.

Comment thread deploy/one-click/install.sh Outdated
:
}

patch_cubemaster_config_ports() {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

patch? We should generate conf.yaml on the fly instead.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

for now the script just simply copy the file

copy_file "${ROOT_DIR}/configs/single-node/cubemaster.yaml" "${PACKAGE_ROOT}/CubeMaster/conf.yaml"

How can we generate a YAML file based on the configuration? Is it necessary to introduce a new YAML parsing tool (such as yq)?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I think the cubemaster.yaml should contain port placeholder and perform a replace before copying.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Modified, use__CUBE_SANDBOX_MYSQL_PORT__and__CUBE_SANDBOX_REDIS_PORT__ placeholders in cubemaster.yaml

Use`__CUBE_SANDBOX_MYSQL_PORT__`and`__CUBE_SANDBOX_REDIS_PORT__`
placeholders in cubemaster.yaml

Signed-off-by: luzhixing12345 <luzhixing12345@163.com>
@fslongjin
Copy link
Copy Markdown
Member

Thanks @luzhixing12345 for the great contribution! This fix nicely addresses the custom port sync issue during self-build deployment. Appreciate the detailed problem description and clean implementation. 🎉

@fslongjin fslongjin merged commit 264dd86 into TencentCloud:master May 14, 2026
3 of 5 checks passed
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.

3 participants