Skip to content
This repository has been archived by the owner on Jun 2, 2023. It is now read-only.

Commit

Permalink
Enable linuxserver digikam migrations.
Browse files Browse the repository at this point in the history
Added:
* migrate_to_ls - linuxserver migration script.
* migration.md - migration documentation.
* Deprecation and support notice.
  • Loading branch information
r-pufky committed Apr 10, 2022
1 parent 52c5149 commit 8139b29
Show file tree
Hide file tree
Showing 7 changed files with 387 additions and 24 deletions.
3 changes: 2 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y locales
#./digikam.appimage --appimage-extract

COPY startapp.sh /startapp.sh
COPY migrate_to_ls /migrate_to_ls
COPY squashfs-root/ /digikam/

# Additional libraries needed for digikam:
Expand All @@ -38,7 +39,7 @@ COPY squashfs-root/ /digikam/
# libgssapi-krb5-2 - 7.2.0 needed for digikam base.
# libnss3 - 7.2.0 needed for digikam base.
# libimage-exiftool-perl - 7.3.0 needed for digikam base.
# firefox-esr - 7.3.0 needed for smugmug auth (firefox on ubuntu).
# firefox-esr - 7.3.0 needed for smugmug auth (firefox on ubuntu).
# firefox-esr-l10n-all - 7.3.0 needed for smugmug auth (firefox on ubuntu).
# libgl1-mesa-glx - 7.4.0 needed for digikam base.
# Ensure en.UTF-8 set for locale.
Expand Down
7 changes: 5 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ GPG_KEYSERVER = pool.sks-keyservers.net
DIGI_BUILD = $(BUILD_DIR)/$(version)/squashfs-root
PRE_DIGI_BUILD = $(BUILD_DIR)/$(pre_release)/squashfs-root
DIGI_START = startapp.sh
MIGRATE = migrate_to_ls
DOCKER_FILE = Dockerfile

DIGIKAM_PUBLIC_KEY = C2386E50
Expand All @@ -33,10 +34,10 @@ help:
@echo " make digikam[_no_gpg] [version=$(version)]"
@echo " Build digikam docker container with specified values."
@echo
@echo " make stable [version=$(version)]"
@echo " make stable[_no_gpg] [version=$(version)]"
@echo " Tags completed build as stable with specified values."
@echo
@echo " make latest [version=$(version)]"
@echo " make latest[_no_gpg] [version=$(version)]"
@echo " Tags completed build as latest with specified values."
@echo
@echo " digkam, stable, latest may be used with _no_gpg (digikam_no_gpg)"
Expand Down Expand Up @@ -111,6 +112,7 @@ staging:
@rm -rfv $(STAGING_DIR) || exit 0
@mkdir -p $(STAGING_DIR) $(DOCKER_STAGING)
@cp -av $(DIGI_START) $(STAGING_DIR)
@cp -av $(MIGRATE) $(STAGING_DIR)
@cp -av $(DOCKER_FILE) $(STAGING_DIR)
@cp -av $(DIGI_BUILD) $(STAGING_DIR)

Expand All @@ -119,6 +121,7 @@ staging_unstable:
@rm -rfv $(STAGING_DIR) || exit 0
@mkdir -p $(STAGING_DIR) $(DOCKER_STAGING)
@cp -av $(DIGI_START) $(STAGING_DIR)
@cp -av $(MIGRATE) $(STAGING_DIR)
@cp -av $(DOCKER_FILE) $(STAGING_DIR)
@cp -av $(PRE_DIGI_BUILD) $(STAGING_DIR)

Expand Down
33 changes: 12 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# [![digikam][f8]](https://www.digikam.org/documentation/) digikam

:warning: DEPRECATION: Support will end on the next major digikam release. :warning:

:warning: See [migration instructions](migration.md) for details and how to migrate to
the linuxserver digikam image. :warning:

