2021-01-22 13:40:14 -05:00
|
|
|
#!/usr/bin/env bash
|
2018-12-20 08:13:50 -05:00
|
|
|
# ArchiveBox Setup Script
|
2020-11-23 02:04:39 -05:00
|
|
|
# https://github.com/ArchiveBox/ArchiveBox
|
2018-06-10 21:58:48 -04:00
|
|
|
|
2021-04-23 23:43:41 -04:00
|
|
|
echo "[!] It's highly recommended to use Docker instead of running this script. ⚠️"
|
|
|
|
echo " Docker is safer and easier to set up, and includes everything working out-of-the-box:"
|
|
|
|
echo " https://github.com/ArchiveBox/ArchiveBox/wiki/Docker"
|
|
|
|
echo ""
|
|
|
|
echo "Continuing in 5s... (press [Ctrl+C] to cancel)"
|
|
|
|
sleep 5
|
2019-03-12 17:49:40 -04:00
|
|
|
echo "[i] ArchiveBox Setup Script 📦"
|
2018-06-10 21:58:48 -04:00
|
|
|
echo ""
|
2021-04-23 23:43:41 -04:00
|
|
|
echo " This is a helper script which installs the ArchiveBox dependencies on your system using brew/apt/pip3."
|
2019-03-12 17:49:40 -04:00
|
|
|
echo " You may be prompted for a password in order to install the following:"
|
|
|
|
echo ""
|
|
|
|
echo " - python3, python3-pip, python3-distutils"
|
2021-04-23 23:43:41 -04:00
|
|
|
echo " - nodejs, npm (used for singlefile, readability, mercury, and more)"
|
|
|
|
echo " - curl, wget, git, youtube-dl (used for extracting title, favicon, git, media, and more)"
|
|
|
|
echo " - chromium (skips this if any Chrome/Chromium version is already installed)"
|
|
|
|
echo ""
|
2019-03-12 17:49:40 -04:00
|
|
|
echo ""
|
2021-04-23 23:43:41 -04:00
|
|
|
echo " If you'd rather install these manually as-needed, you can find detailed documentation here:"
|
2020-11-23 02:04:39 -05:00
|
|
|
echo " https://github.com/ArchiveBox/ArchiveBox/wiki/Install"
|
2018-06-10 21:58:48 -04:00
|
|
|
echo ""
|
2021-01-22 13:40:14 -05:00
|
|
|
read -p "Press [enter] to continue with the automatic install, or Ctrl+C to cancel..." REPLY
|
2018-06-10 21:58:48 -04:00
|
|
|
echo ""
|
|
|
|
|
|
|
|
# On Linux:
|
|
|
|
if which apt-get > /dev/null; then
|
2021-01-22 13:47:26 -05:00
|
|
|
echo "[+] Adding ArchiveBox apt repo to sources..."
|
2021-04-23 23:43:41 -04:00
|
|
|
if ! (sudo apt install -y software-properties-common && sudo add-apt-repository -u ppa:archivebox/archivebox); then
|
|
|
|
echo "deb http://ppa.launchpad.net/archivebox/archivebox/ubuntu focal main" | sudo tee /etc/apt/sources.list.d/archivebox.list
|
|
|
|
echo "deb-src http://ppa.launchpad.net/archivebox/archivebox/ubuntu focal main" | sudo tee -a /etc/apt/sources.list.d/archivebox.list
|
|
|
|
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys C258F79DCC02E369
|
|
|
|
sudo apt-get update -qq
|
2018-06-10 21:58:48 -04:00
|
|
|
fi
|
2021-04-23 23:43:41 -04:00
|
|
|
echo "[+] Installing ArchiveBox and its dependencies using apt..."
|
|
|
|
# sudo apt install -y git python3 python3-pip python3-distutils wget curl youtube-dl ffmpeg git nodejs npm ripgrep
|
|
|
|
sudo apt-get install -y archivebox
|
|
|
|
sudo apt-get --only-upgrade install -y archivebox
|
2018-06-10 21:58:48 -04:00
|
|
|
|
|
|
|
# On Mac:
|
2021-04-23 23:43:41 -04:00
|
|
|
elif which brew > /dev/null; then
|
|
|
|
echo "[+] Installing ArchiveBox and its dependencies using brew..."
|
|
|
|
brew tap archivebox/archivebox
|
|
|
|
brew update
|
|
|
|
brew install --fetch-HEAD -f archivebox
|
2018-06-10 21:58:48 -04:00
|
|
|
else
|
2021-04-23 23:43:41 -04:00
|
|
|
echo "[!] Warning: Could not find aptitude or homebrew! May not be able to install all dependencies correctly."
|
2018-06-10 21:58:48 -04:00
|
|
|
echo ""
|
|
|
|
echo " If you're on macOS, make sure you have homebrew installed: https://brew.sh/"
|
|
|
|
echo " If you're on Ubuntu/Debian, make sure you have apt installed: https://help.ubuntu.com/lts/serverguide/apt.html"
|
2019-03-11 03:03:35 -04:00
|
|
|
echo " (those are the only currently supported systems for the automatic setup script)"
|
2018-06-10 21:58:48 -04:00
|
|
|
echo ""
|
2021-04-23 23:43:41 -04:00
|
|
|
echo "See the README.md for Manual Setup & Troubleshooting instructions if you you're unable to run ArchiveBox after this script completes."
|
2018-06-10 21:58:48 -04:00
|
|
|
fi
|
|
|
|
|
2021-04-23 23:43:41 -04:00
|
|
|
# echo "[+] Upgrading npm and pip..."
|
|
|
|
# npm i -g npm
|
|
|
|
# pip3 install --upgrade pip setuptools
|
2021-01-22 13:41:16 -05:00
|
|
|
|
2021-04-23 23:43:41 -04:00
|
|
|
echo "[+] Installing ArchiveBox and its dependencies using pip..."
|
2021-01-22 13:41:16 -05:00
|
|
|
pip3 install --upgrade archivebox
|
2020-09-03 11:40:47 -04:00
|
|
|
|
2021-04-23 23:43:41 -04:00
|
|
|
echo "[+] Initializing ArchiveBox data folder at ~/archivebox..."
|
|
|
|
mkdir -p ~/archivebox
|
|
|
|
cd ~/archivebox
|
|
|
|
archivebox init --setup && exit 0
|
2018-06-10 21:58:48 -04:00
|
|
|
|
2019-03-12 17:49:40 -04:00
|
|
|
echo "---------------------------------------------------"
|
2018-06-10 21:58:48 -04:00
|
|
|
echo "[X] Failed to install some dependencies! ‼️"
|
|
|
|
echo " - Try the Manual Setup instructions in the README.md"
|
|
|
|
echo " - Try the Troubleshooting: Dependencies instructions in the README.md"
|
2020-11-23 02:04:39 -05:00
|
|
|
echo " - Open an issue on github to get help: https://github.com/ArchiveBox/ArchiveBox/issues"
|
2018-06-10 21:58:48 -04:00
|
|
|
exit 1
|