From b1a9fbe3ca576df0845d585cb6d7ab3648858cd8 Mon Sep 17 00:00:00 2001 From: Sean Robertson Date: Fri, 17 Dec 2021 15:21:52 +1300 Subject: [PATCH 1/5] Update location of FreeBSD install instructions --- README.FREEBSD.md | 2 +- {freebsd => install/freebsd}/install.sh | 0 {freebsd => install/freebsd}/rc.d/homebrewery | 0 install/ubuntu/install.sh | 14 ++++++++++++++ 4 files changed, 15 insertions(+), 1 deletion(-) rename {freebsd => install/freebsd}/install.sh (100%) rename {freebsd => install/freebsd}/rc.d/homebrewery (100%) create mode 100644 install/ubuntu/install.sh diff --git a/README.FREEBSD.md b/README.FREEBSD.md index 92f9064d0..c99c248ee 100644 --- a/README.FREEBSD.md +++ b/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/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/install.sh b/install/ubuntu/install.sh new file mode 100644 index 000000000..44311ce71 --- /dev/null +++ b/install/ubuntu/install.sh @@ -0,0 +1,14 @@ +#!/bin/sh + +curl -fsSL https://deb.nodesource.com/setup_16.x | sudo -E bash - +apt install -y git nodejs npm mongodb44 + +export NODE_ENV=local + +cd /usr/local/ +git clone https://github.com/naturalcrit/homebrewery.git + +cd homebrewery +npm install +npm audit fix +npm run postinstall \ No newline at end of file From aa4de67e90e482607cd831a7318eb66a1d75f542 Mon Sep 17 00:00:00 2001 From: Sean Robertson Date: Fri, 17 Dec 2021 16:06:34 +1300 Subject: [PATCH 2/5] Ensure curl is installed Fix mongodb package name Use apt satisfy instead of apt install --- install/ubuntu/install.sh | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/install/ubuntu/install.sh b/install/ubuntu/install.sh index 44311ce71..4fa821102 100644 --- a/install/ubuntu/install.sh +++ b/install/ubuntu/install.sh @@ -1,11 +1,13 @@ #!/bin/sh +apt install -y curl curl -fsSL https://deb.nodesource.com/setup_16.x | sudo -E bash - -apt install -y git nodejs npm mongodb44 -export NODE_ENV=local +apt satisfy -y git nodejs npm mongodb + +NODE_ENV=local +export NODE_ENV -cd /usr/local/ git clone https://github.com/naturalcrit/homebrewery.git cd homebrewery From 41bc6ca4443d625eba4c3720db8234a1b2c4e18c Mon Sep 17 00:00:00 2001 From: "G.Ambatte" Date: Sun, 19 Dec 2021 18:50:35 +1300 Subject: [PATCH 3/5] Add HB service file Update install.sh to create service and set to start automatically --- .../etc/systemd/system/homebrewery.service | 13 ++++++++++ install/ubuntu/install.sh | 26 ++++++++++++++++--- 2 files changed, 35 insertions(+), 4 deletions(-) create mode 100644 install/ubuntu/etc/systemd/system/homebrewery.service 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 index 4fa821102..ebad7f3f2 100644 --- a/install/ubuntu/install.sh +++ b/install/ubuntu/install.sh @@ -1,16 +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 -NODE_ENV=local -export NODE_ENV - +# 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 \ No newline at end of file +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 From dcf17e3b7239b8dfc2e7154ae49f40034ba25757 Mon Sep 17 00:00:00 2001 From: "G.Ambatte" Date: Sun, 19 Dec 2021 19:22:33 +1300 Subject: [PATCH 4/5] Add README.UBUNTU.md --- README.UBUNTU.md | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 README.UBUNTU.md diff --git a/README.UBUNTU.md b/README.UBUNTU.md new file mode 100644 index 000000000..d14cfef46 --- /dev/null +++ b/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 From db5987a466ddd34c93764af4a00af848e713783f Mon Sep 17 00:00:00 2001 From: "G.Ambatte" Date: Sun, 19 Dec 2021 19:26:12 +1300 Subject: [PATCH 5/5] Shift install instruction READMEs into `install` directory --- README.FREEBSD.md => install/README.FREEBSD.md | 0 README.UBUNTU.md => install/README.UBUNTU.md | 0 2 files changed, 0 insertions(+), 0 deletions(-) rename README.FREEBSD.md => install/README.FREEBSD.md (100%) rename README.UBUNTU.md => install/README.UBUNTU.md (100%) diff --git a/README.FREEBSD.md b/install/README.FREEBSD.md similarity index 100% rename from README.FREEBSD.md rename to install/README.FREEBSD.md diff --git a/README.UBUNTU.md b/install/README.UBUNTU.md similarity index 100% rename from README.UBUNTU.md rename to install/README.UBUNTU.md