|
| 1 | +# g0v.network domains |
| 2 | + |
| 3 | +For automating management of the `g0v.network` domain via config files. |
| 4 | + |
| 5 | +Changing or adding DNS records in `main` branach of this repository with update |
| 6 | +the actual domain records. |
| 7 | + |
| 8 | +Inspired by [`g0v/domain`][g0v/domain] |
| 9 | + |
| 10 | + [g0v/domain]: https://github.com/g0v/domain |
| 11 | + |
| 12 | +**Note:** Work in progress. Not yet functional. |
| 13 | + |
| 14 | +## Technologies Used |
| 15 | + |
| 16 | +- [**octoDNS.**][octodns] |
| 17 | + |
| 18 | + [octodns]: https://github.com/octodns/octodns |
| 19 | + |
| 20 | +## Usage |
| 21 | + |
| 22 | +The intended way to use this repository is via pull request directly on GitHub. |
| 23 | + |
| 24 | +(You should only need to clone this code locally in order to improve the |
| 25 | +automation part of this repository. See Development section.) |
| 26 | + |
| 27 | +### Create a new subdomain |
| 28 | + |
| 29 | +Create a new YAML file, and fill it out. For example, to create |
| 30 | +`my.example.g0v.network`, you'd create a config file with the full subdomain |
| 31 | +name, with a key inside it for `my.example`. Like so (click through the link to |
| 32 | +see example): |
| 33 | + |
| 34 | +[`g0v.network./my.example.g0v.network.yaml`][new-subdomain] |
| 35 | + |
| 36 | + [new-subdomain]: https://github.com/g0v-network/domains/new/main?filename=g0v.network./my.example.g0v.network.yaml&value=my.example%3A%0A%20%20-%20type%3A%20A%0A%20%20%20%20value%3A%0A%20%20%20%20%20%20-%20123.45.67.89 |
| 37 | + |
| 38 | +### Delete an existing subdomain |
| 39 | + |
| 40 | +Delete a file or a specific record type within a file. Our automation will sync this deletion when it runs. |
| 41 | + |
| 42 | +### Modify an existing subdomain |
| 43 | + |
| 44 | +Modify an [existing file][existing]. Our automation will sync this change when it runs. |
| 45 | + |
| 46 | + [existing]: /g0v.network./g0v.network.yaml |
| 47 | + |
| 48 | +## Development |
| 49 | + |
| 50 | +To contribute changes to our automation, you'll likely want to be able to run it locally. Here's what you'll need: |
| 51 | + |
| 52 | +- Python 3 |
| 53 | +- Cloudflare account |
| 54 | +- Cloudflare site: `g0v.network` (can "fake it", no need to actually have access to it) |
| 55 | +- Cloudflare API token (see instructions in `sample.env`) |
| 56 | + |
| 57 | +``` |
| 58 | +git clone https://github.com/g0v-network/domains |
| 59 | +cd domains |
| 60 | +
|
| 61 | +brew install pipenv |
| 62 | +pipenv install |
| 63 | +
|
| 64 | +# Copy and modify as needed with API token |
| 65 | +cp sample.env .env |
| 66 | +
|
| 67 | +# Validate your config locally |
| 68 | +pipenv run octodns-validate --config-file config.yaml |
| 69 | +
|
| 70 | +# Do a dry run (no changes will be made) |
| 71 | +pipenv run octodns-sync --config-file config.yaml |
| 72 | +
|
| 73 | +# Do a REAL run (!!!) |
| 74 | +# |
| 75 | +# WARNING: this is destructive, and will delete any records on a domain that |
| 76 | +# are not present in your configuration files. |
| 77 | +pipenv run octodns-sync --config-file config.yaml --doit |
| 78 | +``` |
| 79 | + |
| 80 | +## :muscle: Contributing |
| 81 | + |
| 82 | +Please open an issue or pull request in order to apply for a new subdomain. |
| 83 | + |
| 84 | +## :copyright: License |
| 85 | + |
| 86 | +[CC0 1.0 Universal](https://creativecommons.org/publicdomain/zero/1.0/) |
0 commit comments