diff --git a/README.md b/README.md index 032a56c..e324c76 100644 --- a/README.md +++ b/README.md @@ -106,7 +106,7 @@ http://localhost:8080/ruleset | `LOG_URLS` | Log fetched URL's | `true` | | `DISABLE_FORM` | Disables URL Form Frontpage | `false` | | `FORM_PATH` | Path to custom Form HTML | `` | -| `RULESET` | URL to a ruleset file | `https://raw.githubusercontent.com/everywall/ladder/main/ruleset.yaml` or `/path/to/my/rules.yaml` | +| `RULESET` | Path or URL to a ruleset file, accepts local directories | `https://raw.githubusercontent.com/everywall/ladder/main/ruleset.yaml` or `/path/to/my/rules.yaml` or `/path/to/my/rules/` | | `EXPOSE_RULESET` | Make your Ruleset available to other ladders | `true` | | `ALLOWED_DOMAINS` | Comma separated list of allowed domains. Empty = no limitations | `` | | `ALLOWED_DOMAINS_RULESET` | Allow Domains from Ruleset. false = no limitations | `false` | @@ -176,6 +176,7 @@ See in [ruleset.yaml](ruleset.yaml) for an example. To run a development server at http://localhost:8080: ```bash +echo "dev" > handlers/VERSION RULESET="./ruleset.yaml" go run cmd/main.go ``` diff --git a/docker-compose.yaml b/docker-compose.yaml index 125b92e..6325d09 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -9,10 +9,11 @@ services: environment: - PORT=8080 - RULESET=/app/ruleset.yaml + #- ALLOWED_DOMAINS=example.com,example.org #- ALLOWED_DOMAINS_RULESET=false #- EXPOSE_RULESET=true #- PREFORK=false - #- DISABLE_FORM=fase + #- DISABLE_FORM=false #- FORM_PATH=/app/form.html #- X_FORWARDED_FOR=66.249.66.1 #- USER_AGENT=Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html) diff --git a/handlers/proxy.go b/handlers/proxy.go index b6e6a1e..128314e 100644 --- a/handlers/proxy.go +++ b/handlers/proxy.go @@ -107,9 +107,9 @@ func ProxySite(rulesetPath string) fiber.Handler { return c.SendString(err.Error()) } - c.Cookie(&fiber.Cookie{}) - c.Set("Content-Type", resp.Header.Get("Content-Type")) - c.Set("Content-Security-Policy", resp.Header.Get("Content-Security-Policy")) + c.Cookie(&fiber.Cookie{}) + c.Set("Content-Type", resp.Header.Get("Content-Type")) + c.Set("Content-Security-Policy", resp.Header.Get("Content-Security-Policy")) return c.SendString(body) }