Compare commits

..

No commits in common. "9cfc8e3a62ad33987c5267ada869356cefa5d68c" and "19a6a06f5f9f74cd1f59454a7e4e47e7f5999d29" have entirely different histories.

2 changed files with 108 additions and 29 deletions

View File

@ -20,8 +20,8 @@ header_info
echo -e "Loading..." echo -e "Loading..."
APP="PhotoPrism" APP="PhotoPrism"
var_disk="8" var_disk="8"
var_cpu="2" var_cpu="4"
var_ram="2048" var_ram="4096"
var_os="debian" var_os="debian"
var_version="12" var_version="12"
variables variables
@ -61,9 +61,24 @@ function update_script() {
sudo systemctl stop photoprism sudo systemctl stop photoprism
msg_ok "Stopped PhotoPrism" msg_ok "Stopped PhotoPrism"
msg_info "Updating PhotoPrism" msg_info "Cloning PhotoPrism"
wget -q -cO - https://dl.photoprism.app/pkg/linux/amd64.tar.gz | tar -xzf - -C /opt/photoprism --strip-components=1 cd ~
msg_ok "Updated PhotoPrism" git clone https://github.com/photoprism/photoprism.git &>/dev/null
cd photoprism
git checkout release &>/dev/null
msg_ok "Cloned PhotoPrism"
msg_info "Building PhotoPrism"
sudo make all &>/dev/null
sudo ./scripts/build.sh prod /opt/photoprism/bin/photoprism &>/dev/null
sudo rm -rf /opt/photoprism/assets
sudo cp -r assets/ /opt/photoprism/ &>/dev/null
msg_ok "Built PhotoPrism"
msg_info "Cleaning"
cd ~
rm -rf photoprism
msg_ok "Cleaned"
msg_info "Starting PhotoPrism" msg_info "Starting PhotoPrism"
sudo systemctl start photoprism sudo systemctl start photoprism
@ -76,6 +91,9 @@ start
build_container build_container
description description
msg_info "Setting Container to Normal Resources"
pct set $CTID -memory 2048
msg_ok "Set Container to Normal Resources"
msg_ok "Completed Successfully!\n" msg_ok "Completed Successfully!\n"
echo -e "${APP} should be reachable by going to the following URL. echo -e "${APP} should be reachable by going to the following URL.
${BL}http://${IP}:2342${CL} \n" ${BL}http://${IP}:2342${CL} \n"

View File

@ -17,41 +17,96 @@ msg_info "Installing Dependencies (Patience)"
$STD apt-get install -y curl $STD apt-get install -y curl
$STD apt-get install -y sudo $STD apt-get install -y sudo
$STD apt-get install -y mc $STD apt-get install -y mc
$STD apt-get install -y gcc
$STD apt-get install -y g++
$STD apt-get install -y git
$STD apt-get install -y make
$STD apt-get install -y zip
$STD apt-get install -y exiftool $STD apt-get install -y exiftool
$STD apt-get install -y ffmpeg $STD apt-get install -y ffmpeg
$STD apt-get install -y libheif1 $STD apt-get install -y libheif1
$STD apt-get install -y libpng-dev $STD apt-get install -y ca-certificates
$STD apt-get install -y libjpeg-dev $STD apt-get install -y gnupg
$STD apt-get install -y libtiff-dev
$STD apt-get install -y imagemagick
$STD apt-get install -y darktable
msg_ok "Installed Dependencies" msg_ok "Installed Dependencies"
msg_info "Installing PhotoPrism (Patience)" msg_info "Setting up Node.js Repository"
mkdir -p /opt/photoprism/{cache,photos/originals,photos/import,storage,temp} mkdir -p /etc/apt/keyrings
wget -q -cO - https://dl.photoprism.app/pkg/linux/amd64.tar.gz | tar -xz -C /opt/photoprism --strip-components=1 curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg
if [[ ${PCT_OSTYPE} == "ubuntu" ]]; then echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_18.x nodistro main" >/etc/apt/sources.list.d/nodesource.list
wget -q -cO - https://dl.photoprism.app/dist/libheif/libheif-jammy-amd64-v1.17.1.tar.gz | tar -xzf - -C /usr/local --strip-components=1 msg_ok "Set up Node.js Repository"
msg_info "Installing Node.js"
$STD apt-get update
$STD apt-get install -y nodejs
msg_ok "Installed Node.js"
msg_info "Installing Golang"
set +o pipefail
RELEASE=$(curl -s https://go.dev/dl/ | grep -o "go.*\linux-amd64.tar.gz" | head -n 1)
wget -q https://golang.org/dl/$RELEASE
$STD tar -xzf $RELEASE -C /usr/local
$STD ln -s /usr/local/go/bin/go /usr/local/bin/go
msg_ok "Installed Golang"
msg_info "Installing Go Dependencies"
$STD go install github.com/tianon/gosu@latest
$STD go install golang.org/x/tools/cmd/goimports@latest
$STD go install github.com/psampaz/go-mod-outdated@latest
$STD go install github.com/dsoprea/go-exif/v3/command/exif-read-tool@latest
$STD go install github.com/mikefarah/yq/v4@latest
$STD go install github.com/kyoh86/richgo@latest
cp /root/go/bin/* /usr/local/go/bin/
cp /usr/local/go/bin/richgo /usr/local/bin/richgo
cp /usr/local/go/bin/gosu /usr/local/sbin/gosu
chown root:root /usr/local/sbin/gosu
chmod 755 /usr/local/sbin/gosu
msg_ok "Installed Go Dependencies"
msg_info "Installing Tensorflow"
if grep -q avx2 /proc/cpuinfo; then
suffix="avx2-"
elif grep -q avx /proc/cpuinfo; then
suffix="avx-"
else else
wget -q -cO - https://dl.photoprism.app/dist/libheif/libheif-bookworm-amd64-v1.17.1.tar.gz | tar -xzf - -C /usr/local --strip-components=1 suffix="1"
fi fi
version=$(curl -s https://dl.photoprism.org/tensorflow/amd64/ | grep -o "libtensorflow-amd64-$suffix.*\\.tar.gz" | head -n 1)
wget -q https://dl.photoprism.org/tensorflow/amd64/$version
tar -C /usr/local -xzf $version
ldconfig ldconfig
cat <<EOF >/opt/photoprism/config/.env set -o pipefail
msg_ok "Installed Tensorflow"
msg_info "Cloning PhotoPrism"
mkdir -p /opt/photoprism/bin
mkdir -p /var/lib/photoprism/storage
$STD git clone https://github.com/photoprism/photoprism.git
cd photoprism
$STD git checkout release
msg_ok "Cloned PhotoPrism"
msg_info "Building PhotoPrism (Patience)"
$STD make -B
$STD ./scripts/build.sh prod /opt/photoprism/bin/photoprism
$STD cp -r assets/ /opt/photoprism/
msg_ok "Built PhotoPrism"
env_path="/var/lib/photoprism/.env"
echo "
PHOTOPRISM_AUTH_MODE='password' PHOTOPRISM_AUTH_MODE='password'
PHOTOPRISM_ADMIN_PASSWORD='changeme' PHOTOPRISM_ADMIN_PASSWORD='changeme'
PHOTOPRISM_HTTP_HOST='0.0.0.0' PHOTOPRISM_HTTP_HOST='0.0.0.0'
PHOTOPRISM_HTTP_PORT='2342' PHOTOPRISM_HTTP_PORT='2342'
PHOTOPRISM_SITE_CAPTION='https://tteck.github.io/Proxmox/' PHOTOPRISM_SITE_CAPTION='https://tteck.github.io/Proxmox/'
PHOTOPRISM_STORAGE_PATH='/opt/photoprism/storage' PHOTOPRISM_STORAGE_PATH='/var/lib/photoprism/storage'
PHOTOPRISM_ORIGINALS_PATH='/opt/photoprism/photos/originals' PHOTOPRISM_ORIGINALS_PATH='/var/lib/photoprism/photos/Originals'
PHOTOPRISM_IMPORT_PATH='/opt/photoprism/photos/import' PHOTOPRISM_IMPORT_PATH='/var/lib/photoprism/photos/Import'
EOF " >$env_path
msg_ok "Installed PhotoPrism"
msg_info "Creating Service" msg_info "Creating Service"
cat <<EOF >/etc/systemd/system/photoprism.service service_path="/etc/systemd/system/photoprism.service"
[Unit]
echo "[Unit]
Description=PhotoPrism service Description=PhotoPrism service
After=network.target After=network.target
@ -59,14 +114,12 @@ After=network.target
Type=forking Type=forking
User=root User=root
WorkingDirectory=/opt/photoprism WorkingDirectory=/opt/photoprism
EnvironmentFile=/opt/photoprism/config/.env EnvironmentFile=/var/lib/photoprism/.env
ExecStart=/opt/photoprism/bin/photoprism up -d ExecStart=/opt/photoprism/bin/photoprism up -d
ExecStop=/opt/photoprism/bin/photoprism down ExecStop=/opt/photoprism/bin/photoprism down
[Install] [Install]
WantedBy=multi-user.target WantedBy=multi-user.target" >$service_path
EOF
systemctl enable -q --now photoprism
msg_ok "Created Service" msg_ok "Created Service"
motd_ssh motd_ssh
@ -75,4 +128,12 @@ customize
msg_info "Cleaning up" msg_info "Cleaning up"
$STD apt-get autoremove $STD apt-get autoremove
$STD apt-get autoclean $STD apt-get autoclean
rm -rf /var/{cache,log}/* \
/photoprism \
/$RELEASE \
/$version
msg_ok "Cleaned" msg_ok "Cleaned"
msg_info "Starting PhotoPrism"
systemctl enable -q --now photoprism
msg_ok "Started PhotoPrism"