Refactor E2E tests and configuration format
- Replaced `easymapping` configuration with `containers` for better maintainability and clarity. - Introduced `DockerComposeFixture` class in `utils.py` to manage Docker Compose lifecycle and smart build strategy. - Enhanced YAML-to-environment variable conversion in `ContainerEnv` for dynamic configuration support. - Updated HAProxy configurations and test fixtures to reflect the new format. - Improved test coverage for YAML parsing, environment variable handling, and HAProxy config generation.
This commit is contained in:
parent
c125985150
commit
97845b8a52
22 changed files with 1042 additions and 442 deletions
|
|
@ -33,46 +33,39 @@ plugins:
|
|||
- /config
|
||||
status_code: 404 # Hide existence of these paths
|
||||
|
||||
easymapping:
|
||||
- port: 80
|
||||
hosts:
|
||||
# Domain 1: Uses global deny_pages configuration
|
||||
host1.local:
|
||||
containers:
|
||||
- webapp1:8080
|
||||
# No plugins specified = uses global configuration
|
||||
containers:
|
||||
# Domain 1: Uses global deny_pages configuration
|
||||
"host1.local:80":
|
||||
ip: ["webapp1:8080"]
|
||||
# No plugins specified = uses global configuration
|
||||
|
||||
# Domain 2: WordPress site with custom blocked paths
|
||||
host2.local:
|
||||
containers:
|
||||
- wordpress:80
|
||||
# Override global plugin configuration for this domain
|
||||
plugins:
|
||||
- deny_pages
|
||||
plugin_config:
|
||||
deny_pages:
|
||||
paths:
|
||||
- /wp-admin
|
||||
- /wp-login.php
|
||||
- /xmlrpc.php
|
||||
- /wp-config.php
|
||||
status_code: 403 # Return forbidden instead of 404
|
||||
# Domain 2: WordPress site with custom blocked paths
|
||||
"host2.local:80":
|
||||
ip: ["wordpress:80"]
|
||||
# Override global plugin configuration for this domain
|
||||
plugins: [deny_pages]
|
||||
plugin:
|
||||
deny_pages:
|
||||
paths:
|
||||
- /wp-admin
|
||||
- /wp-login.php
|
||||
- /xmlrpc.php
|
||||
- /wp-config.php
|
||||
status_code: 403 # Return forbidden instead of 404
|
||||
|
||||
# Domain 3: Public site with stricter blocking
|
||||
host3.local:
|
||||
containers:
|
||||
- publicsite:3000
|
||||
plugins:
|
||||
- deny_pages
|
||||
plugin_config:
|
||||
deny_pages:
|
||||
paths:
|
||||
- /admin
|
||||
- /administrator
|
||||
- /manager
|
||||
- /phpmyadmin
|
||||
- /.git
|
||||
- /.env
|
||||
- /config
|
||||
- /backup
|
||||
status_code: 404
|
||||
# Domain 3: Public site with stricter blocking
|
||||
"host3.local:80":
|
||||
ip: ["publicsite:3000"]
|
||||
plugins: [deny_pages]
|
||||
plugin:
|
||||
deny_pages:
|
||||
paths:
|
||||
- /admin
|
||||
- /administrator
|
||||
- /manager
|
||||
- /phpmyadmin
|
||||
- /.git
|
||||
- /.env
|
||||
- /config
|
||||
- /backup
|
||||
status_code: 404
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue