No description
Find a file
2024-11-04 22:27:40 +01:00
.githooks Add info about git hook for black 2023-10-25 19:44:27 +02:00
ncc remove unnecessary files 2024-11-04 22:27:40 +01:00
.gitignore add clusters.json 2023-11-05 14:57:26 +01:00
ncc.yml.sample rework and refactor 2024-11-04 22:25:33 +01:00
README.md add shell completion instructions 2023-11-05 14:56:14 +01:00
requirements.txt rework and refactor 2024-11-04 22:25:33 +01:00
setup.py fix package setup 2024-11-04 22:25:39 +01:00

Nginx cluster configurator - ncc

Manages the local nginx configuration and replicates changes to a backup.

Features

  • Allows the editing of services and using a template for new ones. Makes sure the configuration is valid before reloading the cluster (nginx).
  • Automatically obtains SSL certificates and replicates them to the cluster (dehydrated).
  • Will only make changes on the master server (keepalived).

TODO

  • Prepare config templates for nginx and dehydrated?
  • document dhparam.pem generation (openssl dhparam -out ssl-dhparams.pem 4096 in /etc/autossl)
  • Limit current SSH keys to only config rsync and nginx reload
  • Write down how it works in human language
  • Create a guide how to use it to intrawiki
  • Teach everybody how to use it...

Build

Run build.sh on a linux(-ish) machine. The output is a tarball ncc.tar.

Installation

  • Extract ncc.tar to a location on the server
  • Copy configuration config to /etc/ncc and modify to suit your environment
  • Add /etc/ncc/ncc-hook.sh as a hook to your dehydrated installation
  • Add ncc to your PATH
  • Optionally add shell completion:
    • Bash: _NCC_COMPLETE=bash_source ncc > /etc/bash_completion.d/ncc && . /etc/bash_completion.d/ncc

Usage

Usage: ncc [OPTIONS] COMMAND [ARGS]...

  Update the nginx cluster configuration

  MUST BE RAN ON MASTER (will detect automatically)

Options:
  --skip-master-check
  --help               Show this message and exit.

Commands:
  autossl  Renew SSL certificates and replicate changes
  delete   Delete a service
  edit     Edit a service
  list     List exsiting services and domain names associated with them
  new      Create a new service
  reload   Replicate the local config and reload the nginx cluster

Contributions

Please use black formatter.

You can automate the process by running cp .githooks/pre-commit .git/hooks/pre-commit && chmod +x .git/hooks/pre-commit after pulling the repository.