From f519b02045e9ca902f529504d1d3ca19798c1256 Mon Sep 17 00:00:00 2001 From: david-hummingbot <85695272+david-hummingbot@users.noreply.github.com> Date: Tue, 29 Jul 2025 06:50:35 +0800 Subject: [PATCH] update setup.sh - modified the setup script so that if users change the default admin username / password for hummingbot api it will also change the fields in the docker compose file as well. --- setup.sh | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/setup.sh b/setup.sh index 77f2eb8..164c140 100644 --- a/setup.sh +++ b/setup.sh @@ -111,6 +111,26 @@ EOF echo -e "${GREEN}✅ .env file created successfully!${NC}" echo "" +# Update docker-compose.yml with new credentials +echo -e "${GREEN}🔧 Updating docker-compose.yml with new credentials...${NC}" + +# Update BACKEND_API_USERNAME and BACKEND_API_PASSWORD in docker-compose.yml +if [ -f "docker-compose.yml" ]; then + # Create a backup of the original file + cp docker-compose.yml docker-compose.yml.backup + + # Update the credentials using sed + sed -i "s/BACKEND_API_USERNAME=.*/BACKEND_API_USERNAME=$USERNAME/" docker-compose.yml + sed -i "s/BACKEND_API_PASSWORD=.*/BACKEND_API_PASSWORD=$PASSWORD/" docker-compose.yml + + echo -e "${GREEN}✅ docker-compose.yml updated successfully!${NC}" + echo -e "${BLUE}📋 Updated credentials:${NC} Username: $USERNAME, Password: $PASSWORD" +else + echo -e "${YELLOW}⚠️ Warning: docker-compose.yml not found in current directory${NC}" +fi + +echo "" + # Display configuration summary echo -e "${BLUE}📋 Configuration Summary${NC}" echo "======================="