#!/bin/bash ##---------------## # Static Vars # ##---------------## APTMODE="debconf-apt-progress -- apt" PKGM="$APTMODE" PKGUD="$PKGM update" PKGUP="$PKGM upgrade -y" PKGI="${PKGM} install -y" REPO=Debian-Immich BRANCH=main GIT=https://git.ictcorpnet.com/b.waal/$REPO/raw TypeSenseAPI=`echo $RANDOM | md5sum | head -c 20; echo;` DBpassword=`echo $RANDOM | md5sum | head -c 20; echo;` ##-----------## # Updater # ##-----------## $PKGUD apt list --upgradeable 2>/dev/null | cut -d/ -f1 | grep -v Listing >> /tmp/install.list ##------------## # Pre-Config # ##------------## echo "htop nano apt-transport-https software-properties-common ca-certificates curl gnupg lsb-release wget" >> /tmp/install.list echo "unattended-upgrades apt-listchanges" >> /tmp/install.list xargs < /tmp/install.list xargs $PKGI rm /tmp/install.list ##-----------## # Installer # ##-----------## curl -fsSL https://download.docker.com/linux/debian/gpg | apt-key add - add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/debian $(lsb_release -cs) stable" $PKGUD echo "docker-ce docker-ce-cli" >> /tmp/install.list xargs < /tmp/install.list xargs $PKGI curl -L "https://github.com/docker/compose/releases/download/v2.12.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose mv /usr/local/bin/docker-compose /usr/bin/docker-compose chmod +x /usr/bin/docker-compose ##--------## # Config # ##--------## mkdir -p /opt/immich cd /opt/immich/ wget https://github.com/immich-app/immich/releases/latest/download/docker-compose.yml wget -O .env https://github.com/immich-app/immich/releases/latest/download/example.env sed -i "s/KEY=some-random-text/KEY=$TypeSenseAPI/g" /opt/test/.env sed -i "s/DB_PASSWORD=postgres/DB_PASSWORD=$DBpassword/g" /opt/test/.env systemctl stop unattended-upgrades wget $GIT/$BRANCH/Unattended-Security-Updates/20auto-upgrades -O /etc/apt/apt.conf.d/20auto-upgrades wget $GIT/$BRANCH/Unattended-Security-Updates/50debian-unattended-upgrades -O /etc/apt/apt.conf.d/50unattended-upgrades systemctl enable --now unattended-upgrades