Skip to content
This repository has been archived by the owner on May 29, 2022. It is now read-only.

signed-log/ncfig

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

NCFIG

Github top language Github language count Repository size License

About   |   Features   |   Technologies   |   Requirements   |   Starting   |   License   |   Author


🎯 About

Syncs NGINX reverse-proxy configuration with Cloudflare's API

✨ Features

✔️ 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...)

🚀 Technologies

The following tools were used in this project:

✅ Requirements

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

🏁 Starting

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

🔘 Usage

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)

Rootless operation

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

📝 License

This project is under GPL-3.0 license. For more details, see the LICENSE file.

Made with ❤️ by Stig124

 

Back to top

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published