Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/snick512/cloudflare
A Cloudflare Zone management tool.
https://github.com/snick512/cloudflare
api bash c cli cloudflare dns manager zones
Last synced: 26 days ago
JSON representation
A Cloudflare Zone management tool.
- Host: GitHub
- URL: https://github.com/snick512/cloudflare
- Owner: snick512
- License: unlicense
- Created: 2024-11-25T20:06:52.000Z (3 months ago)
- Default Branch: main
- Last Pushed: 2025-01-03T15:27:37.000Z (about 2 months ago)
- Last Synced: 2025-01-03T16:39:01.086Z (about 2 months ago)
- Topics: api, bash, c, cli, cloudflare, dns, manager, zones
- Language: C
- Homepage: https://silentport.net
- Size: 51.8 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- Funding: .github/FUNDING.yml
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# Cloudflare Zone Management tool
A Cloudflare tool to manage the basics of zones using their direct API. An AI experiment.It accepts 1 line commands, and outputs JSON as the result.
The .sh is for a simple, terminal based interface style, and remains open until terminated.
# Contributions
Contributions welcome!
See [Contributing](CONTRIBUTING.md), and [Style Guide](STYLE_GUIDE.md)# Screenshots

# Running and Compiling
config.txt
```ini
API_KEY=apikey
EMAIL=email
```Setup on Ubuntu 20.04, required (or will be):
`libcurl4-openssl-dev libcjson-dev````bash
gcc -o cloudflare base.c -lcurl -lcjson
gcc -o map zone.c -lcurl -lcjson
``````bash
chmod +x cloudflare map cloudflare.sh
```## Running
`zone_map.txt` references Zone/Record IDs.To store record IDs:
```bash
./map list_zones
```To retrieve IDs:
```bash
$ ./map display_record wiki.wvpirates.org
Domain/Subdomain: wiki.wvpirates.org
Zone ID: x
Record ID: x
Proxied: 1
IP: x
$
```
## The .sh
cloudflare.sh is a (right now) simple, persisting way to add/delete records.
```bash
./cloudflare.sh
```## cloudflare (bin)
You may use the binary directly:
- List zones:
`./cloudflare list_zones`
- Add/update a DNS record:
`./cloudflare add_update_record A example.com 192.0.2.1 3600 1`
- Delete a DNS record:
`./cloudflare delete_record `
- Purge cache:
`./cloudflare purge_cache `# API Token permissions
[Creating an API Token](https://developers.cloudflare.com/fundamentals/api/get-started/create-token/)```
Zone: Read (for listing zones)
DNS: Read (for reading DNS records)
DNS: Edit (for updating or adding DNS records)
Zone: Settings (if you need to modify zone settings, like enabling/disabling proxying)
```
### Ideas:
- Map Zone IDs to domains automatically.