|:.:.:.:.:.:.:.:.:/.:.:.:.:.:./.:.:.:.:.:.:.:.:.:.:.:.:.:./|   '. :.:.:.:.:.:.:.:.:.:.l.ヽ:.:.:.:.l:.:.:.:.:.:.:.:.:.:∧\:.:.:.',
          |:.:.:.:.:.:.:./.:.:.:.:.:./.:.:.:.:.:.:.:.:.:.:.:.: , ′   l :.:.:.:.:.:.:.:.:.:| ∨.:.:.l:.:.:.:.:.:.:.:.:.:.∧ \:.'.
          |:.:.:.:.:.:/.:.:.:.:.: /.:.:.:.:.:.:.:.:. ヽ/ /    |:.:.:.:.:.:.:./:.:.|   y'.:.:|:.:.:.:.|:.:.:.:.:.:.∧   ヘ.
          |:.:.:.:./.:.:.:.//.:.:.:.:.:.:.:.:.:.:/ \,′   !:.:.:.:.:.:/|:.:./,/ '.:.:| :.:.:.|:.:.:.:.:.:.:.:.|
          |:.:.:/.:.:./.:./.:.:.:.:.:.:.:.:./   /` ‐-‐'|:.:.:./ |ァ'´    |:.:| :.:.:.|:.:.:.:.:.:.:.:.|
          |:.:.i.:.:./.:.:.: '.:.:.:.:.:.:.:/   ,/       |:.:.:/   ′    }.:.| :.:.:.|:.:.:.| :.:.:.:|
          |:.:.|:./.: rヘ|:.:.:.:.:.:/:.| 三三三三三  |:./   三三三 ハ|:.:.:.:.|:.:.:.| :.:.:.:|
          |:.:.l〃.:{  |:.:.:.:./.:.:.|             l.'         .i.:.:.i.:.:.:∧ :.:|ヽ :.:|
          |:.:./.:.:.:.\|:.:.:/.:.:.:.:|                '       |:.:.||:.:/  :.:.| '.:.:l
          |:./.:.:.:.:.:.:. !:./.:.:.:.:.:.'、            ,.ー--、    }.:.:|レ′ ∨  V
          |/.:.:.:.:.:.:.:.:V '´  ̄`ヽ.、            ´`¨¨{. |_.  '.:.:.:.|
         /.:.:.:.:.:.:.:./         ヘ `    . __. -r1 |:.:.:.:.:.:.:.:.|
         :.:.:.:.:.:.:, '         '. \    | _.   -┴ー──┴┐
         :.:.:.:.:./           |  \  r' |   -──────i'
    

< KONAKONA.MOE >

How to Install Photoview (Native, on Debian with SQLite)

Last Mod.: 2024-06-05 | Created On: 2024-05-21


Photoview seems okay but for some reason it was fucking up the dates but I’ll leave this here as a filler. I started using Immich now with Docker.

Install Dependencies

1apt install git curl wget \
2    software-properties-common \
3    libdlib-dev libblas-dev libatlas-base-dev liblapack-dev build-essential libdlib-dev libblas-dev libatlas-base-dev liblapack-dev libjpeg-dev libheif-dev pkg-config gpg \
4    darktable ffmpeg exiftool \
5    golang

Install Node.js

https://github.com/nodesource/distributions

1apt install nodejs

Download and Build Photoview

1cd /opt
2git clone https://github.com/photoview/photoview.git
3cd photoview/

Build the Web UI

1cd ui/
2npm install
3npm run build

Compile the Backend with Go

1cd ../api/
2go build -v -o photoview .

Now Copy the Files to a Newly Created app Folder

1cd ..
2mkdir app
3cp -r ui/dist/ app/ui/
4cp api/photoview app/photoview
5cp -r api/data/ app/data/

Create an Environment File

/etc/photoview.env

 1# Copy this file to .env
 2
 3PHOTOVIEW_DATABASE_DRIVER=sqlite
 4#PHOTOVIEW_MYSQL_URL=user:password@tcp(localhost)/dbname
 5
 6# Specifies the connection string for the postgres database, if PHOTOVIEW_DATABASE_DRIVER is set to 'postgres'
 7# See https://www.postgresql.org/docs/current/libpq-ssl.html for possible ssl modes
 8# PHOTOVIEW_POSTGRES_URL=postgres://user:password@host:port/dbname?sslmode=(disable|allow|...)
 9
10# Specifies the filepath for the sqlite database, if PHOTOVIEW_DATABASE_DRIVER is set to 'sqlite'
11PHOTOVIEW_SQLITE_PATH=/var/lib/share/photoview/photoview.db
12
13PHOTOVIEW_LISTEN_IP=0.0.0.0
14PHOTOVIEW_LISTEN_PORT=4001
15
16# The url from which the server can be accessed publicly
17#PHOTOVIEW_API_ENDPOINT=http://localhost:4001/
18#PHOTOVIEW_UI_ENDPOINT=http://localhost:1234/
19
20# Path where media should be cached, defaults to ./media_cache
21PHOTOVIEW_MEDIA_CACHE=/var/lib/share/photoview/media_cache
22
23# Set to 1 for the server to also serve the built static ui files
24PHOTOVIEW_SERVE_UI=1
25
26# Enter a valid mapbox token, to enable maps feature
27# A token can be created for free at https://mapbox.com
28#MAPBOX_TOKEN=<insert mapbox token here>
29
30# Set to 1 to set server in development mode, this enables graphql playground
31# Remove this if running in production
32PHOTOVIEW_DEVELOPMENT_MODE=0

/var/lib/share/photoview = ~share/photoview by the way, so /var/lib/share/photoview/photoview.db is just ~share/photoview/photoview.db, lol I don’t have anything on /home.

This was taken from ./api/example.env.

More variables: https://photoview.github.io/en/docs/installation-environment-variables/

Create the SystemD Service

Most of the schizo garbage on the guys page can be ignored, I don’t know what the fuck he was doing, maybe its some Ubuntu shit idfk or care to be honest.

/usr/lib/systemd/system/photoview.service

 1[Unit]
 2Description=Photoview - Photo gallery for self-hosted personal servers
 3Documentation=https://photoview.github.io/docs
 4After=network.target
 5
 6[Service]
 7ExecStart=/opt/photoview/app/photoview
 8UMask=007
 9User=share
10Group=share
11WorkingDirectory=/opt/photoview/app
12ReadWritePaths=/var/lib/share/photoview
13CacheDirectory=photoview/media_cache
14EnvironmentFile=/etc/photoview.env
15
16[Install]
17WantedBy=multi-user.target

Change share to which user owns and can see your files the files.

/var/lib/share/photoview = ~share/photoview

Start Photoview

Before starting make sure to mkdir the folders inside ~share like idk mkdir -p ~share/photoview chown it and set permissions with chmod if you’re using root too, and remember the change share to your user. Oh and also make the media_cache (~share/photoview/media_cache) folder.

1systemctl daemon-reload
2systemctl enable --now photoprism

Your instance should be on <IP>:4001 because we set it to 0.0.0.0


Prev:
How to Install Photoprism (Natively on Debian)
Next:
HomeLab Backup Script