Commit graph

658 commits

Author SHA1 Message Date
Michael Mayer
d0ad3c23fb OAuth2: Remove client soft delete and fix client add command #213 #3943
Signed-off-by: Michael Mayer <michael@photoprism.app>
2024-01-29 21:08:01 +01:00
Michael Mayer
fe7e342692 OAuth2: Improve authentication logs and commands #213 #3730 #3943
Signed-off-by: Michael Mayer <michael@photoprism.app>
2024-01-29 17:32:53 +01:00
Michael Mayer
2243f92fd6 Prometheus: Fix "GET /api/v1/metrics" API endpoint #213 #3730 #3943
Signed-off-by: Michael Mayer <michael@photoprism.app>
2024-01-29 14:18:17 +01:00
Michael Mayer
86dc89c4b9 Config: Show error if originals and storage path seem identical #1642
Signed-off-by: Michael Mayer <michael@photoprism.app>
2024-01-21 14:22:16 +01:00
Michael Mayer
01da5bdec7 CRC32: Move checksum generation to a dedicated package
Signed-off-by: Michael Mayer <michael@photoprism.app>
2024-01-20 14:56:07 +01:00
Michael Mayer
7e7ba69982 Auth: Add client_uid and client_name to auth_sessions table #808 #3943
This also adds the ability to change the client role if needed and
improves the usage information and output of the CLI commands.

Signed-off-by: Michael Mayer <michael@photoprism.app>
2024-01-18 16:53:05 +01:00
Michael Mayer
271e7243db Logs: Shorten the names of error log helper functions
Signed-off-by: Michael Mayer <michael@photoprism.app>
2024-01-18 11:23:59 +01:00
Michael Mayer
2912ac9464 Security: Refactor cache headers, auth token validation & UI #782 #808
Signed-off-by: Michael Mayer <michael@photoprism.app>
2024-01-17 14:16:02 +01:00
Michael Mayer
d4317863f7 UX: Do not redirect users if they are already on the site root
Signed-off-by: Michael Mayer <michael@photoprism.app>
2024-01-16 21:56:26 +01:00
Michael Mayer
3946e2a16f API: Refactor "404 Not Found" response handler #3931
Signed-off-by: Michael Mayer <michael@photoprism.app>
2024-01-16 20:56:43 +01:00
Michael Mayer
c3b9b73d1d API: Only allow CDNs to cache GET, HEAD, and OPTIONS requests #3931
Signed-off-by: Michael Mayer <michael@photoprism.app>
2024-01-16 16:17:16 +01:00
Michael Mayer
02a1b12edb Config: Update CORS header defaults and add /api/v1/echo endpoint #3931
Signed-off-by: Michael Mayer <michael@photoprism.app>
2024-01-16 14:36:08 +01:00
Michael Mayer
c38962e469 API: Deny client access if the scope is not authorized #782 #808
Signed-off-by: Michael Mayer <michael@photoprism.app>
2024-01-14 19:27:38 +01:00
Michael Mayer
fed1d8ad95 Auth: Accept access token as passwd with fail rate limit #782 #808 #3943
Signed-off-by: Michael Mayer <michael@photoprism.app>
2024-01-14 18:28:17 +01:00
Michael Mayer
9586a9ec69 Auth: Refactor API to allow auth secrets to be used as tokens #808 #3943
Signed-off-by: Michael Mayer <michael@photoprism.app>
2024-01-14 12:01:26 +01:00
Michael Mayer
7a05c5553b OAuth2: Add "POST /api/v1/oauth/revoke" API endpoint #782 #808 #3943
Signed-off-by: Michael Mayer <michael@photoprism.app>
2024-01-10 12:21:43 +01:00
Michael Mayer
481c207897 Cache: Refactor internal/ttl package
Signed-off-by: Michael Mayer <michael@photoprism.app>
2024-01-10 10:26:38 +01:00
Michael Mayer
3e924b70c7 API: Move handling of HTTP auth headers to pkg/header #808 #3943 #3959
Signed-off-by: Michael Mayer <michael@photoprism.app>
2024-01-09 10:58:47 +01:00
Michael Mayer
ec13ccb6d5 OAuth2: Enforce limit for number of access tokens / sessions #808 #3943
These changes ensure that OAuth2 clients cannot create an unlimited
number of access tokens (sessions) with their client credentials.

Signed-off-by: Michael Mayer <michael@photoprism.app>
2024-01-08 16:57:07 +01:00
Michael Mayer
42fbf70dcf API: Update markers.go handler docs
Signed-off-by: Michael Mayer <michael@photoprism.app>
2024-01-08 14:56:07 +01:00
Michael Mayer
0e4d81853c API: Add .well-known/oauth-authorization-server route handler #808 #3943
This commit also adds an /api/v1/oauth/logout endpoint that allows
clients to delete their sessions (access tokens) as needed.

Signed-off-by: Michael Mayer <michael@photoprism.app>
2024-01-08 14:53:39 +01:00
Michael Mayer
f8e0615cc8 Auth: Ensure backwards compatibility for existing API clients #808 #3943
These changes ensure that the new (SHA256) session ID is returned in the
"session_id" field, so that developers have time to update their client
implementations to use the new "access_token" field.

Signed-off-by: Michael Mayer <michael@photoprism.app>
2024-01-07 12:25:56 +01:00
Michael Mayer
0d2f8be522 Auth: Use hashed auth tokens for enhanced security #3943 #808 #782
Signed-off-by: Michael Mayer <michael@photoprism.app>
2024-01-06 17:35:19 +01:00
Michael Mayer
0ca37b2c92 Docs: Update year in backend and frontend package file headers
Signed-off-by: Michael Mayer <michael@photoprism.app>
2024-01-05 16:38:36 +01:00
Michael Mayer
713593da4e Auth: Add CLI command to create access tokens for apps #782 #808 #3943
You can now run "photoprism auth add" to create new client access tokens
that allow external applications to use the built-in REST API.

Signed-off-by: Michael Mayer <michael@photoprism.app>
2024-01-05 16:31:07 +01:00
graciousgrey
0c4c3215f4 Tests: Add unit tests #3943 2023-12-14 14:19:43 +01:00
Michael Mayer
467f7b1585 OAuth2: Add Client Credentials Authentication #213 #782 #808 #3730 #3943
This adds standard OAuth2 client credentials and bearer token support as
well as scope-based authorization checks for REST API clients. Note that
this initial implementation should not be used in production and that
the access token limit has not been implemented yet.

Signed-off-by: Michael Mayer <michael@photoprism.app>
2023-12-12 18:42:50 +01:00
Brandon Richardson
3d962e2382 Backend: Expose prometheus-style metrics endpoint
Expose a new API which can be scraped by prometheus to gather useful
metrics from an instance. The new endpoint exposes photoprism build
version information, golang version, edition and various count metrics.
2023-12-06 08:13:24 +01:00
Michael Mayer
b7bbc59fca Upgrade: Improve error handling and messages #3813
Signed-off-by: Michael Mayer <michael@photoprism.app>
2023-10-13 12:43:20 +02:00
Michael Mayer
fb419e26b7 Settings: Enable delete feature by default #3801
Signed-off-by: Michael Mayer <michael@photoprism.app>
2023-10-08 15:42:23 +02:00
Michael Mayer
80dd926f2d Share: Improve query validation in the search and albums API
Signed-off-by: Michael Mayer <michael@photoprism.app>
2023-10-07 17:33:04 +02:00
Michael Mayer
604849e92c Search: Include RAW files in results by default #2040
With these changes the size and type of the RAW file as well as other
details can be displayed in the Cards View. This also improves the
indexing of camera and lens metadata.

Signed-off-by: Michael Mayer <michael@photoprism.app>
2023-10-06 02:22:48 +02:00
Michael Mayer
26ca084699 Videos: Cache embedded media to allow streaming and transcoding #3764
This is a follow-up improvement for the following feature requests that
have already shipped with our stable release:

- Live Photos: Add support for Samsung Motion Photos #439
- Live Photos: Add support for Google Camera Motion Photos #1739

