mirror of
https://github.com/ArchiveBox/ArchiveBox.git
synced 2025-05-13 14:44:29 -04:00
Update setup.sh
This commit is contained in:
parent
98b11eb6d4
commit
b7bf9644de
1 changed files with 36 additions and 81 deletions
117
bin/setup.sh
117
bin/setup.sh
|
@ -2,20 +2,24 @@
|
||||||
# ArchiveBox Setup Script
|
# ArchiveBox Setup Script
|
||||||
# https://github.com/ArchiveBox/ArchiveBox
|
# https://github.com/ArchiveBox/ArchiveBox
|
||||||
|
|
||||||
|
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
|
||||||
echo "[i] ArchiveBox Setup Script 📦"
|
echo "[i] ArchiveBox Setup Script 📦"
|
||||||
echo ""
|
echo ""
|
||||||
echo " This is a helper script which installs the ArchiveBox dependencies on your system using homebrew/aptitude."
|
echo " This is a helper script which installs the ArchiveBox dependencies on your system using brew/apt/pip3."
|
||||||
echo " You may be prompted for a password in order to install the following:"
|
echo " You may be prompted for a password in order to install the following:"
|
||||||
echo ""
|
echo ""
|
||||||
echo " - python3, python3-pip, python3-distutils"
|
echo " - python3, python3-pip, python3-distutils"
|
||||||
echo " - curl"
|
echo " - nodejs, npm (used for singlefile, readability, mercury, and more)"
|
||||||
echo " - wget"
|
echo " - curl, wget, git, youtube-dl (used for extracting title, favicon, git, media, and more)"
|
||||||
echo " - git"
|
echo " - chromium (skips this if any Chrome/Chromium version is already installed)"
|
||||||
echo " - youtube-dl"
|
|
||||||
echo " - chromium-browser (skip this if Chrome/Chromium is already installed)"
|
|
||||||
echo " - nodejs (used for singlefile, readability, mercury, and more)"
|
|
||||||
echo ""
|
echo ""
|
||||||
echo " If you'd rather install these manually, you can find documentation here:"
|
echo ""
|
||||||
|
echo " If you'd rather install these manually as-needed, you can find detailed documentation here:"
|
||||||
echo " https://github.com/ArchiveBox/ArchiveBox/wiki/Install"
|
echo " https://github.com/ArchiveBox/ArchiveBox/wiki/Install"
|
||||||
echo ""
|
echo ""
|
||||||
read -p "Press [enter] to continue with the automatic install, or Ctrl+C to cancel..." REPLY
|
read -p "Press [enter] to continue with the automatic install, or Ctrl+C to cancel..." REPLY
|
||||||
|
@ -24,93 +28,44 @@ echo ""
|
||||||
# On Linux:
|
# On Linux:
|
||||||
if which apt-get > /dev/null; then
|
if which apt-get > /dev/null; then
|
||||||
echo "[+] Adding ArchiveBox apt repo to sources..."
|
echo "[+] Adding ArchiveBox apt repo to sources..."
|
||||||
sudo apt install software-properties-common
|
if ! (sudo apt install -y software-properties-common && sudo add-apt-repository -u ppa:archivebox/archivebox); then
|
||||||
sudo add-apt-repository -u ppa:archivebox/archivebox
|
echo "deb http://ppa.launchpad.net/archivebox/archivebox/ubuntu focal main" | sudo tee /etc/apt/sources.list.d/archivebox.list
|
||||||
echo "[+] Installing python3, wget, curl..."
|
echo "deb-src http://ppa.launchpad.net/archivebox/archivebox/ubuntu focal main" | sudo tee -a /etc/apt/sources.list.d/archivebox.list
|
||||||
sudo apt install -y git python3 python3-pip python3-distutils wget curl youtube-dl nodejs npm ripgrep
|
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys C258F79DCC02E369
|
||||||
# sudo apt install archivebox
|
sudo apt-get update -qq
|
||||||
|
|
||||||
if which google-chrome; then
|
|
||||||
echo "[i] You already have google-chrome installed, if you would like to download chromium instead (they work pretty much the same), follow the Manual Setup instructions"
|
|
||||||
google-chrome --version
|
|
||||||
elif which chromium-browser; then
|
|
||||||
echo "[i] chromium-browser already installed, using existing installation."
|
|
||||||
chromium-browser --version
|
|
||||||
elif which chromium; then
|
|
||||||
echo "[i] chromium already installed, using existing installation."
|
|
||||||
chromium --version
|
|
||||||
else
|
|
||||||
echo "[+] Installing chromium..."
|
|
||||||
sudo apt install chromium || sudo apt install chromium-browser
|
|
||||||
fi
|
fi
|
||||||
|
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
|
||||||
|
|
||||||
# On Mac:
|
# On Mac:
|
||||||
elif which brew > /dev/null; then # 🐍 eye of newt
|
elif which brew > /dev/null; then
|
||||||
echo "[+] Installing python3, wget, curl (ignore 'already installed' warnings)..."
|
echo "[+] Installing ArchiveBox and its dependencies using brew..."
|
||||||
brew install git wget curl youtube-dl ripgrep node
|
brew tap archivebox/archivebox
|
||||||
if which python3; then
|
brew update
|
||||||
if python3 -c 'import sys; raise SystemExit(sys.version_info < (3,5,0))'; then
|
brew install --fetch-HEAD -f archivebox
|
||||||
echo "[√] Using existing $(which python3)..."
|
|
||||||
else
|
else
|
||||||
echo "[+] Installing python3..."
|
echo "[!] Warning: Could not find aptitude or homebrew! May not be able to install all dependencies correctly."
|
||||||
brew install python3
|
|
||||||
fi
|
|
||||||
else
|
|
||||||
echo "[+] Installing python3..."
|
|
||||||
brew install python3
|
|
||||||
fi
|
|
||||||
|
|
||||||
if ls /Applications/Google\ Chrome*.app > /dev/null; then
|
|
||||||
echo "[√] Using existing /Applications/Google Chrome.app"
|
|
||||||
elif ls /Applications/Chromium.app; then
|
|
||||||
echo "[√] Using existing /Applications/Chromium.app"
|
|
||||||
elif which chromium-browser; then
|
|
||||||
echo "[√] Using existing $(which chromium-browser)"
|
|
||||||
elif which chromium; then
|
|
||||||
echo "[√] Using existing $(which chromium)"
|
|
||||||
else
|
|
||||||
echo "[+] Installing chromium..."
|
|
||||||
brew cask install chromium
|
|
||||||
fi
|
|
||||||
else
|
|
||||||
echo "[X] Could not find aptitude or homebrew! ‼️"
|
|
||||||
echo ""
|
echo ""
|
||||||
echo " If you're on macOS, make sure you have homebrew installed: https://brew.sh/"
|
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"
|
echo " If you're on Ubuntu/Debian, make sure you have apt installed: https://help.ubuntu.com/lts/serverguide/apt.html"
|
||||||
echo " (those are the only currently supported systems for the automatic setup script)"
|
echo " (those are the only currently supported systems for the automatic setup script)"
|
||||||
echo ""
|
echo ""
|
||||||
echo "See the README.md for Manual Setup & Troubleshooting instructions."
|
echo "See the README.md for Manual Setup & Troubleshooting instructions if you you're unable to run ArchiveBox after this script completes."
|
||||||
exit 1
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
npm i -g npm
|
# echo "[+] Upgrading npm and pip..."
|
||||||
pip3 install --upgrade pip setuptools
|
# npm i -g npm
|
||||||
|
# pip3 install --upgrade pip setuptools
|
||||||
|
|
||||||
|
echo "[+] Installing ArchiveBox and its dependencies using pip..."
|
||||||
pip3 install --upgrade archivebox
|
pip3 install --upgrade archivebox
|
||||||
npm install -g 'git+https://github.com/ArchiveBox/ArchiveBox.git'
|
|
||||||
|
|
||||||
# Check:
|
echo "[+] Initializing ArchiveBox data folder at ~/archivebox..."
|
||||||
echo ""
|
mkdir -p ~/archivebox
|
||||||
echo "[*] Checking installed versions:"
|
cd ~/archivebox
|
||||||
echo "---------------------------------------------------"
|
archivebox init --setup && exit 0
|
||||||
which python3 &&
|
|
||||||
python3 --version | head -n 1 &&
|
|
||||||
echo "" &&
|
|
||||||
which git &&
|
|
||||||
git --version | head -n 1 &&
|
|
||||||
echo "" &&
|
|
||||||
which wget &&
|
|
||||||
wget --version | head -n 1 &&
|
|
||||||
echo "" &&
|
|
||||||
which curl &&
|
|
||||||
curl --version | head -n 1 &&
|
|
||||||
echo "" &&
|
|
||||||
which youtube-dl &&
|
|
||||||
youtube-dl --version | head -n 1 &&
|
|
||||||
echo "---------------------------------------------------" &&
|
|
||||||
archivebox version &&
|
|
||||||
echo "[√] All dependencies installed. ✅" &&
|
|
||||||
exit 0
|
|
||||||
|
|
||||||
echo "---------------------------------------------------"
|
echo "---------------------------------------------------"
|
||||||
echo "[X] Failed to install some dependencies! ‼️"
|
echo "[X] Failed to install some dependencies! ‼️"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue