diff --git a/ressources/picapport/README.MD b/ressources/picapport/README.MD new file mode 100644 index 0000000..4eebbe0 --- /dev/null +++ b/ressources/picapport/README.MD @@ -0,0 +1,46 @@ +#### picapport + +##### Information +Site : https://www.picapport.de/ + +Source : Not available + +##### Install + +```bash +apt install -y --no-install-recommends wget ca-certificates +wget -qO - https://deb.lgy.fr/install.sh | bash +apt-get update +apt-get install -y --no-install-recommends picapport + +systemctl enable --now picapport +``` +##### configure cifs share + +Sample to add net-gallery share on picapport + +```bash +apt install -y cifs-utils +mkdir -p /var/lib/picapport/mnt/net-gallery +``` + +edit /etc/picapport/smbcredentials + +``` +username=username +password=password +domain=domain +``` + +Get picapport user and group id +``` +id picapport +uid=997(picapport) gid=997(picapport) groupes=997(picapport) +``` + +edit /etc/fstab with uid and gid + +``` +//server/share/ /var/lib/picapport/mnt/net-gallery cifs credentials=/etc/picapport/smbcredentials,iocharset=utf8,file_mode=0777,dir_mode=0777,sec=ntlmssp,noacl,uid=997,gid=997 0 0 +``` + diff --git a/ressources/picapport/debmaker b/ressources/picapport/debmaker new file mode 100755 index 0000000..758bbad --- /dev/null +++ b/ressources/picapport/debmaker @@ -0,0 +1,24 @@ +#!/bin/bash + +VERSION=10.4.00 +DEB_VERSION=${VERSION}-$(date +%Y%m%d%H%M) +APP=picapport +DEBIAN_VERSION_CODENAME=bullseye +IMAGE_SIZE=3 + +main(){ + base_package_upgrade + makedeb +} + +makedeb(){ + PATH_DEB=/tmp/src/rootfs + + DOWNLOAD_VERSION=$(echo $VERSION | sed 's/\./-/g') + + mkdir -p $PATH_DEB/usr/lib/picapport/ + wget "https://www.picapport.de/download/${DOWNLOAD_VERSION}/picapport-headless.jar" -O $PATH_DEB/usr/lib/picapport/picapport-headless.jar + + sed -i "s/%VERSION%/$DEB_VERSION/" ${PATH_DEB}/DEBIAN/control + fakeroot dpkg-deb -Z gzip --build ${PATH_DEB} /tmp/dist +} diff --git a/ressources/picapport/rootfs/DEBIAN/changelog b/ressources/picapport/rootfs/DEBIAN/changelog new file mode 100644 index 0000000..e69de29 diff --git a/ressources/picapport/rootfs/DEBIAN/conffiles b/ressources/picapport/rootfs/DEBIAN/conffiles new file mode 100644 index 0000000..18380ad --- /dev/null +++ b/ressources/picapport/rootfs/DEBIAN/conffiles @@ -0,0 +1 @@ +/etc/picapport/picapport.properties diff --git a/ressources/picapport/rootfs/DEBIAN/control b/ressources/picapport/rootfs/DEBIAN/control new file mode 100644 index 0000000..2b79d7a --- /dev/null +++ b/ressources/picapport/rootfs/DEBIAN/control @@ -0,0 +1,8 @@ +Package: picapport +Version: %VERSION% +Section: base +Priority: optional +Architecture: all +Depends: default-jre +Maintainer: Thomas Legay +Description: self-hosting photo server with photo management diff --git a/ressources/picapport/rootfs/DEBIAN/postinst b/ressources/picapport/rootfs/DEBIAN/postinst new file mode 100755 index 0000000..8788aa9 --- /dev/null +++ b/ressources/picapport/rootfs/DEBIAN/postinst @@ -0,0 +1,16 @@ +#!/bin/bash +APP=picapport + +id ${APP} &> /dev/null || useradd ${APP} -r -s /bin/false -d /var/lib/${APP} + +chown ${APP}:${APP} /var/lib/${APP}/ +chown ${APP}:${APP} /var/lib/${APP}/* + +if [[ $(systemctl list-unit-files | grep picapport.services) -eq 0 ]] +then + systemctl daemon-reload + if [ "$(systemctl is-active ${APP}.service)" != "inactive" ] + then + systemctl restart ${APP} + fi +fi diff --git a/ressources/picapport/rootfs/etc/default/picapport b/ressources/picapport/rootfs/etc/default/picapport new file mode 100644 index 0000000..dded39c --- /dev/null +++ b/ressources/picapport/rootfs/etc/default/picapport @@ -0,0 +1,2 @@ +JAVA_ARGS="-Xms256m -Xmx512m -Dpicapport.directory=data" +PICAPPORT_CONF="-configfile=/etc/picapport/picapport.properties" diff --git a/ressources/picapport/rootfs/etc/picapport/.gitkeep b/ressources/picapport/rootfs/etc/picapport/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/ressources/picapport/rootfs/etc/picapport/picapport.properties b/ressources/picapport/rootfs/etc/picapport/picapport.properties new file mode 100644 index 0000000..5131962 --- /dev/null +++ b/ressources/picapport/rootfs/etc/picapport/picapport.properties @@ -0,0 +1,29 @@ +## see https://wiki.picapport.de/display/PICE/PicApport-Server+Guide + +server.port=8080 +gui.enabled=false +user.home=/var/lib/picapport +picapport.directory=data +robot.root.0.id=gallery +robot.root.0.path=/var/lib/picapport/gallery +#robot.check.root.before.db.remove=true + +#server.contextpath= +#server.bind.0=0.0.0.0 +#server.theme=a +#server.photobuffer=3 +#server.autoupdate.photobuffer=100 +#server.external.address.for.shared.links +#server.max.concurrent.imageio=3 +#server.max.concurrent.shares.per.session=3 +#server.cookie.timeout.seconds=8640000 +#server.session.timeout.seconds +#server.admin.remote.command.n +#server.admin.restart.prefix.n +#gui.hideintray +#thumbs.height=160 +#thumbs.mode=0 +#thumbs.num.thumbs.before.pause=250 +#db.max.photos.per.query=2000 +#user.log.access=true +#server.ssl=false diff --git a/ressources/picapport/rootfs/usr/bin/picapport b/ressources/picapport/rootfs/usr/bin/picapport new file mode 100755 index 0000000..ea9e93c --- /dev/null +++ b/ressources/picapport/rootfs/usr/bin/picapport @@ -0,0 +1,4 @@ +#!/usr/bin/env bash +source /etc/default/picapport + +/usr/bin/java ${JAVA_ARGS} -jar /usr/lib/picapport/picapport-headless.jar ${PICAPPORT_CONF} diff --git a/ressources/picapport/rootfs/usr/lib/systemd/system/picapport.service b/ressources/picapport/rootfs/usr/lib/systemd/system/picapport.service new file mode 100644 index 0000000..09bc4d7 --- /dev/null +++ b/ressources/picapport/rootfs/usr/lib/systemd/system/picapport.service @@ -0,0 +1,17 @@ +[Unit] +Description=self-hosting photo server with photo management +After=multi-user.target + +[Service] +User=picapport +Group=picapport +ExecStart=/usr/bin/picapport +SyslogIdentifier=picapport + +Restart=always +RestartSec=10 + +[Install] +WantedBy=multi-user.target + +