Commit Graph

364 Commits

Author SHA1 Message Date
Eliot Berriot 33972f1f40
Fixed broken uuid migration 2018-04-15 11:24:46 +02:00
Eliot Berriot 6bf4d46362
Ensure we don't duplicate libray tracks 2018-04-15 11:24:46 +02:00
Eliot Berriot e19fbf5436
Exclude federated files from library endpoint 2018-04-15 11:24:46 +02:00
Eliot Berriot b5ff339efa
We now use a proper user agent including instance version and url during outgoing requests 2018-04-07 16:20:34 +02:00
Eliot Berriot 99200ad077 Merge branch 'federation-follow-request' into 'develop'
Federation follow request

See merge request funkwhale/funkwhale!123
2018-04-07 13:55:53 +00:00
Eliot Berriot bf70fa1f53
Removed now useless private and public keys preferences 2018-04-07 15:53:10 +02:00
Eliot Berriot e10a82060d
Ensure we delete existing actors to reset private and public keys 2018-04-07 15:39:17 +02:00
Eliot Berriot 9612b1bace
Can now serve track from remote library 2018-04-07 15:34:35 +02:00
Eliot Berriot b29ca44797
Now store remote library tracks in a dedicated model, this is much simpler 2018-04-07 11:29:40 +02:00
Eliot Berriot f273faf9de
Added Library model to have more granular federation management 2018-04-06 18:49:29 +02:00
Eliot Berriot a03f0ffea5
We now have a library browsable via activitypub 2018-04-06 17:59:06 +02:00
Eliot Berriot 393110a7f0
Serializers for paginated collections 2018-04-06 17:58:43 +02:00
Eliot Berriot 4ce9f9bf08
Dedicated permission to access library data via activity pub 2018-04-06 17:58:16 +02:00
Eliot Berriot b75872866c
Util function to manipulate url params 2018-04-06 17:57:50 +02:00
Eliot Berriot 8db832f03b
Now store source AP track file on track_file 2018-04-06 15:20:53 +02:00
Eliot Berriot 04d710e690
Library can now receive import info from followed instances 2018-04-06 14:53:57 +02:00
Eliot Berriot 80206761a3
Easy and resusable Audio and AudioCollection serializer 2018-04-06 14:33:13 +02:00
Eliot Berriot 679adfe156
See #126: Added uuid field to all music models 2018-04-06 13:17:26 +02:00
Eliot Berriot 87daa81762
More factories 2018-04-05 23:27:19 +02:00
Eliot Berriot feab0f98ba
Spaces > Tabs 2018-04-05 23:27:03 +02:00
Eliot Berriot 363acca53d
AudioCollection to import job and track file creation 2018-04-05 23:26:41 +02:00
Eliot Berriot 4d6e894b62
AudioCollection to import job and track file creation 2018-04-05 23:22:28 +02:00
Eliot Berriot 1ca4505e2f Incremented version number 2018-04-05 16:05:45 +00:00
Eliot Berriot e0dcb87f15
Follow request approve/refuse logic 2018-04-04 23:12:41 +02:00
Eliot Berriot cb9309c298
Factorized undo follow 2018-04-04 22:40:57 +02:00
Eliot Berriot d8f86c4fce
Factorized follow logic between system actors, Library can now accept follows 2018-04-04 19:38:55 +02:00
Eliot Berriot b833a11fb6
FollowRequest model 2018-04-04 19:38:28 +02:00
Eliot Berriot 3ad1fe17d5
Test bot can now unfollow 2018-04-03 23:25:44 +02:00
Eliot Berriot 81e7f03f77
Now persist actors in database during auth 2018-04-03 23:25:22 +02:00
Eliot Berriot 657bd4b01a
Follow serializer 2018-04-03 23:24:51 +02:00
Eliot Berriot f19418d2c2
Added follow model and factory 2018-04-03 21:30:15 +02:00
Eliot Berriot 6aa6f1d8f8
Test actor can now follow back 2018-04-03 19:48:50 +02:00
Eliot Berriot 2f6d3ae180
Ensure unicity on actor username and domain 2018-04-03 18:35:08 +02:00
Eliot Berriot 168c4e7d53
system_conf property on Actor instances 2018-04-03 17:36:03 +02:00
Eliot Berriot a81c92dbf5
Additional setting to control wether music library federation needs approval 2018-04-02 22:43:59 +02:00
Eliot Berriot 48df30dbd8
We now persist system accounts to database 2018-04-02 22:12:28 +02:00
Eliot Berriot 39c5245c1b
Fix #148: User admin now includes signup and last login dates 2018-04-02 21:08:59 +02:00
Eliot Berriot 28700270bd
Removed factory import 2018-04-02 19:46:25 +02:00
Eliot Berriot 7bb15a3aa1 Merge branch 'federation-inbox' into 'develop'
Federation inbox

