Commit Graph

1368 Commits

Author SHA1 Message Date
Kostiantyn
65bdfb55dd Monitor both Dockerfiles; Monitor compose files (#1280)
Co-authored-by: Konstantin Koval
2025-08-19 17:11:09 +03:00
Googol Lee
6f78bb8f1f Avoid all os.Exit and log.Fatal (#1279)
* Avoid all os.Exit and log.Fatal

* Exit test with 1 by default, to catch panic errors.

* Fix log messages.
2025-08-19 16:07:16 +02:00
Kostiantyn
ff5b83916c A few small fixes for bugs, detected during the merge upstream changes to my forked repo (#1270)
* Migrate GolangCI config to the latest version; fix nll-pointer exception in the external EXIF parser and order of GPS coords in the internal one; updated links in Readme and added missing LibHeif exports

* Improve GPS error handling

---------

Co-authored-by: Konstantin Koval
2025-08-19 16:34:46 +03:00
dependabot[bot]
368eb063e0 Bump golang from 1.24-bookworm to 1.25-bookworm (#1278)
* Bump golang from 1.24-bookworm to 1.25-bookworm

Bumps golang from 1.24-bookworm to 1.25-bookworm.

---
updated-dependencies:
- dependency-name: golang
  dependency-version: 1.25-bookworm
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>

* Bump the GO version in the go.mod

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Konstantin Koval <kkb@ukr.net>
2025-08-19 10:47:36 +02:00
dependabot[bot]
bf05f24b56 Bump actions/checkout from 4 to 5 in /.github/workflows (#1277)
Bumps [actions/checkout](https://github.com/actions/checkout) from 4 to 5.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v4...v5)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: '5'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-08-18 17:09:52 +03:00
Kostiantyn
79b920ab57 Bump several deps (#1274)
Co-authored-by: Konstantin Koval <kkb@ukr.net>
2025-08-18 13:48:54 +02:00
Tyler Hagen
4cb5834661 Update macos local development dependencies (#1268)
* Add needed homebrew formulae and corresponding compiler settings for macos to run api

* coderabbitai feedback

* Don't set CPLUS_INCLUDE_PATH de-novo
2025-08-07 17:40:20 +03:00
Kostiantyn
2d1c5df73b Bump GQLgen to the latest version (#1267)
Co-authored-by: Konstantin Koval
2025-08-04 16:22:45 +03:00
Googol Lee
92e438122e Add jpeg-xl example file. (#1266) 2025-07-27 15:22:08 +03:00
Kostiantyn
66fecbd5ac Bump GORM API dependency to a minor version (#1263)
Co-authored-by: Konstantin Koval
2025-07-26 10:33:43 +03:00
Nikolay Kalinin
0b157b330a Fix: Exif parsers should accept longtitude up to 180 degrees (#1260) 2025-07-23 19:38:23 +02:00
Googol Lee
b55a80f5b9 Improve *TestMain to handle the exit code. (#1258) 2025-07-22 21:14:20 +02:00
Kostiantyn
002cfef11b Add missing os.exit() wrapper to the test call. (#1257)
Co-authored-by: Konstantin Koval
2025-07-22 09:38:53 +02:00
Googol Lee
4206a166c6 Set AutoOrient when reading files. (#1254) 2025-07-19 21:58:07 +02:00
Googol Lee
701e3379ea Add orientation tests. (#1249) 2025-07-19 16:29:42 +02:00
Kostiantyn
5b952b04b8 Small Dockerfile improvements (#1246)
* Small Dockerfile improvements + a cleaner image rotation condition

* quoting

* Revert the change in the `magickwand.go`

---------

Co-authored-by: Konstantin Koval
2025-07-18 17:51:11 +03:00
Googol Lee
69915575d5 Add blurhash task, instead of a global blurhash generating. (#1250) 2025-07-18 15:37:51 +02:00
Googol Lee
50209bc55c Fix the coverage for codecov. (#1251) 2025-07-18 15:21:03 +02:00
Kostiantyn
d7cc42ed6e Bump several API deps (#1247)
Co-authored-by: Konstantin Koval
2025-07-18 11:43:41 +03:00
Kostiantyn
124b6d34a9 Auto-orient image during processing (#1242)
* Auto-orient image during processing

* Detect if thumb was rotated 90 degrees and switch dimentions

* Consistently auto-rotate images

* fix incorrect path for the original photo dimensions reading

* Swap the dimensions if needed and call the `wand.ThumbnailImage()` unconditionally

* revert unnecessary line split

---------

Co-authored-by: Konstantin Koval
2025-07-11 13:21:28 +03:00
Googol Lee
06d2e05ae4 Non-fork face detection, avoiding a race condition. (#1243)
* Non-fork face detection, avoiding a race condition.

* Update scanner test.
2025-07-11 11:16:41 +02:00
Kostiantyn
882c6abc84 Fix failed build for v2.4.0 version (#1244)
* Fix failed build for `v2.4.0` version

* fix the typo

---------

Co-authored-by: Konstantin Koval
2025-07-10 10:26:46 +03:00
Googol Lee
6aca4fe2f9 Fix scanner test. (#1241) 2025-07-09 22:25:44 +02:00
Kostiantyn
3bc3e09467 Fix GitHub commit passing, UI build and cache for different purposes (#1239)
* Fix GitHub commit passing, UI build and cache for different purposes

* a logging for transparency and easy debug

* Fix var expanding with quotes and add intermediate verification commands

* split verification commands

* fix joining commands

* Ecplicitly pull latest deps image

* properly set arg default values and try to fix preparation step

* another try to build the image with the correct deps tag

* Revert the dynamic deps tag discovery, as it doesn't work and the actual `latest` image is pulled implicitly anyway

* Final optimizations

* "NoCommit" placeholder, indent fix, var rename

---------

Co-authored-by: Konstantin Koval
2025-07-08 17:13:20 +03:00
Googol Lee
3f57330a6e Make TaskContext as context.Context. (#1232) 2025-07-01 19:30:31 +02:00
Googol Lee
d126bef343 Ensure features are enabled with imagemagick. (#1233) 2025-07-01 16:42:28 +02:00
Kostiantyn
029bf280e5 Bump GQLparser and GQLgen deps in API (#1234)
Co-authored-by: Konstantin Koval
2025-06-30 22:53:20 +03:00
dependabot[bot]
7067e1097c Bump github.com/go-viper/mapstructure/v2 (#1230)
Bumps the go_modules group with 1 update in the /api directory: [github.com/go-viper/mapstructure/v2](https://github.com/go-viper/mapstructure).


Updates `github.com/go-viper/mapstructure/v2` from 2.2.1 to 2.3.0
- [Release notes](https://github.com/go-viper/mapstructure/releases)
- [Changelog](https://github.com/go-viper/mapstructure/blob/main/CHANGELOG.md)
- [Commits](https://github.com/go-viper/mapstructure/compare/v2.2.1...v2.3.0)

---
updated-dependencies:
- dependency-name: github.com/go-viper/mapstructure/v2
  dependency-version: 2.3.0
  dependency-type: indirect
  dependency-group: go_modules
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-06-30 17:32:27 +03:00
Googol Lee
36edc2534c Change default thumbnail of album. (#1225) 2025-06-30 11:05:48 +02:00
Kostiantyn
fafa3a3d64 Fix the local build of the dependencies image, including the debug image instructions (#1229)
* Fix the local build of the dependencies image, including the debug image instructions

* Make the deps image easily runnable

* improve readme

* Better caching strategy

* make dependency from IM to libs build stages

* fix missing folder error

* Hopefully, final solution

---------

Co-authored-by: Konstantin Koval
2025-06-29 22:41:17 +03:00
Googol Lee
0192e4e640 Drop tables instead of truncating tables. (#1224) 2025-06-26 22:19:09 +02:00
Kostiantyn
a8edb30ae4 Refactor Docker build workflows (#1221)
* Initial implementation

* Multiple fixes and improvemens

* Better `curl` retries timing

* Remove unused `TARGETOS` and `TARGETVARIANT` vars; add the version fetch fallback code to the build scripts

* Move the fallback code before the var usage

* Use double braces to make the code compatible with the `set -u`

---------

Co-authored-by: Konstantin Koval
2025-06-26 11:58:50 +03:00
Kostiantyn
73ae3e8132 Bump API deps to versions, released this week (#1220)
Co-authored-by: Konstantin Koval
2025-06-20 11:39:07 +03:00
Kostiantyn
2b1240b88b Refactor API video route (#1202)
* Refactored code; temp disable workflows on push

* remove printf leftovers

* A better sanitizing code

* extend auth routes tests

* more tests, fix 2 bugs in token processing

* more refactoring and fixes

* optimize video mediaURLs DB query and make testCachePath in utils thread-safe

* fix always passing test

* and more refactoring; 1 more test, but cleanup still has to be fixed

* more debug code in the test

* fix the test

* Final commit

* Adding a defer function just in case of panic

* Address some of review comments

* Protect the shared var by mutex; implement correct context-aware scanning

* Better error; better initial func wrap/capture; better log messages in `photos.go`;

* Addressing a few more review comments

* Order the query results; a better error type catch; setting the MP4 content type header explicitly

* try to fix the cancelation detection condition

* Extract a function and call it by name

---------

Co-authored-by: Konstantin Koval
2025-06-18 20:38:19 +03:00
Kostiantyn
9369f72d3b Bump API deps from last 2 weeks (#1218)
Co-authored-by: Konstantin Koval
2025-06-13 20:58:03 +03:00
Kostiantyn
a22967b7d0 Refactor the Periodic Scanner module (#1210)
* Initial fix of a race condition

* better logging

* some refactoring and graceful shutdown

* fix more potential race condition places; a better app shutdown

* add test and fix some issues

* some housekeeping

* more descriptive asserts

* Address review suggestions

* Better server shutdown logic + better message about the .env file not found

* Create context inside the shutdown goroutine; removed unnecessary shutdown from the main function

* Move HTTP server to the main process and remove unnecessary code

* log shutdown error if any

* Get back to the local `scanner` variable

* Protecting scanner with mutex

* Adding the mutex to the shutdown function

* Addressing the race condition at the init stage

---------

Co-authored-by: Konstantin Koval
2025-06-11 17:09:22 +03:00
Googol Lee
0da8bef69e Update log for passing attrs with context. (#1216)
* Update log for passing attrs with context.

* Check type-casting

* add tests.

* Use t.Cleanup() to restore the global value.

* Fix error.

* Update tests.

* Add comments.

* Remove cover.cov

* Update doc.

* Update git ignore.
2025-06-07 17:11:50 +02:00
marc7s
1d1305628a Add multiple face group merge support (#1162)
* Migrate multiple merge faces code from merge-multiple branch

* Revert translations

* Remove unnecessary node

* Add aria labels

* Code review changes

* Add frontend test for MergeFaceGroupsModal
2025-06-07 10:21:02 +03:00
Googol Lee
535f8e57fd Use Magickwand to handle images. (#1212)
* Add MagickWand perf test.

* Use MagickWand.

* Calculate the right thumbnail dimension.

* Remove magick bin file.

* Add building dependencies.

* Build images.

* Add --no-install-recommends

* Remove unused field.

* Fix typo

* Use uint in the worker.

* Add guard

* Always update apt.

* Fix EncodeJpeg() with the quality

* Rename the local error with a better name.

* Add worker.Terminate()

* Fix typo

* Rebase with master and rollback the build workflow.
2025-06-03 22:04:03 +02:00
Kostiantyn
c390f83355 Bump gorm and its postgres driver to the latest versions (#1215)
Co-authored-by: Konstantin Koval
2025-06-02 11:51:02 +03:00
Googol Lee
01cd0a9ce4 Enable shared build of ImageMagick.
#1211

* Add benchmark magickwand.

* Enable shared magick.

* Remove MagickWand test because it can't be compiled with current dependency image.

* Enable formats explicitly.
2025-05-23 20:33:19 +02:00
Googol Lee
8872ea1df3 Include MagicWand library in the dependency image. (#1209)
* Include MagicWand library.

* Remove duplication.

* Limit dynamic libraries in the release build.

* Use cp -a instead of -r.

* Use bash instead of sh.
2025-05-23 11:27:07 +02:00
Googol Lee
a378522af4 Use magick generating thumbnails.
Fix #1204

* Add bad medias to scanner_test.

* Fix the script.

* Add GenerateThumbnail function.

* Add identify dimension

* Use new API. Cover json condition.

* Use magick to generate thumbnails.

* Update go mod.

* Remove dependency of executable_worker -> test_utils

* Reduce dependency of magick.

* Use magick to get dimension.

* Remove almost all code around `image` package.

* Fix thumbnailing with multi-frame gif.

* Remove the struct in wrapper.

* Fix typo.

* Build images.

* Update logs

* Add jpeg decoder.

* Remove code dependency.

* Add log to confirm scan in parallel.

* Update log

* Add reformat image perf tests.

* Rollback the build workflow.
2025-05-22 09:01:43 +02:00
Googol Lee
9d7cf8ad33 Drop linux/arm/v7 2025-05-17 09:45:39 +02:00
Kostiantyn
a1aadf678d Bump several API dependencies to their latest versions (#1203)
Co-authored-by: Konstantin Koval
2025-05-11 12:08:58 +03:00
Googol Lee
fe3cc16026 Remove Thumbnail Preferences. (#1200)
* Remove thumbnail preferences. #1089

* Remove thumbnail preferences test.

* Remove thumbnail preferences from backend.

* Fix database.go

* Update generated TS files.

* Reorder the migrations.
2025-05-11 10:44:58 +02:00
Kostiantyn
27a0b082d1 Handle photo not found case in API routes (#1201)
* Handle media not found issue

* temporary run workflows for master pushes only; tests

* revert temp workflow changes

---------

Co-authored-by: Konstantin Koval
2025-05-10 17:45:32 +03:00
Kostiantyn
36f3924b4f Bump GQLgen, GQLparser and GORM versions in API (#1197)
* Bump GQLparser and GORM versions in API

* Bump GQLgen as well

* Revert GORM update

---------

Co-authored-by: Konstantin Koval
2025-05-05 18:14:59 +03:00
Kostiantyn
7cb949a6be More granular media-cache folder permissions (#1199)
* Add a preparation service to assign the correct permissions to the media cache folder

* Better docker capabilities with less privileges

* Expand the caps list

---------

Co-authored-by: Konstantin Koval
2025-05-03 19:09:52 +03:00
Kostiantyn
5d46478c01 Fix the incorrect thumbnails for albums issue (#1198)
* The fix with test

* Fix test's foreign key issue

* 2 more test cases

* Fix the empty album test expectation

* Return Nil for no thumbnail case instead of an empty album, as expected by frontend. More tests for thumbnail priority choice

* Fix failed tests

---------

Co-authored-by: Konstantin Koval
2025-05-03 18:48:57 +03:00