Updated the script. Updated the configuration files. Script need a lot of work.

This commit is contained in:
Raphaël Numbus
2026-03-14 11:50:09 +01:00
parent 99d19af39a
commit d09e261b14
6 changed files with 199 additions and 22 deletions
-1
View File
@@ -13,7 +13,6 @@ The entire deployment process is automated around a bash script. It helps to dyn
- An email address with automated mail sending support
- A valid, public domain name
#### For numbus-backup-server :
- A NixOS-based machine to deploy from
- A NixOS-based live machine to deploy to
+44 -8
View File
@@ -36,6 +36,12 @@ NECESSARY_BACKUP_SERVER_VARIABLES_LIST=(
SERVICES_SELECTED_WEB_APPLICATIONS
)
OPTIONAL_BACKUP_SERVER_VARIABLES_LIST=(
# SERVICES SETTINGS
SELECTED_DNS_SERVICE_SUBDOMAIN
SELECTED_WEB_APPLICATIONS_SUBDOMAIN
)
NECESSARY_COMPUTER_VARIABLES_LIST=(
#LIVE TARGET SETTINGS
LIVE_TARGET_IP
@@ -52,6 +58,9 @@ NECESSARY_COMPUTER_VARIABLES_LIST=(
NETWORK_SUBNET
NETWORK_ROUTER_IP
NETWORK_HOME_COMPUTER_IP
)
OPTIONAL_COMPUTER_VARIABLES_LIST=(
# SERVICES SETTINGS
SERVICES_SELECTED_SYSTEM
SERVICES_SELECTED_APPLICATIONS
@@ -87,6 +96,12 @@ NECESSARY_SERVER_VARIABLES_LIST=(
SERVICES_SELECTED_WEB_APPLICATIONS
)
OPTIONAL_SERVER_VARIABLES_LIST=(
# SERVICES SETTINGS
SELECTED_DNS_SERVICE_SUBDOMAIN
SELECTED_WEB_APPLICATIONS_SUBDOMAIN
)
NECESSARY_TV_VARIABLES_LIST=(
#LIVE TARGET SETTINGS
LIVE_TARGET_IP
@@ -103,6 +118,9 @@ NECESSARY_TV_VARIABLES_LIST=(
NETWORK_SUBNET
NETWORK_ROUTER_IP
NETWORK_HOME_TV_IP
)
OPTIONAL_TV_VARIABLES_LIST=(
# SERVICES SETTINGS
SERVICES_SELECTED_SYSTEM
SERVICES_SELECTED_WEB_APPLICATIONS
@@ -119,11 +137,15 @@ WEB_APPLICATIONS_LIST=(
"frigate"
"gitea"
"home-assistant"
"homepage"
"immich"
"it-tools"
"jellyfin"
"n8n"
"netbootxyz"
"nextcloud"
"ntfy"
"odoo"
"passbolt"
"uptime-kuma"
"vscodium"
@@ -145,11 +167,15 @@ WEB_APPLICATIONS_DESCRIPTION=(
"Frigate [Home Assistant required] : AI-powered NVR for smart security cameras"
"Gitea : A lightweight, self-hosted Git service like GitHub"
"Home-Assistant : Open-source home automation to control all your devices"
"Homepage : A modern dashboard to organize your applications and services"
"Immich : Self-hosted Google Photos alternative for photos and videos"
"IT-tools : Handy collection of online tools for developers"
"Jellyfin : A self-hosted media server to stream your movies and music"
"N8n : Workflow automation tool"
"netboot.xyz : PXE boot various OS installers and utilities"
"Nextcloud : A self-hosted productivity platform, like Google Drive & Office"
"Ntfy : Send push notifications to your phone or desktop via HTTP"
"Odoo : Open-source business management suite (ERP & CRM)"
"Passbolt: An open-source, security-first password manager for teams"
"Uptime-Kuma : A fancy self-hosted monitoring tool"
"VSCodium : An open-source version of VScode in your web browser"
@@ -170,8 +196,8 @@ user_input() {
local SENSITIVE="${6:-false}"
while true; do
[[ "$SENSITIVE" == "false" ]] && INPUT_VALUE=$(gum input --placeholder "${PLACEHOLDER}" --header "${HEADER}")
[[ "$SENSITIVE" == "true" ]] && INPUT_VALUE=$(gum input --password --placeholder "${PLACEHOLDER}" --header "${HEADER}")
[[ "${SENSITIVE}" == "false" ]] && INPUT_VALUE=$(gum input --placeholder "${PLACEHOLDER}" --header "${HEADER}")
[[ "${SENSITIVE}" == "true" ]] && INPUT_VALUE=$(gum input --password --placeholder "${PLACEHOLDER}" --header "${HEADER}")
if [[ -z "${INPUT_VALUE}" ]]; then
echo "❌ Error: Input cannot be empty. Please provide the necessary information."
@@ -246,19 +272,21 @@ import_variables() {
local CONFIG_PATH="$(gum file)"
source "${CONFIG_PATH}"
local MISSING=0
local MISSING=false
for VAR in "${VARIABLES_LIST[@]}"; do
if [[ -v "${VAR}" && -n "${!VAR}" ]]; then
gum style "✅ "${VAR}" imported successfully from the config file"
else
gum style "❌ "${VAR}" is missing or empty"
MISSING=1
MISSING=true
fi
done
if [[ "${MISSING}" -eq 1 ]]; then
echo -e "\n❌ Please check your configuration file to include all necessary variables"
exit 1
if [[ "${MISSING}" == "true" ]]; then
if [[ "${NECESSARY}" = "true" ]]; then
echo -e "\n❌ Please check your configuration file to include all necessary variables"
exit 1
fi
fi
if [[ "${DEBUG:-false}" == "true" ]]; then
@@ -1031,7 +1059,15 @@ EOF
sleep 1
# Choose the action
ACTION_ANSWER=$(gum choose "[1] 🌐 Deploy NixOS on a remote machine" "[2] 💽 Deploy NixOS on a remote machine with a file configuration" "[3] 🛠️ Update a NixOS remote machine")
ACTION_ANSWER=$(gum choose \
"[1.A] 🌍 Deploy interactively a numbus-server" \
"[1.B] 🌍 Deploy non-interactively (with a config file) a numbus-server" \
"[2.A] 💾 Deploy interactively a numbus-backup-server" \
"[2.B] 💾 Deploy non-interactively (with a config file) a numbus-backup-server" \
"[3.A] 💻 Deploy interactively a numbus-computer" \
"[3.B] 💻 Deploy non-interactively (with a config file) a numbus-computer" \
"[4.A] 📺 Deploy interactively a numbus-tv" \
"[4.B] 📺 Deploy non-interactively (with a config file) a numbus-tv" )
if [[ "$ACTION_ANSWER" == "[1] 🌐 Deploy NixOS on a remote machine" ]]; then
TARGET_USER="nixos"
+88
View File
@@ -0,0 +1,88 @@
# -->
# MANDATORY SETTINGS
# <--
## Script settings
export DEBUG="true"
## Live target settings
export LIVE_TARGET_IP="192.168.1.10"
export LIVE_TARGET_PASSWD="example"
## Server settings
export SERVER_LANGUAGE="FR"
export SERVER_LOCALE="fr_FR"
export SERVER_TIMEZONE="Europe/Paris"
export SERVER_OWNER_NAME="yourName"
export SERVER_USER_EMAIL="user@your-domain.com"
export SERVER_ADMIN_EMAIL="admin@your-domain.com"
export SERVER_AUTHORIZED_SSH_PUBKEYS=( "ssh-ed25519 AAAAoefzefpoipoeCEZJCPEACPAcjapjcpajepcjAPJECJPEJAPJAZ yours@yourdomain.com" )
## Traefik settings
export CLOUDFLARE_DNS_API_TOKEN="yourToken"
## Smtp settings
export SMTP_SERVER_USERNAME="your-address@gmail.com"
export SMTP_SERVER_PASSWORD="emrp raps vzoi vnoe"
export SMTP_SERVER_HOST="smtp.yourdomain.com"
export SMTP_SERVER_PORT="587"
## Network settings
export NETWORK_SUBNET="192.168.1.0/24"
export NETWORK_ROUTER_IP="192.168.1.1"
export HOME_SERVER_IP="192.168.1.5"
## Services settings
export DOMAIN_NAME="yourdomain.com"
## DNS service
export SELECTED_DNS_SERVICE=(
"pi-hole" # or "adguard"
)
## Web applications
export SELECTED_WEB_APPLICATIONS=(
"crafty"
"frigate"
"gitea"
"home-assistant"
"immich"
"it-tools"
"jellyfin"
"netbootxyz"
"nextcloud"
"passbolt"
"uptime-kuma"
"vscodium"
)
## System services
export SELECTED_SYSTEM_SERVICES=(
"clamav"
"virtualization"
)
# -->
# OPTIONAL SETTINGS
# <--
## DNS service subdomain
export SELECTED_DNS_SERVICE_SUBDOMAIN=(
"my-pi-hole-subdomain" # or "my-adguard-subdomain"
)
## Web applications subdomain
export SELECTED_WEB_APPLICATIONS_SUBDOMAIN=( # ⚠️ Must match SELECTED_WEB_APPLICATIONS order ⚠️
"my-crafty-subdomain"
"my-frigate-subdomain"
"my-gitea-subdomain"
"my-home-assistant-subdomain"
"my-immich-subdomain"
"my-it-tools-subdomain"
"my-jellyfin-subdomain"
"my-netbootxyz-subdomain"
"my-nextcloud-subdomain"
"my-passbolt-subdomain"
"my-uptime-kuma-subdomain"
"my-vscodium-subdomain"
)
+22
View File
@@ -0,0 +1,22 @@
# -->
# MANDATORY SETTINGS
# <--
## Script settings
export DEBUG="true"
## Live target settings
export LIVE_TARGET_IP="192.168.1.10"
export LIVE_TARGET_PASSWD="example"
## Computer settings
export COMPUTER_LANGUAGE="FR"
export COMPUTER_LOCALE="fr_FR"
export COMPUTER_TIMEZONE="Europe/Paris"
export COMPUTER_OWNER_NAME="yourName"
export COMPUTER_AUTHORIZED_SSH_PUBKEYS=( "ssh-ed25519 AAAAoefzefpoipoeCEZJCPEACPAcjapjcpajepcjAPJECJPEJAPJAZ yours@yourdomain.com" )
## Network settings
export NETWORK_SUBNET="192.168.1.0/24"
export NETWORK_ROUTER_IP="192.168.1.1"
export HOME_SERVER_IP="192.168.1.5"
+23 -13
View File
@@ -1,37 +1,41 @@
# SCRIPT SETTINGS
# -->
# MANDATORY SETTINGS
# <--
## Script settings
export DEBUG="true"
#LIVE TARGET SETTINGS
## Live target settings
export LIVE_TARGET_IP="192.168.1.10"
export LIVE_TARGET_PASSWD="example"
#SERVER SETTINGS
export LANGUAGE="FR"
export LOCALE="fr_FR"
export TIMEZONE="Europe/Paris"
## Server settings
export SERVER_LANGUAGE="FR"
export SERVER_LOCALE="fr_FR"
export SERVER_TIMEZONE="Europe/Paris"
export SERVER_OWNER_NAME="yourName"
export SERVER_USER_EMAIL="user@your-domain.com"
export SERVER_ADMIN_EMAIL="admin@your-domain.com"
export AUTHORIZED_SSH_PUBLIC_KEY=( "ssh-ed25519 AAAAoefzefpoipoeCEZJCPEACPAcjapjcpajepcjAPJECJPEJAPJAZ yours@yourdomain.com" )
export SERVER_AUTHORIZED_SSH_PUBKEYS=( "ssh-ed25519 AAAAoefzefpoipoeCEZJCPEACPAcjapjcpajepcjAPJECJPEJAPJAZ yours@yourdomain.com" )
# TRAEFIK SETTINGS
export DOMAIN_NAME="yourdomain.com"
## Traefik settings
export CLOUDFLARE_DNS_API_TOKEN="yourToken"
# SMTP SETTINGS
## Smtp settings
export SMTP_SERVER_USERNAME="your-address@gmail.com"
export SMTP_SERVER_PASSWORD="emrp raps vzoi vnoe"
export SMTP_SERVER_HOST="smtp.yourdomain.com"
export SMTP_SERVER_PORT="587"
#NETWORK SETTINGS
## Network settings
export NETWORK_SUBNET="192.168.1.0/24"
export NETWORK_ROUTER_IP="192.168.1.1"
export HOME_SERVER_IP="192.168.1.5"
# SERVICES SETTINGS
## Services settings
export DOMAIN_NAME="yourdomain.com"
export SELECTED_DNS_SERVICE=(
"pi-hole" # or adguard
"pi-hole" # or "adguard"
)
export SELECTED_WEB_APPLICATIONS=(
"crafty"
@@ -52,10 +56,16 @@ export SELECTED_SYSTEM_SERVICES=(
"virtualization"
)
# -->
# OPTIONAL SETTINGS
# <--
## DNS service subdomain
export SELECTED_DNS_SERVICE_SUBDOMAIN=(
"my-pi-hole-subdomain" # or "my-adguard-subdomain"
)
## Web applications subdomain
export SELECTED_WEB_APPLICATIONS_SUBDOMAIN=( # ⚠️ Must match SELECTED_WEB_APPLICATIONS order ⚠️
"my-crafty-subdomain"
"my-frigate-subdomain"
+22
View File
@@ -0,0 +1,22 @@
# -->
# MANDATORY SETTINGS
# <--
## Script settings
export DEBUG="true"
## Live target settings
export LIVE_TARGET_IP="192.168.1.10"
export LIVE_TARGET_PASSWD="example"
## Computer settings
export COMPUTER_LANGUAGE="FR"
export COMPUTER_LOCALE="fr_FR"
export COMPUTER_TIMEZONE="Europe/Paris"
export COMPUTER_OWNER_NAME="yourName"
export COMPUTER_AUTHORIZED_SSH_PUBKEYS=( "ssh-ed25519 AAAAoefzefpoipoeCEZJCPEACPAcjapjcpajepcjAPJECJPEJAPJAZ yours@yourdomain.com" )
## Network settings
export NETWORK_SUBNET="192.168.1.0/24"
export NETWORK_ROUTER_IP="192.168.1.1"
export HOME_SERVER_IP="192.168.1.5"