# Bonfire Automated Installer This repository provides a single script that installs, configures, and deploys the [Bonfire federated platform](https://bonfirenetworks.org/) on a fresh Ubuntu 24.04 server with Nginx and Let’s Encrypt SSL. --- ## Features - Automated installation of dependencies (Postgres, Elixir, Node.js, Nginx, Certbot). - Prompts for domain, email, and database password. - Automatic DNS/FQDN validation (checks A/AAAA records). - Configures Bonfire as a `systemd` service. - HTTPS enabled via Let’s Encrypt. --- ## Requirements - Fresh Ubuntu 22.04+ or Debian 12+ server. - A fully qualified domain name (FQDN) pointing to the server’s IP. - Root or sudo access. ## Installation ### 1. Download the installer ```bash git clone https://your-repo-url/bonfire-installer.git cd bonfire-installer chmod +x install_bonfire.sh ``` ### 2 . Run the installer ```bash sudo ./install_bonfire.sh ``` The script will: - Prompt for your **domain name**, **email address**, and **database password**. - Validate that your domain resolves correctly (A/AAAA DNS records). - Install required system packages. - Configure Postgres and Bonfire. - Set up Nginx with SSL. - Create a `systemd` service for Bonfire. ## Usage ### Start/Stop/Restart Bonfire ```bash sudo systemctl start bonfire sudo systemctl stop bonfire sudo systemctl restart bonfire sudo systemctl status bonfire ``` ---------- ### Verify Nginx + SSL ```bash sudo nginx -t sudo systemctl reload nginx ``` ### Access the App Once installation is complete, open: ```http https://yourdomain.com ``` ## Updating Bonfire When new versions are released: ```bash cd /opt/bonfire sudo -u bonfire git pull sudo -u bonfire MIX_ENV=prod mix compile sudo -u bonfire MIX_ENV=prod mix ecto.migrate sudo systemctl restart bonfire ``` ## Logs View logs for troubleshooting: ```bash journalctl -u bonfire -f ``` ## Uninstall To remove Bonfire and related services: ```bash sudo systemctl stop bonfire sudo systemctl disable bonfire sudo rm -rf /opt/bonfire sudo deluser --remove-home bonfire sudo -u postgres dropdb bonfire sudo -u postgres dropuser bonfire sudo rm /etc/systemd/system/bonfire.service sudo systemctl daemon-reload ``` ## Notes - Ensure your domain’s DNS records are properly configured **before** running the installer. - The script is intended for production use on a dedicated server or VM. - For staging/testing, you may adapt the script to use self-signed certificates instead of Let’s Encrypt.