Skip to content

Instantly share code, notes, and snippets.

@subfission
Last active February 11, 2020 21:33
Show Gist options
  • Save subfission/545d2ae0e8b492665b672bf2f4e29ca1 to your computer and use it in GitHub Desktop.
Save subfission/545d2ae0e8b492665b672bf2f4e29ca1 to your computer and use it in GitHub Desktop.
#!/bin/bash
# Requires:
# 1-2 Cores
# 512-1 GB RAM
# 300+ MB HD
bold=$(tput bold)
green=$(tput setaf 2)
normal=$(tput sgr0)
echo -e "\n\n __ __ _ _ _ _ \n/ / /\\ \\ (_) | _(_) (_)___ \n\\ \\/ \\/ / | |/ / | | / __| \n \\ /\\ /| | <| |_ | \\__ \\ \n \\/ \\/ |_|_|\\_\\_(_)/ |___/ \n |__/\n < INSTALL >\n"
WIKIJS_PATH=/opt/wikijs
mkdir -p $WIKIJS_PATH
cd $WIKIJS_PATH
echo "Installing Dependencies"
apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 9DA31620334BD75D9DCB49F368818C72E52529D4
echo "deb http://repo.mongodb.org/apt/debian stretch/mongodb-org/4.0 main" | tee /etc/apt/sources.list.d/mongodb-org-4.0.list
curl -sL https://deb.nodesource.com/setup_10.x | bash -
apt-get update
apt-get install -y nodejs
apt-get install -y mongodb-org
apt-get install -y git
VERSION=$(curl -L -s -S https://raw.githubusercontent.com/Requarks/wiki-v1/master/CURRENT)
cd /opt
echo "[1/3] Fetching latest build..."
curl -L -s -S https://github.com/Requarks/wiki-v1/releases/download/v$VERSION/wiki-js.tar.gz | tar xz -C .
echo "[2/3] Fetching dependencies..."
curl -L -s -S https://github.com/Requarks/wiki-v1/releases/download/v$VERSION/node_modules.tar.gz | tar xz -C .
echo "[3/3] Creating config file..."
cp -n config.sample.yml config.yml
echo -e "-> ${green}Installation Complete${normal}\n"
echo -e "- Launch configuration wizard: ${bold}node wiki configure${normal}"
echo -e "- Start Wiki.js server: ${bold}node wiki start${normal}\n"
export ENV_
node wiki configure
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment