Skip to content

Commit e3eb866

Browse files
committed
allow disabling Ruleset
1 parent 34a2683 commit e3eb866

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ Freedom of information is an essential pillar of democracy and informed decision
3030
- [x] Disable logs
3131
- [x] No Tracking
3232
- [x] Limit the proxy to a list of domains
33+
- [x] Expose Ruleset to other ladders
3334
- [ ] Optional TOR proxy
3435
- [ ] A key to share only one URL
3536
- [ ] Fetch from Google Cache if not available
@@ -77,6 +78,10 @@ curl -X GET "http://localhost:8080/api/https://www.example.com"
7778
### RAW
7879
http://localhost:8080/raw/https://www.example.com
7980

81+
82+
### Running Ruleset
83+
http://localhost:8080/ruleset
84+
8085
## Configuration
8186

8287
### Environment Variables

handlers/ruleset.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,19 @@
11
package handlers
22

33
import (
4+
"os"
5+
46
"github.com/gofiber/fiber/v2"
57
"gopkg.in/yaml.v3"
68
)
79

810
func Ruleset(c *fiber.Ctx) error {
911

12+
if os.Getenv("EXPOSE_RULESET") == "false" {
13+
c.SendStatus(fiber.StatusForbidden)
14+
return c.SendString("Rules Disabled")
15+
}
16+
1017
body, err := yaml.Marshal(rulesSet)
1118
if err != nil {
1219
c.SendStatus(fiber.StatusInternalServerError)

0 commit comments

Comments
 (0)