Migrate examples to tests_e2e directory structure
- Relocated all files and scripts from `examples` to `tests_e2e` for better organization. - Updated references and paths in configurations, scripts, and test files. - Adjusted `bump-version.sh` to handle the new `tests_e2e` structure. - Updated `.gitignore` to reflect path changes.
This commit is contained in:
parent
b34d7822e4
commit
d66c4f8595
51 changed files with 35 additions and 35 deletions
76
tests_e2e/static/docker-compose.yml
Normal file
76
tests_e2e/static/docker-compose.yml
Normal file
|
|
@ -0,0 +1,76 @@
|
|||
# ==============================================================================
|
||||
# EXAMPLE: Static Configuration Mode
|
||||
# ==============================================================================
|
||||
#
|
||||
# WHAT THIS DEMONSTRATES:
|
||||
# - EasyHAProxy using static YAML configuration (no service discovery)
|
||||
# - Useful for non-containerized backends, VMs, or bare metal servers
|
||||
# - Configuration via /etc/haproxy/static/config.yml
|
||||
#
|
||||
# REQUIREMENTS (run these first):
|
||||
# ```bash
|
||||
# # Generate SSL certificates
|
||||
# cd ../.. && ./tests_e2e/generate-keys.sh && cd tests_e2e/static
|
||||
#
|
||||
# # Add to /etc/hosts (idempotent)
|
||||
# grep -q "host1.local" /etc/hosts || echo "127.0.0.1 host1.local" | sudo tee -a /etc/hosts
|
||||
#
|
||||
# # Copy a configuration file (choose one):
|
||||
# cp conf/config-basic.yml conf/config.yml # Basic HTTP→HTTPS redirect
|
||||
# # OR
|
||||
# cp conf/config-certbot.yml conf/config.yml # Let's Encrypt (requires public domain)
|
||||
# # OR
|
||||
# cp conf/config-deny-pages.yml conf/config.yml # Block specific paths
|
||||
# # OR
|
||||
# cp conf/config-jwt-validator.yml conf/config.yml # JWT authentication
|
||||
# ```
|
||||
#
|
||||
# HOW TO START:
|
||||
# ```bash
|
||||
# # Start backend container
|
||||
# docker run -d --name container -p 8080:8080 byjg/static-httpserver
|
||||
#
|
||||
# # Start EasyHAProxy
|
||||
# docker compose up -d
|
||||
# ```
|
||||
#
|
||||
# HOW TO VERIFY IT'S WORKING:
|
||||
# ```bash
|
||||
# # Test HTTPS
|
||||
# curl -k -H "Host: host1.local" https://127.0.0.1/
|
||||
# # Expected: 200 OK with "Hello from Static HTTP Server!"
|
||||
#
|
||||
# # Test HTTP redirect (if using basic config)
|
||||
# curl -I -H "Host: host1.local" http://127.0.0.1
|
||||
# # Expected: HTTP/1.1 301 Moved Permanently
|
||||
#
|
||||
# # View HAProxy stats
|
||||
# # URL: http://localhost:1936
|
||||
# # Username: admin
|
||||
# # Password: password
|
||||
# ```
|
||||
#
|
||||
# CLEAN UP:
|
||||
# ```bash
|
||||
# docker compose down
|
||||
# docker stop container && docker rm container
|
||||
# ```
|
||||
#
|
||||
# ==============================================================================
|
||||
|
||||
services:
|
||||
haproxy:
|
||||
image: byjg/easy-haproxy:5.0.0
|
||||
volumes:
|
||||
- ./conf/:/etc/haproxy/static/
|
||||
- ./host1.local.pem:/certs/haproxy/host1.local.pem
|
||||
- /var/run/docker.sock:/var/run/docker.sock
|
||||
environment:
|
||||
EASYHAPROXY_DISCOVER: static
|
||||
ports:
|
||||
- "80:80/tcp"
|
||||
- "443:443/tcp"
|
||||
- "1936:1936/tcp"
|
||||
|
||||
container:
|
||||
image: byjg/static-httpserver
|
||||
Loading…
Add table
Add a link
Reference in a new issue