See merge request funkwhale/funkwhale!121
2018-04-02 17:28:53 +00:00
Eliot Berriot 77c6bd5839
Fixed failing test 2018-04-02 19:15:27 +02:00
Eliot Berriot a252051351
PoC with receiving /ping from Mastodon and replying pong 2018-04-02 18:07:46 +02:00
Eliot Berriot 3cf1a17087
We are now able to receive a toot and react to it 2018-04-01 22:11:46 +02:00
Eliot Berriot 6fbf8fa44c
Actor factory and fixture 2018-04-01 10:17:06 +02:00
Eliot Berriot 3650c3699b
Minor tweaks (logs, exceptions) 2018-03-31 18:41:53 +02:00
Eliot Berriot 741ab533b1
Added proper header when querying activity pub actor 2018-03-31 18:41:35 +02:00
Eliot Berriot ee0341ba1a
Ensure we truncate summary 2018-03-31 18:41:15 +02:00
Eliot Berriot f526f0c1fe
More flexible auth signature factory 2018-03-31 18:41:03 +02:00
Eliot Berriot e1ebd4988b
Fixed inconsistencies between test and prod requests 2018-03-31 18:40:41 +02:00
Eliot Berriot de777764da
Fake_request fixture for django requests 2018-03-31 18:39:54 +02:00
Eliot Berriot b5a4b2ca6a
Added signature authentication on activitypub view 2018-03-31 18:39:32 +02:00
Eliot Berriot 46d40c7ffa
Util function to convert django meta to proper headers 2018-03-31 18:39:10 +02:00
Bat c4991796e9 Add some pagination to radio details 2018-03-31 16:40:55 +01:00
Eliot Berriot 99e7e98bae
Fixed broken dev entrypoint 2018-03-31 16:25:23 +02:00
Eliot Berriot 703d70d544
Use absolute urls 2018-03-31 15:57:29 +02:00
Eliot Berriot 0c8faf83c5
Can now have multiple system actors
We also handle webfinger/activity serialization properly
2018-03-31 15:47:21 +02:00
Eliot Berriot 6c3b7ce154
More reserved usernames 2018-03-31 15:44:46 +02:00
Eliot Berriot 2b9a5ffe18
ActivityPub Actor model 2018-03-31 15:44:35 +02:00
Eliot Berriot 22370d1b2c
Use pytest-env plugin to manage test settings instead of settings file 2018-03-31 14:45:11 +02:00
Bat 85aef4422a Add a detail page for radios 2018-03-31 12:59:45 +01:00
Eliot Berriot c63b7f929d
Use own requests-http-signing to be compatible with Signature header 2018-03-30 21:59:58 +02:00
Eliot Berriot 74945759cc
Switched from Service to Person for actor representation 2018-03-30 18:34:23 +02:00
Eliot Berriot abca719d16
More fields on instance actor repr 2018-03-30 18:02:50 +02:00
Eliot Berriot d8b74b9556
Proper federation namespace and prefix 2018-03-30 18:02:14 +02:00
Eliot Berriot 4487eb4cca
Ensure cache cleaning in preferences fixture 2018-03-30 18:01:52 +02:00
Eliot Berriot cde8732dfa
Use proper renderers for activity pub / webfinger 2018-03-29 23:29:56 +02:00
Eliot Berriot 75710638de
Url and views for instance actor and webfinger 2018-03-29 00:00:47 +02:00
Eliot Berriot e793f8365f
Webfinger utils 2018-03-29 00:00:20 +02:00
Eliot Berriot 90c1d02919
Added FUNKWHALE_HOSTNAME and FEDERATION_HOSTNAME settings 2018-03-29 00:00:01 +02:00
Eliot Berriot 588da6ff33
Can now generate a key pair for the instance 2018-03-28 23:56:44 +02:00
Eliot Berriot 707868d794
Can now fetch public key from actor url 2018-03-28 23:56:44 +02:00
Eliot Berriot 2f473d7570
Added requests-mock dependency and fixture 2018-03-28 23:56:44 +02:00
Eliot Berriot 5e901dc5a4
Fixed a bunch of failing tests 2018-03-28 23:54:08 +02:00
Eliot Berriot 85ce220f29 Merge branch 'federation-signing-requests' into 'develop'
Federation signing requests

