About | Features | Technologies | Requirements | Starting | License | Author
Syncs NGINX reverse-proxy configuration with Cloudflare's API
✔️ Seamlessly sync your config file
✔️ Supports only API Token
✔️ Compatible with Linux and MacOS
✔️ Can delete and edit existing records when they leave the config file or when the IP change (soon...)
The following tools were used in this project:
Before starting 🏁, you need to have Python 3, pip
(python3-pip
on Debian/Ubuntu
) and venv
(python3-venv
) installed.
And generated an API Token with at least the following permissions
- Zone:DNS Edit
- Zone:Zone Read
Every command needs to be ran as root For Rootless see the rootless paragraph
# Clone this project
git clone https://github.com/stig124/ncfig
# Access
cd ncfig
# Install dependencies
pip3 install pipenv && pipenv install
# Setup variables (Those commands needs to be ran each time program is to be executed)
export CF_API_KEY="API token between quotes"
export CONF="absolute path to nginx site config"
# Run the program (see usage for command switches)
python3 main.py
# If you want to rerun the program
# Go to the folder then
pipenv shell
# Configure variables as usual
python3 main.py
python3 main.py (-r, --rootless) (-p, --proxy) (-y, --yes)
-p, --proxy : Enable Cloudflare's proxying (default: False)
-r, --rootless : Enables rootless mode (skip permission checking). (default: False)
-y, --yes : Runs the program non-interactively (default: False)
The toggle -r
is not to be used on Linux if you've not made rootless installation, a great way to check that is if you have your site conf in /etc/nginx
(default folder), you don't need that and needs root permission to read
On a brew
MacOS install, it is rootless by default, so you need to append -r
This project is under GPL-3.0 license. For more details, see the LICENSE file.
Made with ❤️ by Stig124