Skip to content

Open source, composable payments platform | PCI compliant | SaaS and Self-host options | Enables connectivity to multiple payment, payout, fraud, vault and tokenization providers | Uplifts authorization with intelligent routing and revenue recovery | Reduce payment processing costs with cost observability | Reduces payment ops with reconciliation

fix: fixes the docker setup to clean up the scarf data (#7963)

GORAKHNATH YADAV4cbe2e46453b
diff --git a/README.md b/README.md
index 3033263e57..fd211f3355 100644
--- a/README.md
+++ b/README.md
@@ -42,11 +42,12 @@ Single API to access the payments ecosystem and its features
1. [Introduction](#introduction)
2. [Try Hyperswitch](#try-hyperswitch)
-3. [Architectural Overview](#architectural-overview)
-4. [Support, Feature requests & Bugs](#support-feature-requests)
-5. [Our Vision](#our-vision)
-6. [Versioning](#versioning)
-7. [Copyright and License](#copyright-and-license)
+3. [Architectural Overview](#architectural-overview)
+4. [Community & Contributions](#community-and-contributions)
+5. [Feature requests & Bugs](#feature-requests)
+6. [Our Vision](#our-vision)
+7. [Versioning](#versioning)
+8. [Copyright and License](#copyright-and-license)
<a href="#introduction">
<h2 id="introduction">Introduction</h2>
@@ -141,11 +142,17 @@ You can experience the product by signing up for our [hosted sandbox](https://ap
[configure-a-connector]: https://docs.hyperswitch.io/hyperswitch-open-source/account-setup/using-hyperswitch-control-center#add-a-payment-processor
[try-a-payment]: https://docs.hyperswitch.io/hyperswitch-open-source/account-setup/test-a-payment
-<a href="support-feature-requests">
- <h2 id="support-feature-requests">Support, Feature requests & Bugs</h2>
+<a href="community-and-contributions">
+ <h2 id="community-and-contributions">Community & Contributions</h2>
</a>
-For any support, join the conversation in [Slack](https://join.slack.com/t/hyperswitch-io/shared_invite/zt-2jqxmpsbm-WXUENx022HjNEy~Ark7Orw)
+If you have any questions, feel free to drop them in our [Slack community](https://join.slack.com/t/hyperswitch-io/shared_invite/zt-2jqxmpsbm-WXUENx022HjNEy~Ark7Orw).
+
+We welcome contributors from around the world to help build Hyperswitch. To get started, please read our [contribution guidelines](contributing-guidelines).
+
+<a href="feature-requests">
+ <h2 id="feature-requests">Feature requests & Bugs</h2>
+</a>
For new product features, enhancements, roadmap discussions, or to share queries and ideas, visit our [GitHub Discussions](https://github.com/juspay/hyperswitch/discussions)
diff --git a/docker-compose-development.yml b/docker-compose-development.yml
index 10b67da2ad..539bf47fd4 100644
--- a/docker-compose-development.yml
+++ b/docker-compose-development.yml
@@ -323,8 +323,9 @@ services:
ports:
- "9000:9000"
environment:
- apiBaseUrl: http://localhost:8080
- sdkBaseUrl: http://localhost:9050/HyperLoader.js
+ - configPath=/tmp/dashboard-config.toml
+ volumes:
+ - ./config/dashboard.toml:/tmp/dashboard-config.toml
hyperswitch-web-sdk:
build:
diff --git a/docker-compose.yml b/docker-compose.yml
index cc58c38e88..0683734e83 100644
--- a/docker-compose.yml
+++ b/docker-compose.yml
@@ -56,7 +56,11 @@ services:
migration_runner:
image: rust:latest
- command: "bash -c 'cargo install diesel_cli --no-default-features --features postgres && cargo install just && just migrate'"
+ command: >
+ bash -c "
+ curl -fsSL https://raw.githubusercontent.com/cargo-bins/cargo-binstall/main/install-from-binstall-release.sh | bash &&
+ cargo binstall diesel_cli just --no-confirm &&
+ just migrate"
working_dir: /app
networks:
- router_net
@@ -65,11 +69,13 @@ services:
environment:
# format -> postgresql://DB_USER:DB_PASSWORD@HOST:PORT/DATABASE_NAME
- DATABASE_URL=postgresql://db_user:db_pass@pg:5432/hyperswitch_db
-
+
mailhog:
image: mailhog/mailhog
networks:
- router_net
+ profiles:
+ - full_setup
ports:
- "1025:1025"
- "8025:8025"
@@ -91,6 +97,8 @@ services:
condition: service_healthy
redis-standalone:
condition: service_healthy
+ migration_runner:
+ condition: service_completed_successfully
labels:
logs: "promtail"
healthcheck:
@@ -454,11 +462,13 @@ services:
- "5252:5252"
networks:
- router_net
+ profiles:
+ - full_setup
depends_on:
hyperswitch-server:
condition: service_healthy
hyperswitch-web:
- condition: service_healthy
+ condition: service_started
environment:
- HYPERSWITCH_PUBLISHABLE_KEY=placeholder_publishable_key
- HYPERSWITCH_SECRET_KEY=placeholder_api_key
diff --git a/scripts/docker_output.sh b/scripts/docker_output.sh
deleted file mode 100755
index 80d178ca75..0000000000
--- a/scripts/docker_output.sh
+++ /dev/null
@@ -1,33 +0,0 @@
-#! /usr/bin/env bash
-set -euo pipefail
-
-# Define the URL to check service availability (adjust HOST and PORT if needed)
-HOST="localhost"
-PORT="8080"
-SERVICE_URL="http://${HOST}:${PORT}/health"
-
-MAX_RETRIES=70
-RETRY_COUNT=0
-
-# Wait until the service is available or retries are exhausted
-while ! curl --silent --fail "${SERVICE_URL}" > /dev/null; do
- if (( RETRY_COUNT >= MAX_RETRIES )); then
- echo ""
- echo "Service failed to start. Kindly check the logs."
- echo "You can view the logs using the command: docker-compose logs -f <service name>"
- exit 1
- fi
- printf "."
- sleep 2
- ((RETRY_COUNT++))
-done
-
-# Define ANSI 24-bit (true color) escape sequences for Light Sky Blue
-LIGHT_SKY_BLUE="\033[38;2;135;206;250m"
-RESET="\033[0m"
-
-# Print the service URLs with only the links colored
-echo -e "Control Centre running at ${LIGHT_SKY_BLUE}http://localhost:9000${RESET}"
-echo -e "App server running at ${LIGHT_SKY_BLUE}http://localhost:8080${RESET}"
-echo -e "Web-SDK running at ${LIGHT_SKY_BLUE}http://localhost:5252/HyperLoader.js${RESET}"
-echo -e "Mailhog running at ${LIGHT_SKY_BLUE}http://localhost:8025${RESET}"
\ No newline at end of file
diff --git a/scripts/poststart_hook.sh b/scripts/poststart_hook.sh
index d1fa6a0109..3f8dd34a7f 100755
--- a/scripts/poststart_hook.sh
+++ b/scripts/poststart_hook.sh
@@ -44,9 +44,9 @@ if [[ "$(echo "${HEALTH_RESPONSE}" | jq --raw-output '.error')" != 'null' ]]; th
CURL_COMMAND+=(
"--data-urlencode" "status=${STATUS}"
- "--data-urlencode" "error_type=${ERROR_TYPE}"
- "--data-urlencode" "error_message=${ERROR_MESSAGE}"
- "--data-urlencode" "error_code=${ERROR_CODE}"
+ "--data-urlencode" "error_type='${ERROR_TYPE}'"
+ "--data-urlencode" "error_message='${ERROR_MESSAGE}'"
+ "--data-urlencode" "error_code='${ERROR_CODE}'"
)
else
STATUS="success"
diff --git a/scripts/setup.sh b/scripts/setup.sh
index c40c5365c9..79aa509731 100755
--- a/scripts/setup.sh
+++ b/scripts/setup.sh
@@ -60,13 +60,16 @@ detect_docker_compose() {
if command -v docker &> /dev/null; then
CONTAINER_ENGINE="docker"
echo_success "Docker is installed."
+ echo ""
elif command -v podman &> /dev/null; then
CONTAINER_ENGINE="podman"
echo_success "Podman is installed."
+ echo ""
else
echo_error "Neither Docker nor Podman is installed. Please install one of them to proceed."
echo_info "Visit https://docs.docker.com/get-docker/ or https://podman.io/docs/installation for installation instructions."
echo_info "After installation, re-run this script: scripts/setup.sh"
+ echo ""
exit 1
fi
@@ -74,14 +77,19 @@ detect_docker_compose() {
if $CONTAINER_ENGINE compose version &> /dev/null; then
DOCKER_COMPOSE="$CONTAINER_ENGINE compose"
echo_success "Compose is installed for $CONTAINER_ENGINE."
+ echo ""
else
echo_error "Compose is not installed for $CONTAINER_ENGINE. Please install $CONTAINER_ENGINE compose to proceed."
+ echo ""
if [ "$CONTAINER_ENGINE" = "docker" ]; then
echo_info "Visit https://docs.docker.com/compose/install/ for installation instructions."
+ echo ""
elif [ "$CONTAINER_ENGINE" = "podman" ]; then
echo_info "Visit https://podman-desktop.io/docs/compose/setting-up-compose for installation instructions."
+ echo ""
fi
echo_info "After installation, re-run this script: scripts/setup.sh"
+ echo ""
exit 1
fi
}
@@ -90,9 +98,11 @@ check_prerequisites() {
# Check curl
if ! command -v curl &> /dev/null; then
echo_error "curl is not installed. Please install curl to proceed."
+ echo ""
exit 1
fi
echo_success "curl is installed."
+ echo ""
# Check ports
required_ports=(8080 9000 9050 5432 6379 9060)
@@ -109,6 +119,7 @@ check_prerequisites() {
fi
else
echo_warning "Neither nc nor lsof available to check ports. Skipping port check."
+ echo ""
break
fi
done
@@ -116,13 +127,16 @@ check_prerequisites() {
if [ ${#unavailable_ports[@]} -ne 0 ]; then
echo_warning "The following ports are already in use: ${unavailable_ports[*]}"
echo_warning "This might cause conflicts with Hyperswitch services."
- read -p "Do you want to continue anyway? (y/n): " -n 1 -r
+ echo ""
+ echo -n "Do you want to continue anyway? (y/n): "
+ read -n 1 -r REPLY
echo
if [[ ! $REPLY =~ ^[Yy]$ ]]; then
exit 1
fi
else
echo_success "All required ports are available."
+ echo ""
fi
}
@@ -136,14 +150,20 @@ setup_config() {
select_profile() {
echo ""
echo "Select a setup option:"
- echo -e "1) Standard Setup: ${BLUE}[Recommended]${NC} Ideal for quick trial. Services included: ${BLUE}App Server, Control Center, Unified Checkout, PostgreSQL and Redis${NC}"
- echo -e "2) Full Stack Setup: Ideal for comprehensive end-to-end payment testing. Services included: ${BLUE}Everything in Standard, Monitoring and Scheduler${NC}"
- echo -e "3) Standalone App Server: Ideal for API-first integration testing. Services included: ${BLUE}App server, PostgreSQL and Redis)${NC}"
+ echo -e "1) ${YELLOW}Standard Setup${NC}: ${BLUE}[Recommended]${NC} Ideal for quick trial."
+ echo -e " Services included: ${BLUE}App Server, Control Center, Unified Checkout, PostgreSQL and Redis${NC}"
+ echo ""
+ echo -e "2) ${YELLOW}Full Stack Setup${NC}: Ideal for comprehensive end-to-end payment testing."
+ echo -e " Services included: ${BLUE}Everything in Standard, Monitoring and Scheduler${NC}"
+ echo ""
+ echo -e "3) ${YELLOW}Standalone App Server${NC}: Ideal for API-first integration testing."
+ echo -e " Services included: ${BLUE}App server, PostgreSQL and Redis)${NC}"
echo ""
local profile_selected=false
while [ "$profile_selected" = false ]; do
- read -p "Enter your choice (1-3): " profile_choice
- profile_choice=${profile_choice:-1}
+ echo -n "Enter your choice (1-3): "
+ read -n 1 profile_choice
+ echo
case $profile_choice in
1)
@@ -177,7 +197,7 @@ start_services() {
$DOCKER_COMPOSE up -d
;;
full)
- $DOCKER_COMPOSE --profile scheduler --profile monitoring --profile olap up -d
+ $DOCKER_COMPOSE --profile scheduler --profile monitoring --profile olap --profile full_setup up -d
;;
esac
}
@@ -190,7 +210,6 @@ check_services_health() {
while [ $RETRIES -lt $MAX_RETRIES ]; do
if curl --silent --head --request GET 'http://localhost:8080/health' | grep "200 OK" > /dev/null; then
- echo_success "Hyperswitch server is healthy!"
print_access_info # Call print_access_info only when the server is healthy
return
fi
@@ -228,7 +247,22 @@ print_access_info() {
echo -e " • ${GREEN}${BOLD}Monitoring (Grafana)${NC}: ${BLUE}${BOLD}http://localhost:3000${NC}"
fi
echo ""
- echo_info "To stop all services, run: $DOCKER_COMPOSE down"
+
+ # Provide the stop command based on the selected profile
+ echo_info "To stop all services, run the following command:"
+ case $PROFILE in
+ standalone)
+ echo -e "${BLUE}$DOCKER_COMPOSE down${NC}"
+ ;;
+ standard)
+ echo -e "${BLUE}$DOCKER_COMPOSE down${NC}"
+ ;;
+ full)
+ echo -e "${BLUE}$DOCKER_COMPOSE --profile scheduler --profile monitoring --profile olap --profile full_setup down${NC}"
+ ;;
+ esac
+ echo ""
+ echo -e "Reach out to us on ${BLUE}https://hyperswitch-io.slack.com${NC} in case you face any issues."
}
# Main execution flow