Signed-off-by: Michael Mayer <michael@photoprism.app>
2023-09-24 17:13:06 +02:00
Michael Mayer
2339197311 Live Photos: Add support for playing videos embedded in HEIC images #439
Related Issues:
- Samsung: Initial support for Motion Photos (#439)
- Google: Initial support for Motion Photos (#1739)
- Metadata: Flag Samsung/Google Motion Photos as Live Photos (#2788)

Signed-off-by: Michael Mayer <michael@photoprism.app>
2023-09-23 11:27:20 +02:00
Michael Mayer
529103462c Index: Add native support for MP4 and Samsung/Google Motion Photos #439
Related Issues:
- Samsung: Initial support for Motion Photos (#439)
- Google: Initial support for Motion Photos (#1739)
- Metadata: Flag Samsung/Google Motion Photos as Live Photos (#2788)

Related Pull Requests:
- Live Photos: Add Support for Samsung Motion Photos (#3588)
- Samsung: Improved support for Motion Photos (#3660)
- Google: Initial support for Motion Photos (#3709)
- Google: Add support for Motion Photos (#3722)

Signed-off-by: Michael Mayer <michael@photoprism.app>
2023-09-22 23:59:56 +02:00
Michael Mayer
139562e393 SQLite: Improve logging to confirm where the error is triggered #3742
see also https://github.com/photoprism/photoprism/discussions/3665

Signed-off-by: Michael Mayer <michael@photoprism.app>
2023-09-19 09:12:15 +02:00
Michael Mayer
304c8e3ae6 Icons: Improve UI contrast by changing color from black to dim gray
Signed-off-by: Michael Mayer <michael@photoprism.app>
2023-09-11 10:43:40 +02:00
Michael Mayer
12608a7a31 Albums: Downsize share preview image from 1600x900 to 1200x675 #3658
Signed-off-by: Michael Mayer <michael@photoprism.app>
2023-09-09 10:40:25 +02:00
Michael Mayer
a30cbb19b7 Albums: Regenerate share preview after one hour and after changes #3658
Signed-off-by: Michael Mayer <michael@photoprism.app>
2023-09-08 17:36:56 +02:00
Michael Mayer
0e4ce95ff1 Library: Add option to run index and cache cleanup from the UI #3699
Signed-off-by: Michael Mayer <michael@photoprism.app>
2023-09-03 16:02:42 +02:00
Michael Mayer
1507525ba4 People: Fix merging and renaming in connection with deleted names #3414
Signed-off-by: Michael Mayer <michael@photoprism.app>
2023-08-21 15:04:14 +02:00
Michael Mayer
2e367870a9 Albums: Fix generation of site URL when opening a share link #3658
Signed-off-by: Michael Mayer <michael@photoprism.app>
2023-08-21 11:29:41 +02:00
Michael Mayer
7020389a75 Albums: Fix album preview image URL in auth_share.go #3658
Signed-off-by: Michael Mayer <michael@photoprism.app>
2023-08-21 10:29:22 +02:00
Michael Mayer
91cc358fc5 Clean: Shorten error log sanitization function name #439 #3588
Signed-off-by: Michael Mayer <michael@photoprism.app>
2023-08-15 17:05:55 +02:00
Michael Mayer
a287830d1f Videos: Allow setting a lower TTL for caching video content #3631
Adds the new "--http-video-maxage SECONDS" config option.

Signed-off-by: Michael Mayer <michael@photoprism.app>
2023-08-15 11:06:43 +02:00
Michael Mayer
7f13218229 Logs: Add LogError() func to sanitize error messages #439 #3588
Signed-off-by: Michael Mayer <michael@photoprism.app>
2023-08-15 08:12:52 +02:00
Michael Mayer
36bac7ab48 Faces: Add POST REST endpoint to manually create new file markers #1548
Signed-off-by: Michael Mayer <michael@photoprism.app>
2023-07-27 19:13:00 +02:00
Michael Mayer
2a002eca78 API: Remove unnecessary log message from batch delete handler #272
Signed-off-by: Michael Mayer <michael@photoprism.app>
2023-07-23 18:32:02 +02:00
Michael Mayer
ad3da85ecb UX: Add Delete All button to archive page toolbar #272
Signed-off-by: Michael Mayer <michael@photoprism.app>
2023-07-23 17:57:48 +02:00
Michael Mayer
4931889b5e Auth: Improve privilege level change detection #3512
Signed-off-by: Michael Mayer <michael@photoprism.app>
2023-07-18 23:35:10 +02:00