mirror of
https://github.com/versity/versitygw.git
synced 2026-07-02 16:54:25 +00:00
1625c5963e
Enhances the static website hosting implementation with more complete S3-compatible behavior across request handling, backend storage, validation, CORS, and errors. Adds dedicated website endpoint handling for GET, HEAD, and OPTIONS requests, including index document resolution, error document serving, redirect-all support, pre-fetch and post-error routing rules, query string preservation in redirects, public access checks before object reads, and method-not-allowed responses. Improves error handling for website responses by returning S3-compatible HTML error bodies with request IDs, host IDs, x-amz-error-code, x-amz-error-message, and specialized error fields. This also fixes website-related validation errors to return more accurate S3-style error codes and messages, including invalid redirect protocols, invalid HTTP redirect/error codes, conflicting routing rule replacements, routing rule limits, and oversized website configuration requests. Adds website CORS support for GET, HEAD, and OPTIONS preflight requests, including bucket CORS lookup through website host bucket resolution, allowed origin/method/header validation, exposed header handling, ETag exposure, Vary headers, max-age handling, and CORS access-denied responses. Adds debug logging around website configuration parsing, validation failures, CORS checks, backend lookup failures, and internal website error paths to make failures easier to diagnose. Adds compressed website configuration storage so larger configs fit backend metadata limits, including gzip storage for POSIX extended attributes and base64-encoded compressed metadata for Azure. Also adds Azure PutBucketWebsite, GetBucketWebsite, and DeleteBucketWebsite support. Adds and expands test coverage for website config validation, S3-compatible HTML error bodies, website routing behavior, public access enforcement, HEAD behavior, CORS handling, PutBucketWebsite limits, and end-to-end website hosting through a Docker-based dnsmasq test setup and CI workflow.
59 lines
1.5 KiB
YAML
59 lines
1.5 KiB
YAML
services:
|
|
dnsmasq:
|
|
image: strm/dnsmasq
|
|
container_name: website-dns-resolver
|
|
restart: on-failure
|
|
volumes:
|
|
- './dnsmasq.conf:/etc/dnsmasq.conf'
|
|
cap_add:
|
|
- NET_ADMIN
|
|
healthcheck:
|
|
test: 'if [ -z "$(netstat -nltu |grep \:53)" ]; then exit 1;else exit 0;fi'
|
|
interval: 2s
|
|
timeout: 2s
|
|
retries: 20
|
|
networks:
|
|
devnet:
|
|
ipv4_address: 10.89.0.53
|
|
|
|
server:
|
|
build:
|
|
context: ../..
|
|
dockerfile: tests/host-style-tests/Dockerfile
|
|
depends_on:
|
|
dnsmasq:
|
|
condition: service_healthy
|
|
command: ["-a", "user", "-s", "pass", "--health", "/health", "--iam-dir", "/tmp/vgw", "--website", ":8080", "--website-domain", "dev", "--website-no-tls", "posix", "/tmp/vgw"]
|
|
dns:
|
|
- 10.89.0.53
|
|
healthcheck:
|
|
test: ["CMD", "wget", "-qO-", "http://127.0.0.1:7070/health"]
|
|
interval: 2s
|
|
timeout: 2s
|
|
retries: 20
|
|
networks:
|
|
devnet:
|
|
ipv4_address: 10.89.0.10
|
|
|
|
test:
|
|
build:
|
|
context: ../..
|
|
dockerfile: tests/host-style-tests/Dockerfile
|
|
depends_on:
|
|
server:
|
|
condition: service_healthy
|
|
dnsmasq:
|
|
condition: service_healthy
|
|
command: ["test", "-a", "user", "-s", "pass", "-e", "http://10.89.0.10:7070", "website-hosting", "--scheme", "http", "--domain", "dev", "--port", "8080"]
|
|
dns:
|
|
- 10.89.0.53
|
|
networks:
|
|
devnet:
|
|
|
|
networks:
|
|
devnet:
|
|
driver: bridge
|
|
ipam:
|
|
config:
|
|
- subnet: 10.89.0.0/16
|