https://github.com/sbz/cf-pr-toggle
https://github.com/sbz/cf-pr-toggle
cloudflare golang
Last synced: 14 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/sbz/cf-pr-toggle
- Owner: sbz
- Created: 2019-09-30T20:36:28.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2023-10-11T23:24:29.000Z (almost 2 years ago)
- Last Synced: 2025-03-11T16:23:59.155Z (4 months ago)
- Topics: cloudflare, golang
- Language: Go
- Homepage:
- Size: 16.6 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# cf-pr-toggle
[](https://travis-ci.org/sbz/cf-pr-toggle)
A *dead* simple [Golang][0] project tool in order to toggle my [Page Rules][1] on [Cloudflare][2].
Toggle means either `enable` or `disable` a given rule.
# Go dependencies
- [cloudflare/cloudflare-go](https://github.com/cloudflare/cloudflare-go)
- [setvargo/go-envconfig](https://github.com/sethvargo/go-envconfig)
- [smartystreets/goconvey](https://github.com/smartystreets/goconvey)# Building
```bash
go build
```# Testing
```bash
go test -v
```# Usage
You need to pass the 2 following variables to authenticate against the
Cloudflare API:```bash
$ export CLOUDFLARE_EMAIL= CLOUDFLARE_TOKEN=
$ ./cf-pr-toggle # list existing rules
$ ./cf-pr-toggle # toggle rule with id
```
[0]: https://go.dev/
[1]: https://www.cloudflare.com/features-page-rules
[2]: https://api.cloudflare.com/#page-rules-for-a-zone-edit-page-rule