diff --git a/cfg/jobs/photoprism.run b/cfg/jobs/photoprism.run index eb119df..c726696 100755 --- a/cfg/jobs/photoprism.run +++ b/cfg/jobs/photoprism.run @@ -10,7 +10,7 @@ VER="${VER//./-}" UPSTREAM_VER="1.2502.24+250224-834c16bc7" UPSTREAM_VER_DASH="${UPSTREAM_VER//[.+]/-}" UPSTREAM_NAME="photoprism" -SERIAL="1benoitjpnet" +SERIAL="2benoitjpnet" CNAME="$UPSTREAM_NAME-$UPSTREAM_VER_DASH-$SERIAL-$DIST-$VER" ALIAS="$UPSTREAM_NAME-$UPSTREAM_VER-$SERIAL" @@ -28,17 +28,18 @@ 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" -- chown -R photoprism:photoprism /opt/photoprism +set +x MARIADB_PASS=$(openssl rand -hex 32) PHOTOPRISM_PASS=$(openssl rand -hex 32) incus exec "$CNAME" -- mysql -e "CREATE DATABASE photoprism;" incus exec "$CNAME" -- mysql -e "CREATE USER 'photoprism'@'localhost' IDENTIFIED BY '$MARIADB_PASS';" incus exec "$CNAME" -- mysql -e "GRANT ALL PRIVILEGES ON photoprism.* TO 'photoprism'@'localhost';" incus exec "$CNAME" -- mysql -e "FLUSH PRIVILEGES;" - -incus file push <(sed -e "s/SED_DATABASE_PASSWORD/$MARIADB_PASS/" -e "s/SED_ADMIN_PASSWORD/$PHOTOPRISM_PASS/" "$WORKSPACE"/defaults.yaml) \ +incus file push <(sed -e "s/SED_DATABASE_PASSWORD/$MARIADB_PASS/" -e "s/SED_ADMIN_PASSWORD/$PHOTOPRISM_PASS/" "$WORKSPACE"/defaults.yml) \ "$CNAME"/etc/photoprism/defaults.yml incus file push "$WORKSPACE"/{syncthing,photoprism}.service \ "$CNAME"/etc/systemd/system/ +set -x incus exec "$CNAME" -- systemctl daemon-reload incus exec "$CNAME" -- systemctl enable syncthing photoprism