nginx-configurator/README.md

61 lines
1.9 KiB
Markdown
Raw Permalink Normal View History

2023-11-05 14:47:28 +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).
2023-10-25 19:37:39 +02:00
2023-10-25 19:38:52 +02:00
# TODO
2023-11-05 14:47:28 +01:00
2023-10-26 15:55:27 +02:00
* 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...
2023-11-05 14:47:28 +01:00
# Build
Run `build.sh` on a linux(-ish) machine. The output is a tarball `ncc.tar`.
# Installation
2023-10-26 15:55:27 +02:00
2023-11-05 14:47:28 +01:00
* 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`
2023-11-05 14:56:14 +01:00
* Optionally add shell completion:
* Bash: `_NCC_COMPLETE=bash_source ncc > /etc/bash_completion.d/ncc && . /etc/bash_completion.d/ncc`
2023-10-26 15:55:27 +02:00
2023-11-05 14:47:28 +01:00
# Usage
2023-10-26 15:55:27 +02:00
2023-11-05 14:47:28 +01:00
```
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
```
2023-10-25 19:37:39 +02:00
# Contributions
2023-11-05 14:47:28 +01:00
2023-10-25 19:44:27 +02:00
Please use `black` formatter.
2023-11-05 14:47:28 +01:00
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.