digikam is an advanced open-source digital photo management application that
runs on Linux, Windows, and MacOS. The application provides a comprehensive set
of tools for importing, managing, editing, and sharing photos and raw files.
Expand Down Expand Up @@ -31,21 +36,6 @@ minimize unexpected changes.
* See digikam [release plan here][2k].
* See [troubleshooting](#troubleshooting) for issues, like DB 10 to 11 upgrade failure.

### docker
```
docker create \
--name=digikam \
-e USER_ID=1000 \
-e GROUP_ID=1000 \
-e TZ=America/Los_Angeles \
-p 5800:5800 \
-v /my/docker/service/config:/config \
-v /my/photo/location:/data \
-v /etc/localtime:/etc/localtime:ro \
--restart unless-stopped \
rpufky/digikam:stable
```

### docker-compose
```
---
Expand Down Expand Up @@ -232,25 +222,26 @@ set global log_bin_trust_function_creators=1;
```

## Manually Building
Built using a Makefile to manage builds. Common commands below:
Built using a Makefile to manage builds. Assumes current user is a privleged
docker user. Common commands below:

```bash
make
```
* Shows all make options.

```bash
sudo make stable
make digikam version=7.6.0
```
* Build a 'stable' package with defaults.
* Build 'stable' version using appimage 7.6.0.

```bash
sudo make latest version=6.4.0 container=10
make latest version=7.6.0
```
* builds 'latest' version using digikam appimage 6.4.0, container version 6.4.0.10.
* builds 'latest' version using appimage 7.6.0.

```bash
sudo make clean
make clean
```
* Cleans build artifacts on the filesystem.

Expand Down
5 changes: 5 additions & 0 deletions RELEASE.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@ Uses semantic versioning, with an additional container version number:
## 7.6.0
Digikam [7.6.0 relase][9f].

Added:
* migrate_to_ls - linuxserver migration script.
* migration.md - migration documentation.
* Deprecation and support notice.

Changes:
* Bump digikam release version.

Expand Down
76 changes: 76 additions & 0 deletions migrate_to_ls
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
#!/usr/bin/env bash
#
# Migrate well-know config locations from rpufky to ls digikam config.
#



BASE='.'
F_FORCE=0
F_PLAYLISTS=0
F_VIDEOS=0
F_QUIET=0
Y_DL='/usr/local/bin/youtube-dl'
Y_BASE='https://www.youtube.com/user/'
Y_OPT_QUIET=''
Y_OPT_DOWN='--no-overwrites --continue --ignore-errors'
Y_OPT_FORMAT='--format best --merge-output-format mkv'
Y_OPT_WRITE='--write-thumbnail --write-description --write-info-json --write-annotations'
Y_OPT_TEMPLATE='%(uploader_id)s/%(playlist)s/%(playlist_index)s_%(title)s/%(playlist_index)s-%(title)s.%(ext)s'

USAGE="
Migrate well-known config locations from rpufky to ls digikam config.
Assumes a base ls/digikam config location has been run once. This is
non-destructive for the source config.
See https://github.com/r-pufky/digikam/blob/master/migration.md for full
migration instructions.
Usage: $0 [OPTIONS]
Options:
-s [DIR] Source config mount (rpufky/digikam config mount). Use trailing
slash. Required.
-d [DIR] Dest config mount (ls/digikam config mount). Use trailing slash.
Required.
Examples:
$0 -s /data/rp/config/ -d /data/ls/config/
"

while getopts "s:d:h" options; do
case "${options}" in
s)
SOURCE=${OPTARG%%/}
;;
d)
DEST=${OPTARG%%/}
;;
h)
echo "${USAGE}"
exit 1
;;
:)
echo "${USAGE}"
exit 1
;;
esac
done

if [ -z ${SOURCE} ] || [ -z ${DEST} ]; then
echo 'Error: source and destination config locations required.'
exit 2
fi

# Migrate user settings.
cp -av "${DEST}/.config/digikamrc" "${DEST}/.config/digikamrc.orig"
cp -av "${SOURCE}/xdg/config/digikamrc" "${DEST}/.config/digikamrc"
chown --reference="${DEST}/.config/digikamrc.orig" "${DEST}/.config/digikamrc"
chmod --reference="${DEST}/.config/digikamrc.orig" "${DEST}/.config/digikamrc"

# Migrate DBs.
find "${DEST}" -type f -name "*.db" -exec mv -v {} {}.orig \;
cp -av "${SOURCE}"/*.db "${DEST}"
chown --reference="${DEST}/digikam4.db.orig" "${DEST}/"*.db
chmod --reference="${DEST}/digikam4.db.orig" "${DEST}/"*.db
Loading

0 comments on commit 8139b29

Please sign in to comment.