Commit Graph

41 Commits

Author SHA1 Message Date
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
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
Googol Lee
a9d7b774bd Add log package for better logging level. (#1130)
* Add log package. Update worker with new log package.

* Add init error to worker.

* Init workers when binary launching.

* Add tests to cover different errors.
2024-11-21 10:44:38 +01:00
Kostiantyn
69e595000d Refactoring part 2.11: Long func refactoring in server and utils (#1083)
* Split long functions and optimize code

* Addressing comments

---------

Co-authored-by: Konstantin Koval
2024-10-09 18:20:03 +03:00
Googol Lee
cf1a66975d API server listens with the address of PHOTOVIEW_LISTEN_IP, #1010. (#1014)
Fix the listened host reference in the `main()` function
2024-08-09 17:32:07 +03:00
viktorstrate
6361df1793 Start on big scanner code refactoring 2022-02-14 23:57:45 +01:00
viktorstrate
c5a307283d Refactoring of API
- Add request context to all database calls
- Update deprecated gqlgen functions
- Update go.mod dependencies
2021-11-11 18:57:02 +01:00
viktorstrate
92662f9b8e Start on album download 2021-09-26 00:21:02 +02:00
viktorstrate
b022a13e55 Batch exiftool runs + scanner package restructuring 2021-05-06 22:01:48 +02:00
viktorstrate
b6a85d0966 Finish localization
- Add user preferences section to settings
- Make settings page available for all users
- Move log out button to settings page
- Make it possible for each user to choose their desired language
2021-04-11 22:31:42 +02:00
viktorstrate
ceb8c4103f Fix exiftool detection 2021-04-03 21:39:32 +02:00
viktorstrate
c18759e6db Fix darktable docker install
and print version of executable workers on startup
2021-03-03 13:32:44 +01:00
viktorstrate
430869b319 Completely remove PHOTOVIEW_PUBLIC_ENDPOINT 2021-03-01 22:11:58 +01:00
viktorstrate
2c98827db5 Make photoview work without providing the PHOTOVIEW_PUBLIC_ENDPOINT environment variable 2021-03-01 22:03:57 +01:00
viktorstrate
b66cbf9274 Add environment variable to specify custom UI path
When using SERVE_UI=1
2021-02-26 15:10:28 +01:00
viktorstrate
20251dedd6 Add UI to move faces between face groups 2021-02-20 22:43:07 +01:00
viktorstrate
abb80ae425 Start on face detection 2021-02-15 17:35:28 +01:00
Viktor Strate Kløvedal
ce3090394b Add dataloaders to combine database queries (#190)
See also https://gqlgen.com/reference/dataloaders/
2021-02-07 22:17:33 +01:00
viktorstrate
107da91700 Refactor handling of environment variables 2021-01-17 16:50:48 +01:00
stz184
26f2b753b7 Prefixed the env variables to avoid naming collisions 2021-01-16 23:27:23 +02:00
viktorstrate
907894dda3 Merge branch 'master' into v2.0.0 2020-12-17 23:18:00 +01:00
viktorstrate
4cd822f068 Update gomod to reflect repo transfer 2020-12-17 22:51:43 +01:00
viktorstrate
27b2f95a7b Start on migrating database integration to gorm 2020-11-23 19:39:44 +01:00
viktorstrate
940e48fee3 Enable http compression for API 2020-10-04 16:34:47 +02:00
viktorstrate
44a00c7415 Move setup of executable workers to function
- Fix startup crash if no site_info row was found
2020-09-23 14:34:26 +02:00
viktorstrate
9c9807ecc9 Add admin setting to change max concurrent workers 2020-09-21 21:32:30 +02:00
viktorstrate
05380354e3 Setup periodic scan background runner 2020-09-21 12:34:56 +02:00
viktorstrate
f537b1d608 Add video route (still unprotected) 2020-07-11 15:57:58 +02:00
viktorstrate
95f4df4b7d Start to integrate new scanner system with api 2020-06-23 00:40:47 +02:00
viktorstrate
ff0ea48aca Add defaults for more env variables in Dockerfile
Add defaults for:
- API_LISTEN_IP
- API_LISTEN_PORT
- SERVE_UI
2020-04-30 14:59:29 +02:00
Bruno Sousa
e39349963b use log.Panicf instead of just panic 2020-04-15 16:20:09 +02:00
Bruno Sousa
c64b4d0d39 make SetupDatabase returns an error and use PingContext with timeout 2020-04-15 16:18:51 +02:00
BkSouX
11ea1c13bd api - miss import 2020-04-14 20:04:39 +02:00
BkSouX
d256a31842 api - panic instead of fatal when issue with the database migration 2020-04-14 20:00:06 +02:00
viktorstrate
399cb295f2 Move spa handler to a separate file 2020-04-06 22:21:58 +02:00
viktorstrate
b4676af3c1 Rewrite environment variable configurations 2020-04-06 22:16:25 +02:00
viktorstrate
48520a7d2d Further work on single docker container
- Add proper .dockerignore
- Fix photo prefix
- Print public endpoint when server starts
- Discard API_LISTEN_PORT
2020-04-05 18:54:13 +02:00
Brandon Davis
4661bae48d One dockerfile to rule them all 2020-02-29 20:06:18 -05:00
viktorstrate
935dc5b55e Work on notifications + custom logger 2020-02-21 20:51:50 +01:00
viktorstrate
2d15e7c41f Add authentication for websockets 2020-02-21 17:53:04 +01:00
viktorstrate
b2a8fd09f9 Work towards subscriptions
- Replace chi with gorilla/mux
- Write custom CORS rules
- Start on notification subscriptions
2020-02-21 16:50:50 +01:00