Update prod documentation

This commit is contained in:
Pierre HUBERT 2024-10-19 11:41:21 +02:00
parent 5aaad54de3
commit 3c20cca915

View File

@ -1,5 +1,7 @@
# Configure project for production # Configure project for production
Note: This guide assumes that you use the default hostname, `central.internal` as hostname for your central system.
## Create production build ## Create production build
### Central ### Central
@ -44,6 +46,70 @@ The OTA update is then located in `build/main.bin`
* A server running a recent Linux (Debian / Ubuntu preferred) with `central` as hostname * A server running a recent Linux (Debian / Ubuntu preferred) with `central` as hostname
* DHCP configured on the network * DHCP configured on the network
## Configure DNS server
If you need to setup a DNS server / proxy to point `central.internal` to the central server IP, you can follow this guide.
### Retrieve DNS server binary
Use [DNSProxy](https://gitlab.com/pierre42100/dnsproxy) as DNS server. Get and compile the sources:
```bash
git clone https://gitlab.com/pierre42100/dnsproxy
cd dnsproxy
cargo build --release
scp target/release/dns_proxy USER@CENTRAL_IP:/home/USER
```
Then, on the target server, install the binary to its final destination:
```bash
sudo mv dns_proxy /usr/local/bin/
```
### Configure DNS server
Configure the server as a service `/etc/systemd/system/dns.service`:
```conf
[Unit]
Description=DNS server
After=syslog.target
After=network.target
[Service]
RestartSec=2s
Type=simple
User=root
Group=root
WorkingDirectory=/tmp
ExecStart=/usr/local/bin/dns_proxy -l "CENTRAL_IP:53" -c "central.internal. A CENTRAL_IP"
Restart=always
[Install]
WantedBy=multi-user.target
```
Enable and start the new service:
```bash
sudo systemctl enable dns
sudo systemctl start dns
```
Check that it works correctly:
```bash
dig central.internal. @CENTRAL_IP
```
You should get an entry like this if it works:
```
;; ANSWER SECTION:
central.internal. 0 IN A CENTRAL_IP
```
Then, in your DHCP service, define the central as the DNS server.
## Configure server ## Configure server
### Create a user dedicated to the central ### Create a user dedicated to the central
@ -82,7 +148,7 @@ COOKIE_SECURE=true
LISTEN_ADDRESS=0.0.0.0:443 LISTEN_ADDRESS=0.0.0.0:443
ADMIN_USERNAME=admin ADMIN_USERNAME=admin
ADMIN_PASSWORD=FIXME ADMIN_PASSWORD=FIXME
HOSTNAME=central.local HOSTNAME=central.internal
STORAGE=/home/central/storage STORAGE=/home/central/storage
FRONIUS_ORIG=http://10.0.0.10 FRONIUS_ORIG=http://10.0.0.10
``` ```