Sunstone requests "GET /appliance" instead of the URI that is configured in sunstone-server.conf
|Assignee:||Daniel Molina||% Done:|
|Target version:||Release 4.14|
|Affected Versions:||OpenNebula 4.12|
I have set up our own marketplace (appmarket). The appmarket is available under "hostname/market/appliance". If I configure hostname/market/appliance in sunstone-server.conf (:marketplace_url:) sunstone makes request to hostname/appliance in stead of "hostname/market/appliance". Sunstone seems to have the request URI part hard coded (appliance), which results in "GET /appliance HTTP/1.1" 404 448 "-" "OpenNebula 4.12.1 (Sunstone)" and "Cannot connect to OpenNebula Marketplace" error in Sunstone.
#2 Updated by Daniel Molina about 6 years ago
You should modify the following lines:
to something like:
req = Net::HTTP::Proxy(@host, @port)::Get.new(@uri.path + path)
req = Net::HTTP::Proxy(@host, @port)::Post.email@example.com + (path)
If you are using the appmarket library (that means you added a new tab in sunstone instead of using the marketplace tab and added a new route in sunstone-server), you should modify the Get,Post,Put,Delete methods adding the @uri.path:
Hope this helps
#3 Updated by Stefan Kooman about 6 years ago
I applied the changes as suggested by Daniel and can confirm that these changes make it work (marketplace as well as appmarket tab). For the "marketplace_url / Appmarket endpoint" a note should be added that "/appliance" is added to the request uri, so to avoid /market/appliance/appliance calls.