A Python web application that accepts HTTP POST requests to /services/<ID> endpoints, processes them according to YAML configuration, and forwards them to configured Glue.ai endpoints.
- RESTful API endpoint for webhook processing
- YAML-based configuration mapping service IDs to Glue configurations
- Docker containerization for easy deployment
- DevContainer support for development
- Automated CI/CD pipeline with GitHub Actions
- Health check endpoint for monitoring
- Structured logging and error handling
- Open the project in VS Code
- Click "Reopen in Container" when prompted
- The development environment will be set up automatically
- Run the application:
python app.py
# Install dependencies
pip install -r requirements.txt
# Run the application with default config (config.yml)
python app.py
# Run with a different config file (e.g., for development)
CONFIG_FILE=dev-config.yml python app.py
# Run with debug mode and custom config
DEBUG=true CONFIG_FILE=dev-config.yml python app.pyThe service will be available at http://localhost:8080
# Start the service (builds image if needed)
docker compose up -d
# View logs
docker compose logs -f
# Stop the service
docker compose down
# Rebuild after code changes
docker compose up -d --buildTo customize the configuration:
- Copy
config.yml-exampletoconfig.yml - Edit
config.ymlwith your service configurations - The compose file automatically mounts
config.ymlinto the container - Restart the service:
docker compose restart
For development with a separate config:
- Uncomment the
dev-config.ymlvolume mount indocker-compose.yml - Set
CONFIG_FILE=dev-config.ymlin the environment section - Restart:
docker compose up -d
# Build the image
docker build -t slack-to-glue-webhook .
# Run the container (you must mount your config.yml file)
docker run -p 8080:8080 \
-v /path/to/your/config.yml:/app/config.yml \
slack-to-glue-webhook
# Or run with a custom config file name
docker run -p 8080:8080 \
-v /path/to/your/dev-config.yml:/app/dev-config.yml \
-e CONFIG_FILE=dev-config.yml \
slack-to-glue-webhookNote: The Docker image does not include config.yml - you must mount your own config file at runtime. An example configuration is included as config.yml-example in the container for reference.
Processes a webhook for the specified service ID.
Request:
- Content-Type:
application/json - Body: JSON payload from the source webhook
Response:
{
"status": "success|warning|error",
"message": "Description of the result",
"response_code": 200
}Health check endpoint for monitoring.
Response:
{
"status": "healthy",
"service": "slack-to-glue-webhook"
}The service uses a YAML configuration file (config.yml) to map service IDs to their corresponding Glue configurations:
services:
example-service:
target: "grp_xxxxxxxxxxxxxxxxxxxxx" # Glue group/thread ID
webhook_url: "https://api.gluegroups.com/webhook/wbh_xxxxx/xxxxx"
description: "Example service for testing"
# Global configuration (optional)
global:
timeout_seconds: 30
retry_attempts: 3
log_level: "INFO"Service Configuration:
target: The Glue.ai group or thread identifier (e.g.,grp_xxxxxxxxxxxxxxxxxxxxx)webhook_url: The Glue webhook endpoint URL to forward processed webhooksdescription: Optional description of the service
Global Configuration (optional):
timeout_seconds: Request timeout in seconds (default: 30)retry_attempts: Number of retry attempts for failed requests (default: 3)log_level: Logging level - INFO, DEBUG, WARNING, ERROR (default: INFO)
PORT: Server port (default: 8080)DEBUG: Enable debug mode (default: false)CONFIG_FILE: Path to configuration file (default: config.yml)
The project includes a GitHub Actions workflow that automatically builds and publishes Docker images to GitHub Container Registry on pushes to main/master branches.
- Build the Docker image:
docker build -t slack-to-glue-webhook . - Push to your registry:
docker push your-registry/slack-to-glue-webhook - Deploy using your preferred container orchestration platform
├── app.py # Main Flask application
├── config.yml # Service configuration
├── config.yml-example # Example configuration file
├── requirements.txt # Python dependencies
├── Dockerfile # Docker build configuration
├── docker-compose.yml # Docker Compose configuration
├── .devcontainer/ # VS Code DevContainer setup
│ └── devcontainer.json
└── .github/workflows/ # CI/CD pipeline
└── docker-build-deploy.yml
- Add a new entry to
config.ymlunder theservicessection - Restart the application to load the new configuration
- Send POST requests to
/services/<your-new-service-id>
See LICENSE file for details.