29 Commits

Author SHA1 Message Date
Deluan
7057bd104d
Refactor to use more Go 1.22 features 2026-01-02 20:36:56 +00:00
Deluan
3459141f8c
Add HTTPSecurityHeaders.CustomFrameOptionsValue option.
Requested in https://github.com/navidrome/navidrome/issues/248#issuecomment-1783768985
2026-01-02 20:36:33 +00:00
crazygolem
b75b09e8da
Use the RealIP middleware also behind a reverse proxy (#2858)
* Use the RealIP middleware only behind a reverse proxy

* Fix proxy ip source in tests

* Fix test for PR#2087

The PR did not update the test after changing the behavior, but the test still
passed because another condition was preventing the user from being created in
the test.

* Use RealIP even without a trusted reverse proxy

* Use own type for context key

* Fix casing to follow go's conventions

* Do not apply RealIP middleware twice

* Fix IP source in logs

The most interesting data point in the log message is the proxy's IP, but
having the client IP too can help identify integration issues.
2026-01-02 20:35:04 +00:00
Deluan
57b3e22067
Simplify default middlewares setup 2026-01-02 20:32:58 +00:00
Deluan
5824737dc9
Simplify RealIP middleware setup 2026-01-02 20:32:58 +00:00
Deluan
0d18620030
Add log.IsGreaterOrEqualTo, that take into consideration path-scoped log levels 2026-01-02 20:32:37 +00:00
Deluan
b6dfcae247
Some refactorings 2026-01-02 20:25:19 +00:00
Deluan
fc306ae436
Add more middleware tests 2026-01-02 20:25:19 +00:00
Deluan
4ba065ec07
Add tests for serverAddressMiddleware 2026-01-02 20:25:18 +00:00
Deluan
f911bdb1b4
Allow BaseURL to contain full server url, including scheme and host. Fix #2183 2026-01-02 20:23:40 +00:00
Deluan
c8b8f82dd4
Add path to cookies. Fix #1580 2026-01-02 20:23:40 +00:00
Deluan
373d139fe2
Add public endpoint to expose images 2026-01-02 20:21:16 +00:00
Deluan
e850665ebc
Serve artist placeholder directly, instead of using LastFM's CDN 2026-01-02 20:20:20 +00:00
Deluan
7028cc05f5
Compress more http content-types.
Also, some minor refactoring
2026-01-02 20:17:20 +00:00
Deluan
03128f2b97
Fix error comparisons 2026-01-02 20:15:58 +00:00
Manuel
e81048135b
fix:(middlewares.go) - Set Cookie SameSite mode to Strict - 1776 (#1777)
* None is deprecated and will fallback to Lax in the future.
* Using Strict is future proof and provides additional CSR protection

Signed-off-by: Manuel Kroeber <manuel.kroeber@gmail.com>

Signed-off-by: Manuel Kroeber <manuel.kroeber@gmail.com>
2026-01-02 20:15:29 +00:00
Brice Johnson
0bec8f35c4
Allowing 3rd party UIs to access x-total-count http header (#1470)
* Adding 'x-content-duratin' and 'x-total-count' to CORS exposed headers

* Moving cors setup to middlewares.go

* adding x-nd-authorization to exposed headers
2026-01-02 20:11:39 +00:00
Deluan
5bbf0e03f9
Fix cookie warning 2026-01-02 20:05:03 +00:00
Deluan
8e32b56ea0
Only send events to clients who need it
- User events (star, rating, plays) only sent to same user
- Don't send to the client (browser window) that originated the event
2026-01-02 20:02:35 +00:00
Deluan
3e56e834a4
Upgrade to go-chi 5 2026-01-02 19:31:07 +00:00
Dnouv
5f014920c2
Replace Feature Policy with Permissions Policy (#1112)
* Add Permissions Policy

* Remove Display capture option
2026-01-02 19:26:44 +00:00
Deluan Quintão
165af5b850
Remove dependency of go-bindata (#818)
* Use new embed functionality for serving UI assets

* Use new embed functionality for serving resources. Remove dependency on go-bindata

* Remove Go 1.15
2026-01-02 19:22:04 +00:00
Deluan
10cf2372f8
Move project to Navidrome GitHub organization 2026-01-02 19:20:16 +00:00
Deluan
92b7ef40af Disable CSP for now 2020-10-06 11:24:59 -04:00
Deluan
cd171c40cb Add secure middleware, with sensible values 2020-10-06 08:46:58 -04:00
Deluan
8dfc259857 Serve robots.txt from root (http://server/robots.txt) 2020-10-02 10:15:19 -04:00
Deluan
9f42e330b4 fix: change web requests log level to debug 2020-03-21 13:03:04 -04:00
Deluan
d2eea64528 fix: typo 2020-02-23 21:41:10 -05:00
Deluan
203754726b refactor: better request logging 2020-02-01 20:07:15 -05:00