<commit_before>cloudflare-ddns
===============
This is a continued version of [thatjpk's cloudflare-ddns](https://github.com/thatjpk/cloudflare-ddns).

Introduction
------------

A script for dynamically updating Cloudflare DNS records.
If you have a dynamic IP and you're hosting servers behind it, it's an easy way to make it 'pseudo-static'

Dependencies
------------

You'll need a [Python](https://www.python.org/downloads/) interpreter and the following libraries:

 - [PyYAML](https://bitbucket.org/xi/pyyaml) (`pip install pyyaml`)
 - [Requests](http://docs.python-requests.org/en/latest/) (`pip install
   requests`)

You can install them with `pip` :

	pip install -r requirements.txt
	
Features
-----
  - Command line usage
  - Can use `dig` to fetch the public IP
  - IPv4 and IPv6 support (A and AAAA records)
  - Logging
  - Multiple configuration files
  - Lightweight
  - Ability to edit some of your record settings such as:
  	- Time to Live (TTL)
	- Cloudflare proxy mode
  - Smart update (your record will be updated only if needed)

Usage
-----

First, a few assumptions:

  - You have a Cloudflare account.
  - You're using Cloudflare to host DNS for a domain you own.
  - You have an A/AAAA record in Cloudflare you intend to dynamically update.

To use this utility, create a copy of the `config.yml.template` file inside the `configs` folder (and
rename it to something like `ddns.example.com.yml` for example).  Create one configuration per each record / 
domain pair you intend to update.  For example, I might have two configuration
files: `example.com.yaml` that updates the record for the naked (no www
prefix) domain example.com, and a second config, `www.example.com.yaml` that updates the
record for www.example.com.

To do a one-off update of your DNS record, simply run `python
cloudflare_ddns.py www.example.com.yaml` from your terminal.
The script will determine your public IP address and automatically update the
Cloudflare DNS record along with it.

If the program encounters an issue while attempting to update Cloudflare's 
records, you can check the `cloudflare-ddns.log` file inside the `logs` folder for more informations.

Because dynamic IPs can change regularly, it's recommended that you run this
utility periodically in the background to keep the Cloudflare record 
up-to-date.

Just add a line to your [crontab](http://en.wikipedia.org/wiki/Cron) and let
cron run it for you at a regular interval.

    # Every 30 minutes, check the current public IP, and update the record on Cloudflare if needed.
    */30 * * * * /path/to/code/cloudflare_ddns.py config.yaml

This example will update the record every 30 minutes. You'll want to be sure
that you insert the correct paths to reflect were the codebase is located.

If you want to learn more about the CloudFlare API, you can read on
[here](http://www.cloudflare.com/docs/client-api.html).

Credits and Thanks
------------------

 - [Cloudflare](https://www.cloudflare.com/) for having an API and otherwise
   generally being cool.
 - [icanhazip.com](http://icanhazip.com/) for making grabbing your public IP
    from a script super easy.
 - [thatjpk](https://github.com/thatjpk/) for the initial releases of this project.
<commit_msg>CloudFlare is now written Cloudflare<commit_after>cloudflare-ddns
===============
This is a continued version of [thatjpk's cloudflare-ddns](https://github.com/thatjpk/cloudflare-ddns).

Introduction
------------

A script for dynamically updating Cloudflare DNS records.
If you have a dynamic IP and you're hosting servers behind it, it's an easy way to make it 'pseudo-static'

Dependencies
------------

You'll need a [Python](https://www.python.org/downloads/) interpreter and the following libraries:

 - [PyYAML](https://bitbucket.org/xi/pyyaml) (`pip install pyyaml`)
 - [Requests](http://docs.python-requests.org/en/latest/) (`pip install
   requests`)

You can install them with `pip` :

	pip install -r requirements.txt
	
Features
-----
  - Command line usage
  - Can use `dig` to fetch the public IP
  - IPv4 and IPv6 support (A and AAAA records)
  - Logging
  - Multiple configuration files
  - Lightweight
  - Ability to edit some of your record settings such as:
  	- Time to Live (TTL)
	- Cloudflare proxy mode
  - Smart update (your record will be updated only if needed)

Usage
-----

First, a few assumptions:

  - You have a Cloudflare account.
  - You're using Cloudflare to host DNS for a domain you own.
  - You have an A/AAAA record in Cloudflare you intend to dynamically update.

To use this utility, create a copy of the `config.yml.template` file inside the `configs` folder (and
rename it to something like `ddns.example.com.yml` for example).  Create one configuration per each record / 
domain pair you intend to update.  For example, I might have two configuration
files: `example.com.yaml` that updates the record for the naked (no www
prefix) domain example.com, and a second config, `www.example.com.yaml` that updates the
record for www.example.com.

To do a one-off update of your DNS record, simply run `python
cloudflare_ddns.py www.example.com.yaml` from your terminal.
The script will determine your public IP address and automatically update the
Cloudflare DNS record along with it.

If the program encounters an issue while attempting to update Cloudflare's 
records, you can check the `cloudflare-ddns.log` file inside the `logs` folder for more informations.

Because dynamic IPs can change regularly, it's recommended that you run this
utility periodically in the background to keep the Cloudflare record 
up-to-date.

Just add a line to your [crontab](http://en.wikipedia.org/wiki/Cron) and let
cron run it for you at a regular interval.

    # Every 30 minutes, check the current public IP, and update the record on Cloudflare if needed.
    */30 * * * * /path/to/code/cloudflare_ddns.py config.yaml

This example will update the record every 30 minutes. You'll want to be sure
that you insert the correct paths to reflect were the codebase is located.

If you want to learn more about the Cloudflare API, you can read on
[here](http://www.cloudflare.com/docs/client-api.html).

Credits and Thanks
------------------

 - [Cloudflare](https://www.cloudflare.com/) for having an API and otherwise
   generally being cool.
 - [icanhazip.com](http://icanhazip.com/) for making grabbing your public IP
    from a script super easy.
 - [thatjpk](https://github.com/thatjpk/) for the initial releases of this project.

{'fraction_non_alphanumeric': 0.09671954412444171, 'fraction_numerical': 0.0024641922069921452, 'mean_word_length': 3.608942512420156, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 10, 'lorem ipsum': 0, 'www.': 12, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4679316', 'n_tokens_mistral': 1907, 'n_tokens_neox': 1782, 'n_words': 832}