Re: [FOSSology] REST API doesn't work for me
Hi, Gaurav Thank you for your reply. I will pull the latest image and try. Best regards Lei > -Original Message- > From: Mishra, Gaurav [mailto:mishra.gau...@siemens.com] > Sent: Thursday, July 11, 2019 4:24 PM > To: Lei, Maohui > Cc: fossol...@fossology.org > Subject: RE: REST API doesn't work for me > > Hello Lei, > > I just tried running the exact same commands on my system and it seems to be > working fine. > -- > $ curl -k -s -S -u fossy:fossy -X GET > http://localhost:8081/repo/api/v1/folders > {"code":400,"message":"Authorization header is malformed or > empty.","type":"ERROR"} > -- > > Probably you are trying to running an old image. Can you please pull the > latest > image again? > > If it is still not working, I would suggest you to check if the following > settings are correct in your container: > > File /etc/apache2/conf-enabled/fossology.conf should contain > > RewriteEngine on > RewriteCond %{REQUEST_FILENAME} !-d > RewriteCond %{REQUEST_FILENAME} !-f > RewriteRule "^api/(.*)" "/repo/api/index.php" [QSA,L] > RewriteRule .* - [env=HTTP_AUTHORIZATION:%{HTTP:Authorization}] > > > And please check if the mod_rewrite is enabled in apache. You can check using > "a2query -m rewrite". > If the rewrite module is disabled, please enable it using "a2enmod rewrite" > and > restart apache. > > Hope this will help. > > With best regards, > Gaurav Mishra > > -Original Message- > From: fossology@lists.fossology.org On Behalf > Of leimaohui > Sent: 11 July 2019 13:23 > To: fossol...@fossology.org > Subject: [FOSSology] REST API doesn't work for me > > Hi, all > > I tried fossology REST API but failed. The following is my steps. > > step1.Start the latest fossology docker. > > $ sudo docker run -d -p 8081:80 fossology/fossology:latest > 390d501fec6e773340ff466c9876cf4d2155562748ed1e749d5457d490ad516e > $ sudo docker ps > CONTAINER IDIMAGECOMMAND > CREATED STATUS PORTS NAMES > 390d501fec6efossology/fossology:latest "/fossology/docker..." 18 > seconds ago Up 4 seconds0.0.0.0:8081->80/tcp focused_jepsen > > > step2. Tried REST API, but failed. > > $ curl -k -s -S -u fossy:fossy -X GET > http://localhost:8081/repo/api/v1/folders > > 404 Not Found > > Not Found > The requested URL /repo/api/v1/folders was not found on this server. > > Apache/2.4.10 (Debian) Server at localhost Port 8081 > > > > I wonder if there is something error in my steps. Who can give me some > suggestions? > > Best regard > Lei Maohui > > > > > > -=-=-=-=-=-=-=-=-=-=-=- Links: You receive all messages sent to this group. View/Reply Online (#3267): https://lists.fossology.org/g/fossology/message/3267 Mute This Topic: https://lists.fossology.org/mt/32428064/21656 Group Owner: fossology+ow...@lists.fossology.org Unsubscribe: https://lists.fossology.org/g/fossology/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
Re: [FOSSology] REST API doesn't work for me
Hello Lei, I just tried running the exact same commands on my system and it seems to be working fine. -- $ curl -k -s -S -u fossy:fossy -X GET http://localhost:8081/repo/api/v1/folders {"code":400,"message":"Authorization header is malformed or empty.","type":"ERROR"} -- Probably you are trying to running an old image. Can you please pull the latest image again? If it is still not working, I would suggest you to check if the following settings are correct in your container: File /etc/apache2/conf-enabled/fossology.conf should contain RewriteEngine on RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteRule "^api/(.*)" "/repo/api/index.php" [QSA,L] RewriteRule .* - [env=HTTP_AUTHORIZATION:%{HTTP:Authorization}] And please check if the mod_rewrite is enabled in apache. You can check using "a2query -m rewrite". If the rewrite module is disabled, please enable it using "a2enmod rewrite" and restart apache. Hope this will help. With best regards, Gaurav Mishra -Original Message- From: fossology@lists.fossology.org On Behalf Of leimaohui Sent: 11 July 2019 13:23 To: fossol...@fossology.org Subject: [FOSSology] REST API doesn't work for me Hi, all I tried fossology REST API but failed. The following is my steps. step1.Start the latest fossology docker. $ sudo docker run -d -p 8081:80 fossology/fossology:latest 390d501fec6e773340ff466c9876cf4d2155562748ed1e749d5457d490ad516e $ sudo docker ps CONTAINER IDIMAGECOMMAND CREATED STATUS PORTS NAMES 390d501fec6efossology/fossology:latest "/fossology/docker..." 18 seconds ago Up 4 seconds0.0.0.0:8081->80/tcp focused_jepsen step2. Tried REST API, but failed. $ curl -k -s -S -u fossy:fossy -X GET http://localhost:8081/repo/api/v1/folders 404 Not Found Not Found The requested URL /repo/api/v1/folders was not found on this server. Apache/2.4.10 (Debian) Server at localhost Port 8081 I wonder if there is something error in my steps. Who can give me some suggestions? Best regard Lei Maohui -=-=-=-=-=-=-=-=-=-=-=- Links: You receive all messages sent to this group. View/Reply Online (#3266): https://lists.fossology.org/g/fossology/message/3266 Mute This Topic: https://lists.fossology.org/mt/32428064/21656 Group Owner: fossology+ow...@lists.fossology.org Unsubscribe: https://lists.fossology.org/g/fossology/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
[FOSSology] REST API doesn't work for me
Hi, all I tried fossology REST API but failed. The following is my steps. step1.Start the latest fossology docker. $ sudo docker run -d -p 8081:80 fossology/fossology:latest 390d501fec6e773340ff466c9876cf4d2155562748ed1e749d5457d490ad516e $ sudo docker ps CONTAINER IDIMAGECOMMAND CREATED STATUS PORTS NAMES 390d501fec6efossology/fossology:latest "/fossology/docker..." 18 seconds ago Up 4 seconds0.0.0.0:8081->80/tcp focused_jepsen step2. Tried REST API, but failed. $ curl -k -s -S -u fossy:fossy -X GET http://localhost:8081/repo/api/v1/folders 404 Not Found Not Found The requested URL /repo/api/v1/folders was not found on this server. Apache/2.4.10 (Debian) Server at localhost Port 8081 I wonder if there is something error in my steps. Who can give me some suggestions? Best regard Lei Maohui -=-=-=-=-=-=-=-=-=-=-=- Links: You receive all messages sent to this group. View/Reply Online (#3265): https://lists.fossology.org/g/fossology/message/3265 Mute This Topic: https://lists.fossology.org/mt/32428064/21656 Group Owner: fossology+ow...@lists.fossology.org Unsubscribe: https://lists.fossology.org/g/fossology/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-