diff --git a/README.FREEBSD.md b/install/README.FREEBSD.md similarity index 92% rename from README.FREEBSD.md rename to install/README.FREEBSD.md index 92f9064d0..c99c248ee 100644 --- a/README.FREEBSD.md +++ b/install/README.FREEBSD.md @@ -10,7 +10,7 @@ These instructions assume that you are installing to a completely new, fresh Fre 2. Install wget (`pkg install -y wget`). On a fresh jail, you will be prompted to press 'Y' to set up `pkg`. -3. Download the installation script (`wget --no-check-certificate https://raw.githubusercontent.com/naturalcrit/homebrewery/master/freebsd/install.sh`). The parameter `--no-check-certificate` is required as we haven't set up any trusted certificates/authorities yet. +3. Download the installation script (`wget --no-check-certificate https://raw.githubusercontent.com/naturalcrit/homebrewery/master/install/freebsd/install.sh`). The parameter `--no-check-certificate` is required as we haven't set up any trusted certificates/authorities yet. 4. Make the downloaded file executable (`chmod +x install.sh`). diff --git a/install/README.UBUNTU.md b/install/README.UBUNTU.md new file mode 100644 index 000000000..d14cfef46 --- /dev/null +++ b/install/README.UBUNTU.md @@ -0,0 +1,35 @@ +# Ubuntu Installation Instructions + +## Before Installing + +These instructions assume that you are installing to a completely new, fresh Ubuntu installation. As such, some steps will not be necessary if you are installing to an existing Ubuntu instance. + +## Installation instructions + +1. Install Ubuntu. + +2. Install wget (`apt install -y wget`). This may already be installed, depending on your exact Ubuntu version. + +3. Download the installation script (`wget https://raw.githubusercontent.com/naturalcrit/homebrewery/master/install/ubuntu/install.sh`). + +4. Make the downloaded file executable (`chmod +x install.sh`). + +5. Run the script (`sudo ./install.sh`). This will automatically download all of the required packages, install both them and HomeBrewery, configure the system and finally start HomeBrewery. + +**NOTE:** At this time, the script **ONLY** installs HomeBrewery. It does **NOT** install the NaturalCrit login system, as that is currently a completely separate project. + +--- + +### Testing + +These installation instructions have been tested on the following Ubuntu releases: + +- *ubuntu-20.04.3-desktop-amd64* + +## Final Notes + +While this installation process works successfully at the time of writing (December 19, 2021), it relies on all of the Node.JS packages used in the HomeBrewery project retaining their cross-platform capabilities to continue to function. This is one of the inherent advantages of Node.JS, but it is by no means guaranteed and as such, functionality or even installation may fail without warning at some point in the future. + +Regards, +G +December 19, 2021 diff --git a/freebsd/install.sh b/install/freebsd/install.sh similarity index 100% rename from freebsd/install.sh rename to install/freebsd/install.sh diff --git a/freebsd/rc.d/homebrewery b/install/freebsd/rc.d/homebrewery similarity index 100% rename from freebsd/rc.d/homebrewery rename to install/freebsd/rc.d/homebrewery diff --git a/install/ubuntu/etc/systemd/system/homebrewery.service b/install/ubuntu/etc/systemd/system/homebrewery.service new file mode 100644 index 000000000..939d11fb8 --- /dev/null +++ b/install/ubuntu/etc/systemd/system/homebrewery.service @@ -0,0 +1,13 @@ +[Unit] +Description=Homebrewery Web Server + +[Service] +User=root +After=mongodb +Environment=NODE_ENV=local +WorkingDirectory=/usr/local/homebrewery +ExecStart=node server.js +Restart=always + +[Install] +WantedBy=multi-user.target \ No newline at end of file diff --git a/install/ubuntu/install.sh b/install/ubuntu/install.sh new file mode 100644 index 000000000..ebad7f3f2 --- /dev/null +++ b/install/ubuntu/install.sh @@ -0,0 +1,34 @@ +#!/bin/sh + +# Install CURL and add required NodeJS source to package repo +echo ::Install CURL +apt install -y curl +echo ::Add NodeJS source to package repo +curl -fsSL https://deb.nodesource.com/setup_16.x | sudo -E bash - + +# Install required packages +echo ::Install Homebrewery requirements +apt satisfy -y git nodejs npm mongodb + +# Clone Homebrewery repo +echo ::Get Homebrewery files +cd /usr/local/ +git clone https://github.com/naturalcrit/homebrewery.git + +# Install Homebrewery +echo ::Install Homebrewery +cd homebrewery +npm install +npm audit fix +npm run postinstall + +# Create Homebrewery service +echo ::Create Homebrewery service +ln -s /usr/local/homebrewery/install/ubuntu/etc/systemd/system/homebrewery.service /etc/systemd/system/homebrewery.service +systemctl daemon-reload +echo ::Set Homebrewery to start automatically +systemctl enable homebrewery + +# Start Homebrewery +echo ::Start Homebrewery +systemctl start homebrewery \ No newline at end of file