aboutsummaryrefslogtreecommitdiffstats
path: root/src/b/2024-07-01-openbsd-nextcloud-memories-exiftool.md
blob: 00d62b06ca17a8b18c4b229e960dd667afd33f59 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
---
title: OpenBSD, Nextcloud, Memories and ExifTool
date: 2024-07-01
---

## Why?

I have setup an OpenBSD bare-metal server in an old SuperMicro enclosure.
[Memories](https://apps.nextcloud.com/apps/memories) is known to be a great
replacement for Google Photos and Co.

However there are some quirks that needs to be fixed after a fresh install.

![](/static/b/nextcloud-openbsd-02.jpg)

## How?

### Extiftool/ffmpeg

Copy the ffmpeg, ffprobe and perl binaries in the */var/www* chroot, preserving
their directory structure. Same for each of their libraries, retrieved with ldd.

Copy the libdata perl5 directory in the */var/www* chroot:

```
mkdir /var/www/usr/local/libdata
cp -r /usr/local/libdata/perl5 /var/www/usr/local/libdata
```

Append the library path for ffmpeg and ffmprobe in the */etc/php-fpm.conf*:

```
env[LD_LIBRARY_PATH] = /usr/local/lib:/usr/X11R6/lib
```

### Filecache template

If for some reasons you can not preview the details of a file from Memories or
share it, fire up an sql client and delete this non-existing file from its index
*(thanks
[nextcloud/server/#40886](https://github.com/nextcloud/server/issues/40886))*:

```
DELETE FROM oc_filecache
WHERE path like '%merged-template-prepend.js.deps%';
```

### Memories Android client

Edit the *config/config.php* file in your nextcloud root directory with the
following lines *(thanks
<https://help.nextcloud.com/t/problem-desktop-client-login-flow-v2/78279/2>)*:

```
'overwrite.cli.url' => 'https://<your.domain.here>',
'overwritehost' => '<your.domain.here>',
'overwriteprotocol' => 'https',
```

### Automation

Most of these steps are automated at
[roles/nextcloud/tasks/dependencies.yml](https://git.rgoncalves.se/_infrastructure/rules/tree/roles/nextcloud/tasks/dependencies.yml).

![](/static/b/nextcloud-openbsd-01.jpg)

```
---

- name: copy dependencies binaries to chroot
  ansible.builtin.include_role:
    name: copy_bin
  vars:
    copy_bin__root_dir: "{{ httpd_pre__chroot_dir }}"
    copy_bin__name: "{{ nextcloud__loop_dependencies_item }}"
  loop_control:
    loop_var: nextcloud__loop_dependencies_item
  loop:
    - ffmpeg
    - ffprobe
    - perl

- name: copy dependencies for exiftool
  ansible.builtin.copy:
    src: /usr/local/bin/exiftool
    dest: "{{ httpd_pre__chroot_dir }}/bin/exiftool"
    mode: preserve
    remote_src: true

- name: create perl dependencies directory
  ansible.builtin.file:
    path: "{{ httpd_pre__chroot_dir }}/{{ nextcloud__perl_libdata_dir | dirname }}"
    owner: 0
    group: 0
    mode: "0755"
    state: directory

- name: copy perl dependencies
  ansible.builtin.copy:
    src: "{{ nextcloud__perl_libdata_dir }}"
    dest: "{{ httpd_pre__chroot_dir }}/{{ nextcloud__perl_libdata_dir | dirname }}"
    mode: preserve
    remote_src: true
```
remember that computers suck.