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 - An email address with automated mail sending support
- A valid, public domain name - A valid, public domain name
#### For numbus-backup-server : #### For numbus-backup-server :
- A NixOS-based machine to deploy from - A NixOS-based machine to deploy from
- A NixOS-based live machine to deploy to - 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 SERVICES_SELECTED_WEB_APPLICATIONS
) )
OPTIONAL_BACKUP_SERVER_VARIABLES_LIST=(
# SERVICES SETTINGS
SELECTED_DNS_SERVICE_SUBDOMAIN
SELECTED_WEB_APPLICATIONS_SUBDOMAIN
)
NECESSARY_COMPUTER_VARIABLES_LIST=( NECESSARY_COMPUTER_VARIABLES_LIST=(
#LIVE TARGET SETTINGS #LIVE TARGET SETTINGS
LIVE_TARGET_IP LIVE_TARGET_IP
@@ -52,6 +58,9 @@ NECESSARY_COMPUTER_VARIABLES_LIST=(
NETWORK_SUBNET NETWORK_SUBNET
NETWORK_ROUTER_IP NETWORK_ROUTER_IP
NETWORK_HOME_COMPUTER_IP NETWORK_HOME_COMPUTER_IP
)
OPTIONAL_COMPUTER_VARIABLES_LIST=(
# SERVICES SETTINGS # SERVICES SETTINGS
SERVICES_SELECTED_SYSTEM SERVICES_SELECTED_SYSTEM
SERVICES_SELECTED_APPLICATIONS SERVICES_SELECTED_APPLICATIONS
@@ -87,6 +96,12 @@ NECESSARY_SERVER_VARIABLES_LIST=(
SERVICES_SELECTED_WEB_APPLICATIONS SERVICES_SELECTED_WEB_APPLICATIONS
) )
OPTIONAL_SERVER_VARIABLES_LIST=(
# SERVICES SETTINGS
SELECTED_DNS_SERVICE_SUBDOMAIN
SELECTED_WEB_APPLICATIONS_SUBDOMAIN
)
NECESSARY_TV_VARIABLES_LIST=( NECESSARY_TV_VARIABLES_LIST=(
#LIVE TARGET SETTINGS #LIVE TARGET SETTINGS
LIVE_TARGET_IP LIVE_TARGET_IP
@@ -103,6 +118,9 @@ NECESSARY_TV_VARIABLES_LIST=(
NETWORK_SUBNET NETWORK_SUBNET
NETWORK_ROUTER_IP NETWORK_ROUTER_IP
NETWORK_HOME_TV_IP NETWORK_HOME_TV_IP
)
OPTIONAL_TV_VARIABLES_LIST=(
# SERVICES SETTINGS # SERVICES SETTINGS
SERVICES_SELECTED_SYSTEM SERVICES_SELECTED_SYSTEM
SERVICES_SELECTED_WEB_APPLICATIONS SERVICES_SELECTED_WEB_APPLICATIONS
@@ -119,11 +137,15 @@ WEB_APPLICATIONS_LIST=(
"frigate" "frigate"
"gitea" "gitea"
"home-assistant" "home-assistant"
"homepage"
"immich" "immich"
"it-tools" "it-tools"
"jellyfin" "jellyfin"
"n8n"
"netbootxyz" "netbootxyz"
"nextcloud" "nextcloud"
"ntfy"
"odoo"
"passbolt" "passbolt"
"uptime-kuma" "uptime-kuma"
"vscodium" "vscodium"
@@ -145,11 +167,15 @@ WEB_APPLICATIONS_DESCRIPTION=(
"Frigate [Home Assistant required] : AI-powered NVR for smart security cameras" "Frigate [Home Assistant required] : AI-powered NVR for smart security cameras"
"Gitea : A lightweight, self-hosted Git service like GitHub" "Gitea : A lightweight, self-hosted Git service like GitHub"
"Home-Assistant : Open-source home automation to control all your devices" "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" "Immich : Self-hosted Google Photos alternative for photos and videos"
"IT-tools : Handy collection of online tools for developers" "IT-tools : Handy collection of online tools for developers"
"Jellyfin : A self-hosted media server to stream your movies and music" "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" "netboot.xyz : PXE boot various OS installers and utilities"
"Nextcloud : A self-hosted productivity platform, like Google Drive & Office" "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" "Passbolt: An open-source, security-first password manager for teams"
"Uptime-Kuma : A fancy self-hosted monitoring tool" "Uptime-Kuma : A fancy self-hosted monitoring tool"
"VSCodium : An open-source version of VScode in your web browser" "VSCodium : An open-source version of VScode in your web browser"
@@ -170,8 +196,8 @@ user_input() {
local SENSITIVE="${6:-false}" local SENSITIVE="${6:-false}"
while true; do while true; do
[[ "$SENSITIVE" == "false" ]] && INPUT_VALUE=$(gum input --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}") [[ "${SENSITIVE}" == "true" ]] && INPUT_VALUE=$(gum input --password --placeholder "${PLACEHOLDER}" --header "${HEADER}")
if [[ -z "${INPUT_VALUE}" ]]; then if [[ -z "${INPUT_VALUE}" ]]; then
echo "❌ Error: Input cannot be empty. Please provide the necessary information." echo "❌ Error: Input cannot be empty. Please provide the necessary information."
@@ -246,19 +272,21 @@ import_variables() {
local CONFIG_PATH="$(gum file)" local CONFIG_PATH="$(gum file)"
source "${CONFIG_PATH}" source "${CONFIG_PATH}"
local MISSING=0 local MISSING=false
for VAR in "${VARIABLES_LIST[@]}"; do for VAR in "${VARIABLES_LIST[@]}"; do
if [[ -v "${VAR}" && -n "${!VAR}" ]]; then if [[ -v "${VAR}" && -n "${!VAR}" ]]; then
gum style "✅ "${VAR}" imported successfully from the config file" gum style "✅ "${VAR}" imported successfully from the config file"
else else
gum style "❌ "${VAR}" is missing or empty" gum style "❌ "${VAR}" is missing or empty"
MISSING=1 MISSING=true
fi fi
done done
if [[ "${MISSING}" -eq 1 ]]; then if [[ "${MISSING}" == "true" ]]; then
echo -e "\n❌ Please check your configuration file to include all necessary variables" if [[ "${NECESSARY}" = "true" ]]; then
exit 1 echo -e "\n❌ Please check your configuration file to include all necessary variables"
exit 1
fi
fi fi
if [[ "${DEBUG:-false}" == "true" ]]; then if [[ "${DEBUG:-false}" == "true" ]]; then
@@ -1031,7 +1059,15 @@ EOF
sleep 1 sleep 1
# Choose the action # 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 if [[ "$ACTION_ANSWER" == "[1] 🌐 Deploy NixOS on a remote machine" ]]; then
TARGET_USER="nixos" 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" export DEBUG="true"
#LIVE TARGET SETTINGS ## Live target settings
export LIVE_TARGET_IP="192.168.1.10" export LIVE_TARGET_IP="192.168.1.10"
export LIVE_TARGET_PASSWD="example" export LIVE_TARGET_PASSWD="example"
#SERVER SETTINGS ## Server settings
export LANGUAGE="FR" export SERVER_LANGUAGE="FR"
export LOCALE="fr_FR" export SERVER_LOCALE="fr_FR"
export TIMEZONE="Europe/Paris" export SERVER_TIMEZONE="Europe/Paris"
export SERVER_OWNER_NAME="yourName" export SERVER_OWNER_NAME="yourName"
export SERVER_USER_EMAIL="user@your-domain.com" export SERVER_USER_EMAIL="user@your-domain.com"
export SERVER_ADMIN_EMAIL="admin@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 ## Traefik settings
export DOMAIN_NAME="yourdomain.com"
export CLOUDFLARE_DNS_API_TOKEN="yourToken" export CLOUDFLARE_DNS_API_TOKEN="yourToken"
# SMTP SETTINGS ## Smtp settings
export SMTP_SERVER_USERNAME="your-address@gmail.com" export SMTP_SERVER_USERNAME="your-address@gmail.com"
export SMTP_SERVER_PASSWORD="emrp raps vzoi vnoe" export SMTP_SERVER_PASSWORD="emrp raps vzoi vnoe"
export SMTP_SERVER_HOST="smtp.yourdomain.com" export SMTP_SERVER_HOST="smtp.yourdomain.com"
export SMTP_SERVER_PORT="587" export SMTP_SERVER_PORT="587"
#NETWORK SETTINGS ## Network settings
export NETWORK_SUBNET="192.168.1.0/24" export NETWORK_SUBNET="192.168.1.0/24"
export NETWORK_ROUTER_IP="192.168.1.1" export NETWORK_ROUTER_IP="192.168.1.1"
export HOME_SERVER_IP="192.168.1.5" export HOME_SERVER_IP="192.168.1.5"
# SERVICES SETTINGS ## Services settings
export DOMAIN_NAME="yourdomain.com"
export SELECTED_DNS_SERVICE=( export SELECTED_DNS_SERVICE=(
"pi-hole" # or adguard "pi-hole" # or "adguard"
) )
export SELECTED_WEB_APPLICATIONS=( export SELECTED_WEB_APPLICATIONS=(
"crafty" "crafty"
@@ -52,10 +56,16 @@ export SELECTED_SYSTEM_SERVICES=(
"virtualization" "virtualization"
) )
# -->
# OPTIONAL SETTINGS # OPTIONAL SETTINGS
# <--
## DNS service subdomain
export SELECTED_DNS_SERVICE_SUBDOMAIN=( export SELECTED_DNS_SERVICE_SUBDOMAIN=(
"my-pi-hole-subdomain" # or "my-adguard-subdomain" "my-pi-hole-subdomain" # or "my-adguard-subdomain"
) )
## Web applications subdomain
export SELECTED_WEB_APPLICATIONS_SUBDOMAIN=( # ⚠️ Must match SELECTED_WEB_APPLICATIONS order ⚠️ export SELECTED_WEB_APPLICATIONS_SUBDOMAIN=( # ⚠️ Must match SELECTED_WEB_APPLICATIONS order ⚠️
"my-crafty-subdomain" "my-crafty-subdomain"
"my-frigate-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"