Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update installation-manual.md and installation-systemd.md #30

Open
wants to merge 22 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
c792135
Update installation-manual.md: Change path ui/build to ui/dist
shotcollin Jul 13, 2024
10c070d
Update installation-systemd.md: Change path ui/build to ui/dist
shotcollin Jul 13, 2024
f07e3f4
Update installation-manual.md: add zlib1g-dev to dependencies (requir…
shotcollin Jul 13, 2024
77ab1b0
Update installation-manual.md: Add note referring to systemd instruct…
shotcollin Jul 13, 2024
3279a35
Update installation-systemd.md: Correct typos
shotcollin Jul 13, 2024
9159f24
Update installation-manual.md: Fix typo
shotcollin Jul 14, 2024
c293407
Update installation-systemd.md: Add step to create photoview user and…
shotcollin Jul 14, 2024
3bc21e9
Update installation-systemd.md: Add chown commands to synopsis of steps
shotcollin Jul 14, 2024
26b01c5
Update installation-systemd.md: Move steps re sqlite to end of synops…
shotcollin Jul 14, 2024
0df9c0f
Update installation-manual.md: Change format of note under Copy neede…
shotcollin Jul 14, 2024
e32921f
Update installation-manual.md: Add note with env file location in Con…
shotcollin Jul 14, 2024
54a71df
Update installation-manual.md: Add instruction to comment ReadWritePa…
shotcollin Jul 14, 2024
910a11e
Update installation-systemd.md: Add instruction to comment ReadWriteP…
shotcollin Jul 14, 2024
2daa7b5
Merge branch 'master' of github.com:shotcollin/photoview.github.io
shotcollin Jul 14, 2024
0bd3955
Update installation-systemd.md: Change path ui/build to ui/dist
shotcollin Jul 14, 2024
b5cbad3
Update installation-systemd.md: Add step to create photoview user and…
shotcollin Jul 14, 2024
efb48c0
Update installation-systemd.md: Add chown commands to synopsis of ste…
shotcollin Jul 14, 2024
3e29a96
Update installation-systemd.md: Add instruction to remove ReadWritePa…
shotcollin Jul 14, 2024
9ff8313
Update installation-manual.md: Change path ui/build to ui/dist
shotcollin Jul 14, 2024
9c6c5be
Update installation-manual.md: add zlib1g-dev to dependencies (requir…
shotcollin Jul 14, 2024
2cb59ce
Update installation-manual.md: Change Node 16 to Node 18
shotcollin Jul 14, 2024
fac115f
Update installation-manual.md: Add note referring to systemd instruct…
shotcollin Jul 14, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 10 additions & 6 deletions src/en/docs/installation-manual.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ $ sudo add-apt-repository ppa:strukturag/libde265

# Install dependencies required to build and run Photoview
$ sudo apt install libdlib-dev libblas-dev libatlas-base-dev liblapack-dev libjpeg-turbo8-dev build-essential \
libdlib19 libdlib-dev libblas-dev libatlas-base-dev liblapack-dev libjpeg-dev libheif-dev pkg-config gpg
libdlib19 libdlib-dev libblas-dev libatlas-base-dev liblapack-dev libjpeg-dev libheif-dev pkg-config gpg zlib1g-dev
```

Install Golang by following the instructions for Linux from their [Download and install Go](https://golang.org/doc/install) page, the steps should be something like the following.
Expand All @@ -48,10 +48,10 @@ $ go version
# Expected output: go version go1.16 linux/amd64
```

Now install Node 16 and NPM if you've not done so already (it installs npm automatically)
Now install Node 18 and NPM if you've not done so already (it installs npm automatically)

```shell
$ curl -fsSL https://deb.nodesource.com/setup_16.x | sudo -E bash -
$ curl -fsSL https://deb.nodesource.com/setup_18.x | sudo -E bash -
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd recommend installing Node using NVM, as installing it this way integrates Node into the OS softly and provides much more flexibility

$ sudo apt install nodejs
```

Expand All @@ -73,7 +73,7 @@ $ npm install
$ npm run build
```

This builds the UI source code and saves it in the `ui/build/` directory.
This builds the UI source code and saves it in the `ui/dist/` directory.

### Build the API back-end

Expand All @@ -86,17 +86,19 @@ This builds the server executable to `api/photoview`.

### Copy needed files

> Note: To run Photoview as a `systemd` service, copy files as outlined in the [systemd installation guide](/{{ locale }}/docs/installation-systemd/). Otherwise, follow the steps here.

Make a new directory and move the needed files to it.

```shell
$ cd /opt/photoview
$ mkdir app
$ cp -r ui/build/ app/ui/
$ cp -r ui/dist/ app/ui/
$ cp api/photoview app/photoview
$ cp -r api/data/ app/data/
```

## Setup database
## Set up database

> It's highly recommended to configure a full database,
> but Sqlite is also supported though it might be substantially slower on big media libraries.
Expand Down Expand Up @@ -127,6 +129,8 @@ We will use that to configure Photoview.

Copy the `api/example.env` file to the output directory, and name it `.env`.

> Note: If running Photoview as a `systemd` service, the file containing environment variables is `/etc/photoview.env` and is created in the steps outlined in the [systemd installation guide](/{{ locale }}/docs/installation-systemd/).

```shell
$ cp api/example.env app/.env
```
Expand Down
17 changes: 11 additions & 6 deletions src/en/docs/installation-systemd.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ You can optionally use `systemd` to manage photoview and start the program at bo
It also allows the program to run as its own system user, enhancing the security of the process.


To get started, follow the [Manual Setup Installation guild](/{{ locale }}/docs/installation-manual/).
When you get to the _Copy needed files section_, replace those steps with the steps listed below.
To get started, follow the [Manual Setup Installation guide](/{{ locale }}/docs/installation-manual/).
When you get to the _Copy needed files_ section, replace those steps with the steps listed below.

## Using with `systemd`

Expand All @@ -29,11 +29,13 @@ If you do so, the `photoview.service` and `photoview.tmpfiles` will need to be a

> Reminder: These steps replace [Copy needed files](#copy-needed-files) from the manual installation guide.

1. Create the `photoview` user and group
- `$ sudo adduser photoview --system --group --no-create-home`
1. Copy `systemd` files:
- `systemd/photoview.service` to `/etc/systemd/system/multi-user.target/photoview.service`
- `systemd/photoview.sysusers.conf` to `/usr/lib/sysusers.d/photoview.conf`
- `systemd/photoview.tmpfiles` to `/usr/lib/tmpfiles.d/photoview.conf`
> If you do not plan to use `sqlite`, remove the 2nd line from `systemd/photoview.tmpfiles` before copying.
> If you do not plan to use `sqlite`, remove the 2nd line from `systemd/photoview.tmpfiles` and comment out the line `ReadWritePaths=/var/lib/photoview` in `systemd/photoview.service` before copying.
1. Make the directories where the program files will be placed :
> Note: The `install` command, as demonstrated below, creates these required directories for you.
- `/usr/share/webapps/photoview-ui`
Expand All @@ -49,20 +51,23 @@ If you do so, the `photoview.service` and `photoview.tmpfiles` will need to be a

A synopsis of the previous steps by example:
```shell
$ sudo adduser photoview --system --group --no-create-home
$ cd /opt/photoview
$ sudo install -Dm0644 -t "/usr/lib/systemd/system" "/opt/photoview/systemd/photoview.service"
$ sudo install -Dm0644 "/opt/photoview/systemd/photoview.sysusers.conf" "/usr/lib/sysusers.d/photoview.conf"
$ sudo install -Dm0644 "/opt/photoview/systemd/photoview.tmpfiles" "/usr/lib/tmpfiles.d/photoview.conf"
$ sudo install -d "/var/cache/photoview/media_cache"
# The next line is if you plan to use `sqlite`
$ sudo install -d "/var/lib/photoview"
$ cd /opt/photoview/ui/build
$ sudo chown -R photoview:photoview /var/cache/photoview
$ cd /opt/photoview/ui/dist
$ sudo find * -type f -exec install -Dm0644 "{}" "/usr/share/webapps/photoview-ui/{}" \;
$ cd /opt/photoview/api
$ sudo install -Dm0755 -t "/usr/lib/photoview" "/opt/photoview/api/photoview"
$ sudo ln -s /usr/lib/photoview/photoview /usr/bin/photoview
$ sudo find data -type f -exec install -Dm0644 "{}" "/usr/lib/photoview/{}" \;
$ sudo install -Dm0644 "/opt/photoview/api/example.env" "/etc/photoview.env"
# The next two lines are if you plan to use `sqlite`
$ sudo install -d "/var/lib/photoview"
$ sudo chown -R photoview:photoview /var/lib/photoview
```
### Using the `systemd` unit file

Expand Down
12 changes: 7 additions & 5 deletions src/fr/docs/installation-manual.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ $ sudo add-apt-repository ppa:strukturag/libde265

# Installation des dépendances nécessaires pour Photoview
$ sudo apt install libdlib-dev libblas-dev libatlas-base-dev liblapack-dev libjpeg-turbo8-dev build-essential \
libdlib19 libdlib-dev libblas-dev libatlas-base-dev liblapack-dev libjpeg-dev libheif-dev pkg-config gpg
libdlib19 libdlib-dev libblas-dev libatlas-base-dev liblapack-dev libjpeg-dev libheif-dev pkg-config gpg zlib1g-dev
```

Installez ensuite Golang en suivant les instructions pour Linux depuis leur page [Download and install Go](https://golang.org/doc/install), cela devrait ressembler aux commandes suivantes :
Expand All @@ -47,10 +47,10 @@ $ go version
# Expected output: go version go1.16 linux/amd64
```

Maintenant, installez Node 16 et NPM si vous ne les avez pas déjà installés sur votre système.
Maintenant, installez Node 18 et NPM si vous ne les avez pas déjà installés sur votre système.

```shell
$ curl -fsSL https://deb.nodesource.com/setup_16.x | sudo -E bash -
$ curl -fsSL https://deb.nodesource.com/setup_18.x | sudo -E bash -
$ sudo apt install nodejs
```

Expand All @@ -72,7 +72,7 @@ $ npm install
$ npm run build
```

Cela build le code source de l'UI et l'enregistre dans le répertoire `ui/build/`.
Cela build le code source de l'UI et l'enregistre dans le répertoire `ui/dist/`.

### Buildez l'API back-end

Expand All @@ -85,12 +85,14 @@ Cela build l'executable côté serveur et l'enregistre dans `api/photoview`.

### Copiez UI et back-end au bon endroit

> Si vous choisissez d'utiliser `systemd`, suivez le [Utilisation avec systemd](/{{ locale }}/docs/installation-systemd/).

Créez un nouveau répertoire et deplacez les fichiers créés dedans.

```shell
$ cd /opt/photoview
$ mkdir app
$ cp -r ui/build/ app/ui/
$ cp -r ui/dist/ app/ui/
$ cp api/photoview app/photoview
$ cp -r api/data/ app/data/
```
Expand Down
13 changes: 9 additions & 4 deletions src/fr/docs/installation-systemd.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,13 @@ Il faudra alors faire attention de répercuter ces changement dans les variables

> Rappel : Ces étapes remplacent celles de la rubrique _Copiez UI et back-end au bon endroit_ du guide d'installation manuelle.

1. Créez l'utilisateur et le groupe `photoview`:
- `$ sudo adduser photoview --system --group --no-create-home`
1. Copiez les fichiers `systemd`:
- `systemd/photoview.service` vers `/etc/systemd/system/multi-user.target/photoview.service`
- `systemd/photoview.sysusers.conf` vers `/usr/lib/sysusers.d/photoview.conf`
- `systemd/photoview.tmpfiles` vers `/usr/lib/tmpfiles.d/photoview.conf`
> Si vous n'utilisez pas `sqlite`, supprimez la 2ème ligne de `systemd/photoview.tmpfiles` avant la copie.
> Si vous n'utilisez pas `sqlite`, supprimez la 2ème ligne de `systemd/photoview.tmpfiles` et la ligne `ReadWritePaths=/var/lib/photoview` de `systemd/photoview.service` avant la copie.
1. Créez les répertoires dans lesquels les fichiers du programme seront placés :
> A noter : la commande `install`, comme expliqué ci-dessous, crée les répertoires requis.
- `/usr/share/webapps/photoview-ui`
Expand All @@ -50,20 +52,23 @@ Il faudra alors faire attention de répercuter ces changement dans les variables

Exemple de ce que donnent ces étapes :
```shell
$ sudo adduser photoview --system --group --no-create-home
$ cd /opt/photoview
$ sudo install -Dm0644 -t "/usr/lib/systemd/system" "/opt/photoview/systemd/photoview.service"
$ sudo install -Dm0644 "/opt/photoview/systemd/photoview.sysusers.conf" "/usr/lib/sysusers.d/photoview.conf"
$ sudo install -Dm0644 "/opt/photoview/systemd/photoview.tmpfiles" "/usr/lib/tmpfiles.d/photoview.conf"
$ sudo install -d "/var/cache/photoview/media_cache"
# The next line is if you plan to use `sqlite`
$ sudo install -d "/var/lib/photoview"
$ cd /opt/photoview/ui/build
$ sudo chown -R photoview:photoview /var/cache/photoview
$ cd /opt/photoview/ui/dist
$ sudo find * -type f -exec install -Dm0644 "{}" "/usr/share/webapps/photoview-ui/{}" \;
$ cd /opt/photoview/api
$ sudo install -Dm0755 -t "/usr/lib/photoview" "/opt/photoview/api/photoview"
$ sudo ln -s /usr/lib/photoview/photoview /usr/bin/photoview
$ sudo find data -type f -exec install -Dm0644 "{}" "/usr/lib/photoview/{}" \;
$ sudo install -Dm0644 "/opt/photoview/api/example.env" "/etc/photoview.env"
# Seulement si vous utilisez `sqlite`:
$ sudo install -d "/var/lib/photoview"
$ sudo chown -R photoview:photoview /var/lib/photoview
```
### Utiliser le fichier `systemd`

Expand Down
Loading