{"id":21939183,"url":"https://github.com/grottopress/cryflare","last_synced_at":"2025-04-22T14:50:00.346Z","repository":{"id":85787831,"uuid":"320355350","full_name":"GrottoPress/cryflare","owner":"GrottoPress","description":"A low-level API client for Cloudflare® v4","archived":false,"fork":false,"pushed_at":"2024-08-15T17:39:28.000Z","size":128,"stargazers_count":9,"open_issues_count":1,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-08-15T19:50:06.898Z","etag":null,"topics":["api","cdn","cloudflare","crystal","dns","http-client","rest"],"latest_commit_sha":null,"homepage":"","language":"Crystal","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/GrottoPress.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-12-10T18:21:31.000Z","updated_at":"2024-08-15T17:39:31.000Z","dependencies_parsed_at":"2024-02-28T17:58:20.948Z","dependency_job_id":"59205a56-3967-49cc-b462-a7113340f427","html_url":"https://github.com/GrottoPress/cryflare","commit_stats":null,"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GrottoPress%2Fcryflare","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GrottoPress%2Fcryflare/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GrottoPress%2Fcryflare/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GrottoPress%2Fcryflare/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/GrottoPress","download_url":"https://codeload.github.com/GrottoPress/cryflare/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":227025005,"owners_count":17719205,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api","cdn","cloudflare","crystal","dns","http-client","rest"],"created_at":"2024-11-29T02:17:18.732Z","updated_at":"2024-11-29T02:17:19.462Z","avatar_url":"https://github.com/GrottoPress.png","language":"Crystal","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Cryflare\n\n*Cryflare* is a low-level API client for *Cloudflare\u0026reg;* v4. It features an intuitive interface that maps directly to the *Cloudflare* API.\n\n### Usage Examples\n\n```crystal\n# Create a new client\nclient = Cryflare.new(email: \"cloudflare-email\", key: \"cloudflare-api-key\")\n```\n\n1. Get zone by name\n   ```crystal\n   client.zones.list(name: \"grottopress.com\") do |response|\n     if response.success?\n       response.result.try \u0026.first?.try do |zone|\n         puts zone.id\n         puts zone.name\n         puts zone.owner.name\n         # ...\n       end\n     else\n       response.errors.each do |error|\n         puts error.code\n         puts error.message\n       end\n     end\n   end\n   ```\n\n1. Create new DNS record\n   ```crystal\n   client.dns_records.create(\n     \"zone-id\",\n     type: \"A\",\n     name: \"example.com\",\n     content: \"127.0.0.1\",\n     ttl: 120\n   ) do |response|\n     if response.success?\n       response.result.try do |dns_record|\n         puts dns_record.id\n         puts dns_record.name\n         puts dns_record.content\n         # ...\n       end\n     else\n       response.errors.each do |error|\n         puts error.code\n         puts error.message\n       end\n     end\n   end\n   ```\n\n1. Delete firewall rule\n   ```crystal\n   client.firewall_rules.delete(\"zone-id\", \"rule-id\") do |response|\n     if response.success?\n       response.result.try do |firewall_rule|\n         puts firewall_rule.id\n         # ...\n       end\n     else\n       response.errors.each do |error|\n         puts error.code\n         puts error.message\n       end\n     end\n   end\n   ```\n\n## Documentation\n\nFind the complete documentation in the `docs/` directory of this repository.\n\n## Todo\n\n- [x] Accounts\n- [x] Account members\n- [x] Account roles\n- [x] User\n- [ ] User memberships\n- [x] User organizations\n- [x] Zones\n- [x] Zone settings\n- [x] DNS records\n- [x] Cloudflare IPs\n- [x] User-level Firewall Access Rule\n- [x] Account-level Firewall access rule\n- [x] Firewall Access Rule for a Zone\n- [x] Filters\n- [x] Firewall rules\n- [ ] Page Rules for a Zone\n- [ ] Available Page Rules for a Zone\n\n## Development\n\nGenerate a token from your Cloudflare [account](https://dash.cloudflare.com/profile/api-tokens) that can read zones (`Zone:Read`).\n\nCreate a `.env.sh` file:\n\n```bash\n#!/bin/bash\n#\nexport CLOUDFLARE_TOKEN='your-cloudflare-token-here'\n\n```\n\nUpdate the file with your own details. Then run tests with `source .env.sh \u0026\u0026 crystal spec`.\n\n**IMPORTANT**: Remember to set permissions for your env file to `0600` or stricter: `chmod 0600 .env*`.\n\n## Contributing\n\n1. [Fork it](https://github.com/GrottoPress/cryflare/fork)\n1. Switch to the `master` branch: `git checkout master`\n1. Create your feature branch: `git checkout -b my-new-feature`\n1. Make your changes, updating changelog and documentation as appropriate.\n1. Commit your changes: `git commit`\n1. Push to the branch: `git push origin my-new-feature`\n1. Submit a new *Pull Request* against the `GrottoPress:master` branch.\n\n## Legal\n\n*Cloudflare is a registered trademark of Cloudflare, Inc.*\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgrottopress%2Fcryflare","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgrottopress%2Fcryflare","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgrottopress%2Fcryflare/lists"}