allow disabling Ruleset
This commit is contained in:
@@ -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
|
||||
@@ -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
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user