Photoprism: Init
This commit is contained in:
parent
a28cfd40ee
commit
31ffd172c6
4 changed files with 123 additions and 0 deletions
51
cfg/jobs/photoprism.run
Executable file
51
cfg/jobs/photoprism.run
Executable file
|
@ -0,0 +1,51 @@
|
|||
#!/bin/env bash
|
||||
# Upstream doc: https://docs.kanboard.org/v1/admin/installation/
|
||||
set -euxo pipefail
|
||||
|
||||
IMAGE="ubuntu/24.04"
|
||||
DIST="${IMAGE%%/*}"
|
||||
VER="${IMAGE#*/}"
|
||||
VER="${VER%/*}"
|
||||
VER="${VER//./-}"
|
||||
UPSTREAM_VER="1.2409.15+240915-e1280b2fb"
|
||||
UPSTREAM_VER_DASH="${UPSTREAM_VER//./-}"
|
||||
UPSTREAM_NAME="photoprism"
|
||||
SERIAL="1benoitjpnet"
|
||||
CNAME="$UPSTREAM_NAME-$UPSTREAM_VER_DASH-$SERIAL-$DIST-$VER"
|
||||
ALIAS="$UPSTREAM_NAME-$UPSTREAM_VER-$SERIAL"
|
||||
|
||||
|
||||
cd "$WORKSPACE"
|
||||
incus launch images:$IMAGE "$CNAME" --quiet
|
||||
|
||||
wait_network "$CNAME"
|
||||
|
||||
incus exec "$CNAME" -- apt update
|
||||
incus exec "$CNAME" -- apt upgrade -y
|
||||
incus exec "$CNAME" -- apt install -y --no-install-recommends wget
|
||||
incus exec "$CNAME" -- wget -q "https://dl.photoprism.app/pkg/linux/deb/photoprism_${UPSTREAM_VER}_amd64.deb" -O /tmp/photoprism.deb
|
||||
incus exec "$CNAME" -- apt install -y /tmp/photoprism.deb syncthing
|
||||
incus exec "$CNAME" -- groupadd photoprism
|
||||
incus exec "$CNAME" -- useradd -g photoprism -d /opt/photoprism -s /bin/false photoprism
|
||||
incus exec "$CNAME" -- mkdir /opt/photoprism/
|
||||
incus exec "$CNAME" -- chown -R photoprism:photoprism /opt/photoprism
|
||||
incus exec "$CNAME" -- mysql -e "CREATE DATABASE photoprism;"
|
||||
incus exec "$CNAME" -- mysql -e "CREATE USER 'photoprism'@'localhost' IDENTIFIED WITH auth_socket;"
|
||||
incus exec "$CNAME" -- mysql -e "GRANT ALL PRIVILEGES ON photoprism.* TO 'photoprism'@'localhost';"
|
||||
incus exec "$CNAME" -- mysql -e "FLUSH PRIVILEGES;"
|
||||
|
||||
incus file push "$WORKSPACE"/defaults.yaml \
|
||||
"$CNAME"/etc/photoprism/
|
||||
incus file push "$WORKSPACE"/{syncthing,photoprism}.service \
|
||||
"$CNAME"/etc/systemd/system/
|
||||
|
||||
incus exec "$CNAME" -- systemctl daemon-reload
|
||||
incus exec "$CNAME" -- systemctl enable syncthing photoprism
|
||||
|
||||
laminarc run incus_publish \
|
||||
CNAME="$CNAME" \
|
||||
UPSTREAM_NAME=$UPSTREAM_NAME \
|
||||
UPSTREAM_VER=$UPSTREAM_VER \
|
||||
IMAGE=$IMAGE \
|
||||
SERIAL=$SERIAL \
|
||||
ALIAS=$ALIAS
|
Loading…
Add table
Add a link
Reference in a new issue