-
Notifications
You must be signed in to change notification settings - Fork 199
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ampache #91
Ampache #91
Conversation
sweet |
* It reads out the annotations of a controller method and checks which if | ||
* ampache authentification stuff has to be done. | ||
*/ | ||
class AmpacheMiddleware extends Middleware { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice show case for middleware usage! I'll add a public API for middleware handling
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great! I also have a custom middleware that I would love to still be able to use.
I added settings to enable/disable ampache support ... for admins and users |
nice |
It generates the password hashes used by the Ampache API - and also clears them if ampache gets disabled. Also the handshake is working right now. |
@kabum I just tried to connect with viridian (a pure ampache player) and it failes. That player tries to connect like this: |
same for amarok .... |
Use |
|
@kabum anything left to do or ready for review? |
@jancborchardt Many left to do ... but not enough time. I've focused on core in the last weeks |
Yeah, no worries. Just went through pull requests. :) |
@fossxplorer I just tested this branch with tomahawk and it shows up in tomahawk ... just the retrieving of further track data isn't implemented. Will look into it tomorrow :) |
I faced some issues: I cannot login the user because I don't have the password to log the user in. Therefore the ampache API wouldn't work if encryption is enabled. This problem can't be avoided due to the ampache protocol, which doesn't support an other way of authentication. Workaround which should NEVER be implemented (and is therefore lined through): We should simply deactivate the Ampache API for instances with encryption enabled. @schiesbn: I hope I'm correct with my statements. |
@kabum do we need the Also, I assume the hamster icon comes from Tomahawk and the »Ampache Sammlung« text every person types in themselves? (Just saying, because I’m not sure if clients use the word »Ampache« at all and if we should hence use it so much.) |
@jancborchardt I just typed in the URL from ownCloud (looks like the "WebDAV URL" in the personal settings) and then added my credentials and all other was the default. So it's as easy as possible. BTW: The plugin in tomahawk itself is called Ampache and I just used it to see if it works ;) |
could we have a separate ampache password for cases where ssl is enabled? am I neglecting to think of something? thanks for all your work on this, it's much appreciated. |
@mhauserr That sounds good, because the ampache stuff has to be actived (due to the weakening of the password hashing) @jancborchardt What do you think? cc @DeepDiver1975 @karlitschek @butonic Is a separate password acceptable? |
Yes, your statements are correct. If there is no way to authenticate the user with his password than we should disable the Ampache API for now if encryption is enabled. |
Good to see Ampache support is a 'work in progress' to come back in OC6. Good new!
|
has there been a decision on how to support apache with ssl yet? is there any stuff that needs to be done to help or is there a version we can help test? |
any news about this? |
Rebased and amended |
I removed the Ampache setting. Users can now generate a password (one-time passwords) and revoke those. So their password isn't weaken at any time. |
Will merge that now. Now the translation guys can do their work. :) Testing is much appreciated. Thank you all for your patience - especially @j-ed @fossxplorer @butonic @jancborchardt @karlitschek @DeepDiver1975 That was a hard one - not really finished during GSoC, but better later than never ;) 🚀 |
@MorrisJobke Thanks a lot for your work !! But I don't arrive to generate an API password. When I type the description "Just Player" (on ownCloud "Personal" page) and click on Generate API password, the generation is loading indefinitely. So, I don't have any API password and couldn't test on Mac or Android. |
@HLFH Can you have a look at the log files? (owncloud.log in data folder, webservers log) And also check the Javascript console in your webbrowser (F12 for chrome and then "Console", Ctrl+Shift+k for Firefox) Thanks |
@HLFH Can you also specify the browser you use? |
Thanks :) Server Hardware : Intel NUC D54250WYKH Client : MacBookAir mid-2011 with OS X 10.9.2 using Firefox 29.0 and Chromium 34.0 (I didn't put the right clock time on BIOS and NTP is not running for the moment) In owncloud.log, I have several hundreds of that : {"app":"OCP\\Share","message":"Sharing backend OCA\\Contacts\\Share\\Addressbook not registered, OCA\\Contacts\\Share\\Addressbook is already registered for addressbook","level":2,"time":"2014-03-24T17:29:03+00:00"}
{"app":"OCP\\Share","message":"Sharing backend OCA\\Contacts\\Share\\Addressbook not registered, OCA\\Contacts\\Share\\Addressbook is already registered for addressbook","level":2,"time":"2014-03-24T17:29:05+00:00"}
{"app":"OCP\\Share","message":"Sharing backend OCA\\Contacts\\Share\\Addressbook not registered, OCA\\Contacts\\Share\\Addressbook is already registered for addressbook","level":2,"time":"2014-03-24T17:29:05+00:00"}
{"app":"OCP\\Share","message":"Sharing backend OCA\\Contacts\\Share\\Addressbook not registered, OCA\\Contacts\\Share\\Addressbook is already registered for addressbook","level":2,"time":"2014-03-24T17:29:05+00:00"}
{"app":"OCP\\Share","message":"Sharing backend OCA\\Contacts\\Share\\Addressbook not registered, OCA\\Contacts\\Share\\Addressbook is already registered for addressbook","level":2,"time":"2014-03-24T17:29:05+00:00"}
{"app":"OCP\\Share","message":"Sharing backend OCA\\Contacts\\Share\\Addressbook not registered, OCA\\Contacts\\Share\\Addressbook is already registered for addressbook","level":2,"time":"2014-03-24T17:29:05+00:00"}
{"app":"OCP\\Share","message":"Sharing backend OCA\\Contacts\\Share\\Addressbook not registered, OCA\\Contacts\\Share\\Addressbook is already registered for addressbook","level":2,"time":"2014-03-24T17:29:06+00:00"}
{"app":"OCP\\Share","message":"Sharing backend OCA\\Contacts\\Share\\Addressbook not registered, OCA\\Contacts\\Share\\Addressbook is already registered for addressbook","level":2,"time":"2014-03-24T17:29:06+00:00"}
{"app":"OCP\\Share","message":"Sharing backend OCA\\Contacts\\Share\\Addressbook not registered, OCA\\Contacts\\Share\\Addressbook is already registered for addressbook","level":2,"time":"2014-03-24T17:29:06+00:00"}
{"app":"OCP\\Share","message":"Sharing backend OCA\\Contacts\\Share\\Addressbook not registered, OCA\\Contacts\\Share\\Addressbook is already registered for addressbook","level":2,"time":"2014-03-24T17:29:06+00:00"} So, for owncloud.log, there is anything related to my Ampache issue, just an awful friendly warning. In my favorite browser Firefox (29.0), I have that :
In Chromium (34.0.1836.0 (250493)), I have that :
Nothing important to report for webservers logs : [root@intelnuc log]# systemctl status nginx -l
nginx.service - A high performance web server and a reverse proxy server
Loaded: loaded (/usr/lib/systemd/system/nginx.service; enabled)
Active: active (running) since lun. 2014-03-24 18:21:58 CET; 42min ago
Process: 295 ExecStart=/usr/bin/nginx -g pid /run/nginx.pid; daemon on; master_process on; (code=exited, status=0/SUCCESS)
Process: 258 ExecStartPre=/usr/bin/nginx -t -q -g pid /run/nginx.pid; daemon on; master_process on; (code=exited, status=0/SUCCESS)
Main PID: 304 (nginx)
CGroup: /system.slice/nginx.service
├─304 nginx: master process /usr/bin/nginx -g pid /run/nginx.pid; daemon on; master_process on
├─305 nginx: worker process
├─306 nginx: worker process
├─307 nginx: worker process
└─308 nginx: worker process
mars 24 18:21:58 intelnuc systemd[1]: Starting A high performance web server and a reverse proxy server...
mars 24 18:21:58 intelnuc systemd[1]: Started A high performance web server and a reverse proxy server.
mars 24 18:22:10 intelnuc nginx[295]: 2014/03/24 18:22:10 [error] 305#0: *1 open() "/var/www/favicon.ico" failed (2: No such file or directory), client: 192.168.1.1, server: localhost, request: "GET /favicon.ico HTTP/1.1", host: "gitnote.eu"
mars 24 18:22:10 intelnuc nginx[295]: 2014/03/24 18:22:10 [error] 305#0: *1 open() "/var/www/favicon.ico" failed (2: No such file or directory), client: 192.168.1.1, server: localhost, request: "GET /favicon.ico HTTP/1.1", host: "gitnote.eu"
mars 24 18:26:25 intelnuc nginx[295]: 2014/03/24 18:26:25 [error] 308#0: *135 open() "/var/www/owncloud/favicon.ico" failed (2: No such file or directory), client: 192.168.1.1, server: cloud.gitnote.eu, request: "GET /favicon.ico HTTP/1.1", host: "cloud.gitnote.eu"
[root@intelnuc log]# systemctl status php-fpm -l
php-fpm.service - The PHP FastCGI Process Manager
Loaded: loaded (/usr/lib/systemd/system/php-fpm.service; enabled)
Active: active (running) since lun. 2014-03-24 18:21:58 CET; 43min ago
Main PID: 263 (php-fpm)
Status: "Processes active: 0, idle: 3, Requests: 243, slow: 0, Traffic: 0.4req/sec"
CGroup: /system.slice/php-fpm.service
├─263 php-fpm: master process (/etc/php/php-fpm.conf)
├─608 php-fpm: pool www
├─710 php-fpm: pool www
└─796 php-fpm: pool www
mars 24 18:21:58 intelnuc systemd[1]: Started The PHP FastCGI Process Manager.
[root@intelnuc log]# systemctl status mysqld -l
mysqld.service - MariaDB database server
Loaded: loaded (/usr/lib/systemd/system/mysqld.service; enabled)
Active: active (running) since lun. 2014-03-24 18:22:00 CET; 43min ago
Process: 227 ExecStartPost=/usr/bin/mysqld-post (code=exited, status=0/SUCCESS)
Main PID: 226 (mysqld)
CGroup: /system.slice/mysqld.service
└─226 /usr/bin/mysqld --pid-file=/run/mysqld/mysqld.pid
mars 24 18:21:58 intelnuc mysqld[226]: 140324 18:21:58 InnoDB: Completed initialization of buffer pool
mars 24 18:21:58 intelnuc mysqld[226]: 140324 18:21:58 InnoDB: highest supported file format is Barracuda.
mars 24 18:21:58 intelnuc mysqld[226]: 140324 18:21:58 InnoDB: Waiting for the background threads to start
mars 24 18:21:59 intelnuc mysqld[226]: 140324 18:21:59 Percona XtraDB (http://www.percona.com) 5.5.36-MariaDB-33.0 started; log sequence number 21527634
mars 24 18:21:59 intelnuc mysqld[226]: 140324 18:21:59 [Note] Plugin 'FEEDBACK' is disabled.
mars 24 18:21:59 intelnuc mysqld[226]: 140324 18:21:59 [Note] Server socket created on IP: '0.0.0.0'.
mars 24 18:21:59 intelnuc mysqld[226]: 140324 18:21:59 [Note] Event Scheduler: Loaded 0 events
mars 24 18:21:59 intelnuc mysqld[226]: 140324 18:21:59 [Note] /usr/bin/mysqld: ready for connections.
mars 24 18:21:59 intelnuc mysqld[226]: Version: '5.5.36-MariaDB-log' socket: '/run/mysqld/mysqld.sock' port: 3306 MariaDB Server
mars 24 18:22:00 intelnuc systemd[1]: Started MariaDB database server. |
and
Looks suspicious. I guess I missed the backport for stable6 and stable5 :( Will do that. Thanks |
@MorrisJobke I have the same errors (TypeError: OC.generateUrl is not a function settings-user.js:70) but I'm on ownCloud 6.0.2 (http://download.owncloud.org/community/owncloud-6.0.2.tar.bz2) and I'm using Music in the last master branch so with the fixes 3f37653. I guess I have to be on ownCloud Master. |
@HLFH No. I tested with stable5, stable6 and master branch and it works. owncloud/core#7578 <- The backport was after the 6.0.2 release. So I will backport this inside of the music app. Thanks (I tested on git stable6 and there it is included) |
Awesome work @MorrisJobke! Tested streaming to Android via https using JustPlayer and Ampache Provider. Music streams without a hitch and is very light on server resources (important for me since I'm running archlinux-arm on a rooted pogoplug). |
@unomar Awesome to hear :) Did you have any problems with the user interface? (just asking to maybe improve it more and make it intuitive) Or is it just fine as it is now? |
The only issue I had was during upgrade from the old version. The DB threw an "Integrity Constraint Violation" on oc_music_ampache_users.description. I just manually deleted the ampache tables and it worked. I think the interface is fine. Generating the API key is simple enough. With a little documentation I'm sure it would be easy for anyone. |
@unomar Yeah. I changed the Ampache tables a lot here in the development branch. But as this is just a development branch I think it's okay to have some manual steps. Will write the documention. Thanks. |
@MorrisJobke Yeah, I figured it was just because I was using the bleeding edge. Is there a way to trigger a music rescan when you change the music dir path? I tested using the provided music folder and later switched it to my main mp3 library, but it still only lists the single song. No offense to "Projekt Eva", but I'd prefer a few more songs. :P |
@unomar The music dir path doesn't affect the music scanner. The scanner always scans the whole ownCloud instance (will be changed later maybe). It just filters the collection method of the API which is used by the webinterface. So it will just filter all of your music for the webinterface in a way to improve the performance of this. I know this is a quite odd behaviour. |
Is it true, that I still can't play/stream music over ampache? After some weeks, I updated today and tried it with "Lullaby 4 Ampache" on Android. I can see all songs, but if I try to play I do get a message saying "TODO"? |
@SunboX I guess you use 0.1.9.1-rc , right? I will try this client - is this the one you mentioned: https://play.google.com/store/apps/details?id=net.sileht.lullaby It seems, that the client doesn't use the provided URLs |
No, I used the master branch. I will try tag 0.1.9.1-rc :) |
Same with 0.1.9.1-rc I can list all tracks, but if I try to play something I always getting the messages: "connected" ... "disconnected" ... "connected" ... "disconnected" ... and so on |
Using my login and a generated password for the ampache API, I can't use the Ampache Resolver in Tomahawk. The log says : Any idea why ? |
Still having the same behaviour with Owncloud 7.0.1 and Music app 0.3. Amarok is apparently able to connect and detect the number of songs, but not to display the songs (or play any, for that matter). I don't know why this is happening although this config is supposed to work with Tomahawk... |
Non-Data Methods
Data Methods
For artists, albums and songs are following additional arguments possible but they are not represented in the current data model:
Postponed queries
See #160