Skip to content

Commit

Permalink
allow disabling Ruleset
Browse files Browse the repository at this point in the history
  • Loading branch information
mms-gianni committed Nov 5, 2023
1 parent 34a2683 commit e3eb866
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ Freedom of information is an essential pillar of democracy and informed decision
- [x] Disable logs
- [x] No Tracking
- [x] Limit the proxy to a list of domains
- [x] Expose Ruleset to other ladders
- [ ] Optional TOR proxy
- [ ] A key to share only one URL
- [ ] Fetch from Google Cache if not available
Expand Down Expand Up @@ -77,6 +78,10 @@ curl -X GET "http://localhost:8080/api/https://www.example.com"
### RAW
http://localhost:8080/raw/https://www.example.com


### Running Ruleset
http://localhost:8080/ruleset

## Configuration

### Environment Variables
Expand Down
7 changes: 7 additions & 0 deletions handlers/ruleset.go
Original file line number Diff line number Diff line change
@@ -1,12 +1,19 @@
package handlers

import (
"os"

"github.com/gofiber/fiber/v2"
"gopkg.in/yaml.v3"
)

func Ruleset(c *fiber.Ctx) error {

if os.Getenv("EXPOSE_RULESET") == "false" {
c.SendStatus(fiber.StatusForbidden)
return c.SendString("Rules Disabled")
}

body, err := yaml.Marshal(rulesSet)
if err != nil {
c.SendStatus(fiber.StatusInternalServerError)
Expand Down

0 comments on commit e3eb866

Please sign in to comment.