From e2485627b15a7b10a17675672ac268469dd512b5 Mon Sep 17 00:00:00 2001 From: Paul Payne Date: Fri, 20 Jun 2025 16:38:45 -0700 Subject: [PATCH] Add initial setup for Central DNS and PXE services using dnsmasq - Created README.md for Central setup documentation. - Added dnsmasq configuration files and scripts for setting up DNS and PXE booting. - Implemented nginx configuration to serve PXE boot assets. - Developed setup.sh script to automate installation and configuration of dnsmasq and nginx. - Removed outdated dnsmasq setup guide from documentation. --- ...ll-dnsmasq => wild-central-generate-setup} | 2 +- central-setup/README.md | 44 +++++++++++++++++++ .../dnsmasq/.not_logged_in_yet | 0 .../dnsmasq/bare-metal.yaml | 0 .../dnsmasq/boot.ipxe | 0 .../dnsmasq/dnsmasq.conf | 0 .../dnsmasq/dnsmasq.reference | 0 .../dnsmasq/nginx.conf | 0 .../dnsmasq/setup.sh | 2 +- docs/guides/dnsmasq-setup.md | 8 ---- 10 files changed, 46 insertions(+), 10 deletions(-) rename bin/{install-dnsmasq => wild-central-generate-setup} (98%) create mode 100644 central-setup/README.md rename {infrastructure_setup => central-setup}/dnsmasq/.not_logged_in_yet (100%) rename {infrastructure_setup => central-setup}/dnsmasq/bare-metal.yaml (100%) rename {infrastructure_setup => central-setup}/dnsmasq/boot.ipxe (100%) rename {infrastructure_setup => central-setup}/dnsmasq/dnsmasq.conf (100%) rename {infrastructure_setup => central-setup}/dnsmasq/dnsmasq.reference (100%) rename {infrastructure_setup => central-setup}/dnsmasq/nginx.conf (100%) rename {infrastructure_setup => central-setup}/dnsmasq/setup.sh (97%) delete mode 100644 docs/guides/dnsmasq-setup.md diff --git a/bin/install-dnsmasq b/bin/wild-central-generate-setup similarity index 98% rename from bin/install-dnsmasq rename to bin/wild-central-generate-setup index 2d8e43b..baf9d8a 100755 --- a/bin/install-dnsmasq +++ b/bin/wild-central-generate-setup @@ -44,7 +44,7 @@ if [ -z "${WILDCLOUD_REPO}" ] || [ "${WILDCLOUD_REPO}" = "null" ]; then fi # The source templates for asq setup. -DNSMASQ_TEMPLATE_DIR="${WILDCLOUD_REPO}/infrastructure_setup/dnsmasq" +DNSMASQ_TEMPLATE_DIR="${WILDCLOUD_REPO}/central-setup/dnsmasq" if [ ! -d "${DNSMASQ_TEMPLATE_DIR}" ]; then echo "Error: DNSMasq setup directory not found at ${DNSMASQ_TEMPLATE_DIR}" exit 1 diff --git a/central-setup/README.md b/central-setup/README.md new file mode 100644 index 0000000..e987f0a --- /dev/null +++ b/central-setup/README.md @@ -0,0 +1,44 @@ +# Central setup + +"Central" is a Wild-cloud concept for a network appliance use for cloud utilities. + +Right now, this is entirely `dnsmasq` to provide: + +- LAN DNS w/ forwarding of internal and external cloud domains to the cluster. +- PXE for setting up cluster nodes. + +## Setup + +The setup is going through architecture design right now. + +- Initially, the process used to bootstrap a node was: + - Run `bin/install-dnsmasq` in your personal wildcloud dir to create a set of install files in `cluster/dnsmasq`. + - Copy this dir to a configured debian machine to have the services set up correctly as your Central. + +## Future setup + +To provide a better user experience, we have been creating a debian apt package that also does this while providing a UI. + +Development repo: https://github.com/civil-society-dev/wild-central + +The setup will look something like this: + +```bash +# Download and install GPG key +curl -fsSL https://mywildcloud.org/apt/wild-cloud-central.gpg | sudo tee /usr/share/keyrings/wild-cloud-central-archive-keyring.gpg > /dev/null + +# Add repository (modern .sources format) +sudo tee /etc/apt/sources.list.d/wild-cloud-central.sources << 'EOF' +Types: deb +URIs: https://mywildcloud.org/apt +Suites: stable +Components: main +Signed-By: /usr/share/keyrings/wild-cloud-central-archive-keyring.gpg +EOF + +# Update and install +sudo apt update +sudo apt install wild-cloud-central +``` + +browse to `http://localhost:5050`! diff --git a/infrastructure_setup/dnsmasq/.not_logged_in_yet b/central-setup/dnsmasq/.not_logged_in_yet similarity index 100% rename from infrastructure_setup/dnsmasq/.not_logged_in_yet rename to central-setup/dnsmasq/.not_logged_in_yet diff --git a/infrastructure_setup/dnsmasq/bare-metal.yaml b/central-setup/dnsmasq/bare-metal.yaml similarity index 100% rename from infrastructure_setup/dnsmasq/bare-metal.yaml rename to central-setup/dnsmasq/bare-metal.yaml diff --git a/infrastructure_setup/dnsmasq/boot.ipxe b/central-setup/dnsmasq/boot.ipxe similarity index 100% rename from infrastructure_setup/dnsmasq/boot.ipxe rename to central-setup/dnsmasq/boot.ipxe diff --git a/infrastructure_setup/dnsmasq/dnsmasq.conf b/central-setup/dnsmasq/dnsmasq.conf similarity index 100% rename from infrastructure_setup/dnsmasq/dnsmasq.conf rename to central-setup/dnsmasq/dnsmasq.conf diff --git a/infrastructure_setup/dnsmasq/dnsmasq.reference b/central-setup/dnsmasq/dnsmasq.reference similarity index 100% rename from infrastructure_setup/dnsmasq/dnsmasq.reference rename to central-setup/dnsmasq/dnsmasq.reference diff --git a/infrastructure_setup/dnsmasq/nginx.conf b/central-setup/dnsmasq/nginx.conf similarity index 100% rename from infrastructure_setup/dnsmasq/nginx.conf rename to central-setup/dnsmasq/nginx.conf diff --git a/infrastructure_setup/dnsmasq/setup.sh b/central-setup/dnsmasq/setup.sh similarity index 97% rename from infrastructure_setup/dnsmasq/setup.sh rename to central-setup/dnsmasq/setup.sh index 98b6bd9..1a2a152 100644 --- a/infrastructure_setup/dnsmasq/setup.sh +++ b/central-setup/dnsmasq/setup.sh @@ -1,6 +1,6 @@ #!/bin/bash -# This file to be run on dnsmasq server +# This file to be run on dnsmasq server (Central) echo "Updating APT repositories." sudo apt-get update diff --git a/docs/guides/dnsmasq-setup.md b/docs/guides/dnsmasq-setup.md deleted file mode 100644 index 188606c..0000000 --- a/docs/guides/dnsmasq-setup.md +++ /dev/null @@ -1,8 +0,0 @@ -# Dnsmasq setup - -Steps: - -- Get some hardware. A $30 _Orange Pi Zero 3_ is good enough. -- See [Armbian Setup](./armbian-setup.md). -- From your wildcloud root, run `install-dnsmasq`. This will create the required installation files and copy them all to your dnsmasq server into `/tmp/dnsmasq-setup`. -- ssh into your dnsmasq server and run `/tmp/dnsmasq-setup/setup.sh`.