See merge request funkwhale/funkwhale!106
2018-03-26 20:14:28 +00:00
Eliot Berriot 4612a8a560 Merge branch '121-upgrade-to-python36' into 'develop'
Resolve "Random issue on import"

Closes #121

See merge request funkwhale/funkwhale!113
2018-03-25 21:32:44 +00:00
Eliot Berriot 5e1dce5883
Fix #121: Upgraded to Python 3.6 to fix weird but harmless weakref error on django task 2018-03-25 23:30:46 +02:00
Eliot Berriot e1bdd14fff
Fix #140: Better error messages in case of missing environment variable 2018-03-25 23:05:46 +02:00
Eliot Berriot c2985b7dba Merge branch 'coverage' into 'develop'
Compute coverage on API tests

See merge request funkwhale/funkwhale!111
2018-03-25 20:50:30 +00:00
Eliot Berriot 82aa8c4e22
Compute coverage on API tests 2018-03-25 22:45:37 +02:00
Eliot Berriot 32e3d82738
Switched to psycopg2-binary to avoid warning 2018-03-25 22:42:14 +02:00
Eliot Berriot a87a2837db
Fixed failing tests 2018-03-25 22:34:30 +02:00
Eliot Berriot d310628cb5
refactored tests, no have __init__ everywhere 2018-03-25 22:27:38 +02:00
Eliot Berriot 18d8baae34
API Views/serializers/tests for activity (#141) 2018-03-25 17:24:08 +02:00
Eliot Berriot 1f2e14b20e
Use anonymous_user fixture in other tests 2018-03-25 17:18:44 +02:00
Eliot Berriot 122c39075a
Fixed privacy issue in get_privacy_query utils function 2018-03-25 17:18:22 +02:00
Eliot Berriot 2d4003c8c4
anonymoususer test fixture 2018-03-25 17:17:51 +02:00
Eliot Berriot fce5ee0e7f
Renamed listening end_date to creation_date 2018-03-25 17:17:33 +02:00
Eliot Berriot f36a9e2ac9 Merge branch '138-import-unicode' into 'develop'
Resolve "Importer chokes on files with bad unicode characters"

Closes #138 and #120

See merge request funkwhale/funkwhale!108
2018-03-25 13:46:26 +00:00
Eliot Berriot e99d757b57
Fix #120: Better error handling during file import 2018-03-25 15:44:48 +02:00
Eliot Berriot f1cf250e29
Fix #138: Better handling of utf-8 filenames during file import 2018-03-25 15:40:37 +02:00
Eliot Berriot 952407d173 Merge branch '139-restrict-usernames' into 'develop'
Resolve "Allow restricting allowed usernames"

Closes #139

See merge request funkwhale/funkwhale!107
2018-03-24 19:33:38 +00:00
Eliot Berriot 4b69d64db2
Fix #139: We now restrict some usernames from being used during signup 2018-03-24 20:31:36 +01:00
Eliot Berriot 4522f5997e
More test cases for request signing and added helpers to verify signature 2018-03-24 16:24:10 +01:00
Eliot Berriot aa7365b71f
Basic logic for signing/verifying requests 2018-03-24 15:20:15 +01:00
Eliot Berriot a890bc490b
Ensure we update all requirements when installing from pip/requirements.txt 2018-03-23 12:10:18 +01:00
Eliot Berriot b780bee874
Version bump and changelog 2018-03-21 21:05:03 +01:00
Eliot Berriot 529114c89c
Added missing fields in playlist serializer 2018-03-21 20:56:26 +01:00
Eliot Berriot 71d46e4361
Simplified playlist serializer and ensure update return same payload as detail 2018-03-21 19:03:57 +01:00
Eliot Berriot 6a9a34d244
Can now clear playlist 2018-03-21 12:19:07 +01:00
Eliot Berriot bf6fe44bed
More filters / ordering option on playlist API 2018-03-21 11:58:11 +01:00
Eliot Berriot 16f631af1a
Performance optimization on playlisttrack serialization 2018-03-20 22:44:28 +01:00
Eliot Berriot f8b15a3f48
Added API endpoint to insert multiple tracks into playlist 2018-03-20 19:56:42 +01:00
Eliot Berriot 1729c4f83e
250 is a saner default for playlist size 2018-03-20 19:55:36 +01:00
Eliot Berriot 497f81e5ab
Typo in returned api payload 2018-03-20 19:14:45 +01:00
Eliot Berriot 244ebd7ab1
Dropped hard constraint on track indexes and added more tests 2018-03-20 19:14:07 +01:00
Eliot Berriot f917c5d0c4
Playlist filterset 2018-03-20 15:34:35 +01:00
Eliot Berriot 08b28a7d98
Added playlist tracks count and modification date in API 2018-03-20 15:34:34 +01:00
Eliot Berriot 15300e255c
Removed pytest warning 2018-03-20 15:34:34 +01:00
Eliot Berriot e87e2654e8
Permissions and db state fixes with new index field 2018-03-20 15:34:34 +01:00
Eliot Berriot 257e67b5a6
New "index" field on playlist tracks, and .insert() metod to manage playlists 2018-03-20 15:34:34 +01:00
Eliot Berriot 8821a1bb43
Removed superfluous mptt requirement 2018-03-20 15:34:33 +01:00
Eliot Berriot 944135e752
Capped number of tracks in playlists 2018-03-20 15:34:33 +01:00
Eliot Berriot d8486beeb0
Can now list tracks from within playlist endpoint 2018-03-20 15:34:33 +01:00
Eliot Berriot 9a909798e7
Additional permissions checks on playlist views 2018-03-20 15:34:33 +01:00
Eliot Berriot 4f7fa09a78
Playlisttrack factory 2018-03-20 15:34:33 +01:00
Eliot Berriot d7adaf398f
Can now use nodb_factory fixtue in tests for faster tests 2018-03-20 15:34:33 +01:00
Eliot Berriot 367014f70e
Added owner permission to check user has the right to read/update object 2018-03-20 15:34:33 +01:00
Eliot Berriot 3e277aad4f
Added helper to filter queryset by privacy level 2018-03-20 15:34:32 +01:00
Eliot Berriot 2a3f43ecb1
Ensure privacy_level is settable/inherited properly 2018-03-20 15:34:32 +01:00
Eliot Berriot 859f8a0570
Replaced is_public flag by brand new privacy_level field on playlists 2018-03-20 15:34:32 +01:00
Eliot Berriot 9fdbc7b859
factorized privacy_level field 2018-03-20 15:34:32 +01:00
Eliot Berriot 639cd5da5b
Moved playlist tests in a dedicated directory 2018-03-20 15:34:32 +01:00
Eliot Berriot cec0dcfc12 Merge branch '119-login-redirection' into 'develop'
Fixed #119: forced redirection to login even with API_AUTHENTICATION_REQUIRED=False

Closes #119

See merge request funkwhale/funkwhale!91
2018-03-15 21:58:09 +00:00
Eliot Berriot 4298c4236e
Fixed #119: forced redirection to login even with API_AUTHENTICATION_REQUIRED=False 2018-03-15 22:34:20 +01:00
Eliot Berriot 70cd96f198
Removed unused sphinx dependency in requirements now we use a separate container 2018-03-13 22:28:18 +01:00
Eliot Berriot 89f90d1585
Moved daphne to common requirements 2018-03-12 23:15:39 +01:00
Eliot Berriot c5e28519dd
Removed unused dependencies 2018-03-12 23:15:28 +01:00
Eliot Berriot 99f33dd392
Make api docker image able to run tests 2018-03-12 23:07:08 +01:00
Eliot Berriot 046648ce6c
Moved pytest.ini to setup.cfg 2018-03-12 23:06:32 +01:00
Eliot Berriot 69aacfea51
Deleted unused files 2018-03-12 23:06:21 +01:00
Eliot Berriot a448eaaf17
Fix #117: Use django-cacheops to cache common ORM requests 2018-03-08 23:21:59 +01:00
Eliot Berriot c70ab72bc0 Merge branch '114-exclude-empty-albums' into 'develop'
Fix #114: can now filter artists and albums with no listenable tracks

Closes #114

See merge request funkwhale/funkwhale!83
2018-03-07 22:19:21 +00:00
Eliot Berriot bfeb86865d
Fix #114: can now filter artists and albums with no listenable tracks 2018-03-07 23:08:28 +01:00
Eliot Berriot 99a91c1e74
Fix #115: broken import request admin 2018-03-07 22:36:37 +01:00
Eliot Berriot ec3e5a4304
Version bump and changelog 2018-03-06 21:56:01 +01:00
Eliot Berriot 20ba6f926a Merge branch '111-skip-acoustid' into 'develop'
Resolve "Allow skip accoustid entirely on music import (CLI)"

Closes #111

See merge request funkwhale/funkwhale!79
2018-03-06 20:54:28 +00:00
Eliot Berriot b1d210aeb2 Merge branch '110-remove-cachalot' into 'develop'
Fix #110: completely removed django cachalot

Closes #110

See merge request funkwhale/funkwhale!82
2018-03-06 20:34:56 +00:00
Eliot Berriot 88092322d8
Fix #110: completely removed django cachalot 2018-03-06 20:51:28 +01:00
Eliot Berriot 88ea79ab0b Merge branch '112-batch-id' into 'develop'
Fix #112: missing batch ID in import output

Closes #112

See merge request funkwhale/funkwhale!80
2018-03-06 19:48:45 +00:00
Eliot Berriot dd61dd7416
Fix #112: missing batch ID in import output 2018-03-06 20:41:39 +01:00
Eliot Berriot 17bda77efb
Fix #111: allow skipping of acoustid matching 2018-03-06 20:29:32 +01:00
Eliot Berriot 2167c1731c
Removed duplicate variable 2018-03-06 17:44:53 +01:00
Eliot Berriot 20d8daa115
More generic entrypoint to work with non-compose setups 2018-03-06 13:15:53 +01:00
Eliot Berriot e4c044638b
Fixed 500 error in authentication 2018-03-05 21:43:07 +01:00
Eliot Berriot d1d06ce760
Bash script to setup / reload the demo, fix #29 2018-03-04 18:18:30 +01:00
Eliot Berriot 2354721cd9
Fixed import crashing when no acoustid found 2018-03-04 18:14:37 +01:00
Eliot Berriot eef2ff3f9a
Fixed broken daphne and removed useless templates 2018-03-04 16:05:41 +01:00
Eliot Berriot 6011cf2098
Version bump and changelog 2018-03-04 15:16:35 +01:00
Eliot Berriot c0ff34e8b3
Fixed failing tests 2018-03-03 23:23:42 +01:00
Eliot Berriot 120dda2c75
Sample updates, changelog and documentation for channels and activity 2018-03-03 23:18:33 +01:00
Eliot Berriot 1800f7ad17
API endpoint for updating privacy 2018-03-03 11:20:21 +01:00