Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/sbz/cf-pr-toggle
https://github.com/sbz/cf-pr-toggle
cloudflare golang
Last synced: about 5 hours ago
JSON representation
- Host: GitHub
- URL: https://github.com/sbz/cf-pr-toggle
- Owner: sbz
- Created: 2019-09-30T20:36:28.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2023-10-11T23:24:29.000Z (about 1 year ago)
- Last Synced: 2024-06-19T17:53:20.807Z (5 months ago)
- Topics: cloudflare, golang
- Language: Go
- Homepage:
- Size: 16.6 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# cf-pr-toggle
[![Build Status](https://api.travis-ci.org/sbz/cf-pr-toggle.svg?branch=master)](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