mirror of
https://git.nolog.cz/NoLog.cz/nginx-configurator.git
synced 2025-01-31 03:43:35 +01:00
60 lines
1.9 KiB
Markdown
60 lines
1.9 KiB
Markdown
# 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.
|