Commit graph

468 commits

Author SHA1 Message Date
Antoine Gersant
487d261843 Removed unecessary dependency 2020-12-27 16:39:48 -08:00
Antoine Gersant
ea7edea79b Workaround for broken install paths on Windows 2020-12-27 00:10:57 -08:00
Antoine Gersant
1d57691e8b
Thumbnail fixes (#121)
* Use dedicated thumbnail generation algorithm

* Fixed a bug where some images could not be encoded to JPG due to unsupported pixel formats
2020-12-20 03:27:20 -08:00
Antoine Gersant
72c8ed9289
Support for bearer token authentication (#120)
* User manager can create and recognize auth tokens

* Implement HTTP bearer auth

* Use bearer auth in test-harness

* Can receive auth token via query parameter (useful for media endpoints)
2020-12-20 03:25:45 -08:00
Antoine Gersant
5e065c5e6a
Split configuration module (#117) 2020-12-18 01:14:24 -08:00
Antoine Gersant
e5c1d86577 Last FM unlink now correctly unsets credentials. Missing credentials no longer 401 2020-12-17 19:14:05 -08:00
Antoine Gersant
d4c78a0a31 Fixed a bug where only swagger index could be accessed without trailing slash 2020-12-15 21:12:00 -08:00
Antoine Gersant
ec39e696bb Fixed test on linux 2020-12-15 02:19:49 -08:00
Antoine Gersant
5b2d0a2216 Cosmetic change 2020-12-15 01:48:14 -08:00
Antoine Gersant
404d42d254 album art pattern is now case insensitive 2020-12-15 01:44:46 -08:00
Antoine Gersant
c2807b60de
Replace rocket with actix-web (#116)
* Adds actix dependency

* Failed attempt at test harness using actix

* Fixed test panic

* Simplified tests

* Run web server in tests

* Send json payloads

* Static file serving

* Default shutdown timeout

* Implement version endpoint

* Implements #[get("/initial_setup")]

* WIP put_settings endpoint

* Adds AdminRights extractor

* Fixed a bug where AdminRights extractor always failed

* Implements collection endpoints

* Re-use system runnner between calls

* Preserve client headers between API calls (tentative)

* Fixed test interferences

* Implemented more endpoints

* Implemented audio file serving

* Fixed sketchy responses

* Implements thumbnail endpoint

* Login endpoint WIP

* Implement login endpoint

* Auth support

* When using HTTP headers to authenticate, response now includes expected cookies

* Tentative fix for server not responding within docker

* Adds logging middleware + browse troubleshooting

* Tentative fix for path decoding issues

* Tentative fix for broken path decoding

* Fix routing issues w/ paths

* Fixed a bug where auth cookies were sent in every response

* More lenient test timeouts

* Fixed a bug where recent/random endpoints required trailing slashes

* Compilation fix for rocket branch

* More useful test matrix

* Signed session cookies (#106)

* Isolate conflicting dependencies between rocket and actix versions

* Removed macOS from test matrix

* Glorious test harness simplification

* Removed RequestBuilder

* Shutdown on ctrl+c

* Pin to stable

* Drop rocket

* Simplify dependencies

* Removed stray rocket dependency

* Better test matrix

* Skip windows build without bundled sqlite

* Offload thumbnail creation to a thread pool

* Compress responses when possible

* Removed unused manage state

* Fixed a bug where large playlists could not be saved

* Return HTTP 401 for last fm requests without authentication

* Web block (#115)

* web::block around DB operations

* web::block during auth utils hitting DB

* Fixed incorrect http response code for missing thumbnail

* Removed unecessary unwrap

* Eliminated unecessary unwrap
2020-12-14 21:18:44 -08:00
Antoine Gersant
9c45ad5238
Replace reqwest with ureq (#112)
* Replace reqwest with ureq

* Reqwest-free rustfm-scrobble
2020-12-13 15:53:31 -08:00
Antoine Gersant
34e0538562
App features re-organization (#111) 2020-12-10 03:23:00 -08:00
Antoine Gersant
0e52047417 Fixed typo 2020-12-07 23:31:05 -08:00
Antoine Gersant
b6c446fa02
Rewrote indexer (#107)
* Update index without rayon

* Use crossbeam channels

* Use a single thread for DB insertions

* Better use of rayon in clean()

* Index rewrite

* Parallelize traverser

* Don't swallow send error

* Use Drop trait to flush Inserter work

* Configurable number of traverser threads

* Use channels to manage the work queue instead of Mutex

* Removed unusable profiling feature
2020-12-07 20:07:10 -08:00
Antoine Gersant
8524c7d5fe More accurate teste for web client serving 2020-12-06 02:48:42 -08:00
Antoine Gersant
a3f7a306e5 Added todo 2020-12-05 21:19:12 -08:00
Antoine Gersant
8d2ed31fef Validate that session cookie looks somewhat encrypted 2020-12-05 16:53:46 -08:00
Antoine Gersant
0930ef45bb test_swagger_can_get_index_with_trailing_slash 2020-12-03 23:00:16 -08:00
Antoine Gersant
f80a42e666
Trailing slash tests (#105)
* Better test names

* Add tests for recent/random endpoints with trailing slash
2020-12-03 21:31:14 -08:00
Antoine Gersant
2eed57cc47 Added tests that auth cookie headers are not emitted in all requests 2020-12-03 01:33:32 -08:00
Antoine Gersant
e1934a8e92
Cleaned up startup code (#104) 2020-11-30 20:27:39 -08:00
Antoine Gersant
847c26ddfe
Service unit tests improvements (#103)
- Simpler API for TestService
- More granular tests
- Tests for authentication requirements
- Better error handling (and HTTP response codes) for various bad inputs
2020-11-30 01:26:55 -08:00
Antoine Gersant
1ffea255df Avoid unecessary copies 2020-11-26 19:30:42 -08:00
Antoine Gersant
538b41a2b4
Use standard directories when running on Linux (#91)
* Use standard Linux directories for application data (https://en.wikipedia.org/wiki/Filesystem_Hierarchy_Standard)

* Use standard system directories

* Cleanup all Polaris files during uninstall

* Expose get_pid_directory to rest of the crate

* Add separate targets for install binary and data files, clean up makefile

* Use environment variables for directory locations during install process

* On Linux, read locations from environment variables at compile time

* Split static_directory in two (web and swagger directories)

* Follow recommendations from the Make manual

* Avoid redundant directories

* Added workflow to validate installer setup

* Added CLI options to locate log file, pid file and cache directory

* Fixed an issue where build command did not support the xdg/system switch

* Renamed log option to log-level

* Fixed an issue where xdg install would do a system build

* Use re-usable action to make linux release

* Avoid nested actions (see https://github.com/actions/runner/issues/646)

* Updated installation instructions

* Replaced deprecated use of set-env
2020-11-26 15:57:08 -08:00
Antoine Gersant
0927f3815e Autoformat 2020-11-25 18:03:02 -08:00
Antoine Gersant
bcebaf499e Test cleanup 2020-11-25 18:02:57 -08:00
Antoine Gersant
e0d1f396a8 Removed support for prefix_url 2020-11-25 17:49:18 -08:00
Antoine Gersant
1c5a536277 Merge branch 'master' of https://github.com/agersant/polaris 2020-11-25 16:54:51 -08:00
Tobias Schmitz
bff49c22ec
Embedded artwork support (#101)
* Embedded artwork support for mp4 and id3 tags

* Embedded artwork support for flac tags.

* small fixes

* use first embedded artwork for directory

* added artwork tests

* updated Cargo.lock

* use first embedded artwork for missing artworks
2020-11-25 15:46:09 -08:00
Tobias Schmitz
4534a84c05
update mp4ameta dependency (#100) 2020-11-21 16:04:05 -08:00
Antoine Gersant
d78011e6bc Cleaned settings tests 2020-09-24 22:39:51 -07:00
Antoine Gersant
23a144761e Deserialize preferences 2020-09-24 22:16:24 -07:00
Antoine Gersant
7e46c6cd5a Added preferences API test 2020-09-24 22:14:40 -07:00
Antoine Gersant
a7ef7b2bd0 Added support for APE files 2020-09-24 01:46:29 -07:00
Antoine Gersant
cf67e44d20 Added API test for search without query 2020-09-24 00:07:55 -07:00
Antoine Gersant
ca8f046142 Thumbnails code cleanup 2020-09-23 22:20:27 -07:00
Antoine Gersant
8c32d7351c Updated mp4ameta dependency 2020-09-21 19:28:17 -07:00
Antoine Gersant
cd63564c03 Separate test inputs from outputs 2020-09-19 16:58:19 -07:00
Yannik Böttcher
8de736e563 properly export and use the match macro 2020-08-07 15:03:36 +02:00
Yannik Böttcher
943174bafa move match macro into utils module 2020-08-07 14:41:07 +02:00
Yannik Böttcher
9ee9786c0a include opus sample in test suite 2020-08-07 12:51:32 +02:00
Yannik Böttcher
b2152cecc3 use match_ignore_case macro 2020-08-07 12:44:36 +02:00
Yannik Böttcher
86a935fd79 update all instances of key.to_str 2020-08-06 21:09:41 +02:00
zaethan
70c7463f6f
Update src/index/metadata.rs
Co-authored-by: Laurențiu Nicola <lnicola@users.noreply.github.com>
2020-08-06 19:07:49 +00:00
zaethan
14a6466c2d
Update src/index/metadata.rs
Co-authored-by: Laurențiu Nicola <lnicola@users.noreply.github.com>
2020-08-06 19:07:21 +00:00
Yannik Böttcher
db97dbea46 use eq_ignore_ascii_case instead of to_uppercase 2020-08-06 19:32:52 +02:00
Yannik Böttcher
60e8f3ec46 remove redundant to_str 2020-08-06 18:17:55 +02:00
Yannik Böttcher
fee96e6b49 add support for opus files 2020-08-06 17:26:50 +02:00
Laurențiu Nicola
dbb5f79371 Use more threads when populating index 2020-07-21 06:54:20 +03:00