Acquia Cloud Dashboard allows you to manage your Acquia Hosting from any Drupal Site.

You can use the Drupal Site hosted on Acquia, or a separate Drupal Site hosted elsewhere, to manage your Acquia Hosting.

More Details @ https://drupal.org/sandbox/saitanay/2050807 (Sandbox Project)

PARAVIEW: http://pareview.sh/pareview/httpgitdrupalorgsandboxsaitanay2050807git

OTHER PROJECTS REVIEWED:

Also reviewed: (Automated Review / Incomplete)
https://drupal.org/node/2116523#comment-7985273

About the Module:

(same as on the sandbox module page)

Acquia Cloud Dashboard allows you to manage your Acquia Hosting from any Drupal Site.

You can use the Drupal Site hosted on Acquia, or a separate Drupal Site hosted elsewhere, to manage your Acquia Hosting.

How does it work?
Once the module is enabled, an "Acquia CLoud Report" page is made available which gives complete details about the Sites you have got, the various environments on your subscription, the databases, the servers etc. The report also allows you to manage various aspects of your Acquia Hosting (ex Domains) by providing appropriate links and forms.

test image
Report

What can be done through this module?
As of today, the module supports the below, besides providing a comprehensive report showing various aspects of your cloud hosting

  • Add / Delete Domain Names
  • Purge Varnish Caches
  • Add / Delete SSH Keys
  • View the Cloud Workflow Log

I can do all that from my Acquia Dashboard, why do I need this module?
In most of the cases, you would not require this module. This module will help you if you would like some of your employees or users to be able to do specific tasks. If you work with a Vendor or a Contractor and if you do not wish to add the contractor as a Technical Contact on your Acquia Hosting (because it gives him access to pretty much everything), you can setup a small portal with this module, giving him permissions to do specific tasks. (Ex: You would like the contractor to be able to add new domains and clear Varnish Caches but you would not like him to be able to delete domains accidentally or intentionally).

Access Control is going to be added to Acquia Hosting Dashboard pretty soon. And this module might be useless then. But till it happens, this module can help you accomplish certain level of access control on your Acquia Hosting.

What do I need to be able to use this module?
You would require your Acquia Cloud API username and password. You can get this from your Acquia Cloud Dashboard.

So this module works through Cloud API? Isn't there a cap on the number of API calls that can be made to Cloud API?
Yes. This module works using Cloud API. The module caches the report generated for 60 mins by default. This duration can be changed from the module settings. The module shows when the report was last updated. And any user with the permission to manually update the report can do so as and when required.

Is there a way that I can add new databases or manage my SVN users, or backup my databases through this module?
As of today, the module is limited to managing domains, varnish caches, manage SSH Keys and View the report. If you would like new things to be added, log it in the issue queue. I would be glad to take that up.

Comments

saitanay’s picture

Unfortunately I do not have any test Acquia subscription. The only subscription I have has a personal production site on it.

Drop a reply if any one would like to install the module and key in the Acquia Cloud Credentials. Will PM the credentials.

Once you have the creds, be Merciful in not deleting any existing domains from the Dashboard. As that would bring down my site.

To test the module, you may add a new domain and delete the one that you added. Same with SSH keys etc

Thank you

klausi’s picture

Status: Active » Needs review

Looks like this needs review? See https://drupal.org/node/532400

PA robot’s picture

We are currently quite busy with all the project applications and we prefer projects with a review bonus. Please help reviewing and put yourself on the high priority list, then we will take a look at your project right away :-)

Also, you should get your friends, colleagues or other community members involved to review this application. Let them go through the review checklist and post a comment that sets this issue to "needs work" (they found some problems with the project) or "reviewed & tested by the community" (they found no major flaws).

I'm a robot and this is an automated message from Project Applications Scraper.

saitanay’s picture

Issue summary: View changes

Added list of other project applications review

Crell’s picture

Issue summary: View changes

Updated Reviewed Proj List

saitanay’s picture

Issue summary: View changes

updated info

saitanay’s picture

Issue summary: View changes

updated image

saitanay’s picture

Issue summary: View changes

image

saitanay’s picture

Issue summary: View changes

image

saitanay’s picture

Issue summary: View changes

image

saitanay’s picture

Issue summary: View changes

image

saitanay’s picture

Issue summary: View changes

image

saitanay’s picture

Issue summary: View changes

image

saitanay’s picture

Issue summary: View changes

image

saitanay’s picture

Issue tags: +PAreview: review bonus

Requesting priority of this application under review bonus program

OTHER PROJECTS REVIEWED:
https://drupal.org/node/2115157#comment-7984255
https://drupal.org/node/2111409#comment-7984329
https://drupal.org/node/2111671#comment-7984419

Attaching PAReview: review bonus tag.

saitanay’s picture

Issue summary: View changes

updated review link

saitanay’s picture

Issue summary: View changes

updated parreview links

saitanay’s picture

ajosephau’s picture

Status: Needs review » Needs work

Hello saitanay,

Unfortunately I don't have an Acquia cloud login, but I have some notes here that might help in the mean time until you get a better review.

Issues Summary

  • PAReview, as of 3:14am GMT has the following minor error:
    There is still a master branch, make sure to set the correct default branch: http://drupal.org/node/1659588 . Then remove the master branch, see also step 6 and 7 in http://drupal.org/node/1127732
  • There is a security concern - it appears you store the Acquia Cloud username and password in plaintext.
  • (minor) adding doxygen comments where you list parameters, return types for all of your functions are really helpful to help us understand how your functions work (unless they are hook implementations) - the coding standards site has some good guidance on this - https://drupal.org/node/1354.
  • Add a hook_uninstall() function in a "acquia_cloud_dashboard.install" file that would remove variables you create in your module.

Basic application checks

  • Application has a git repo and link to the project page.
  • Project doesn't seem to be a duplication of existing projects, but admittedly I don't know enough about Acquia cloud to make such a determination. The Acquia Insight (https://drupal.org/project/acquia_insight) and Acquia Network Connector (https://drupal.org/project/acquia_connector) might be related, but the author has explained their intentions in the project page.
  • A cursory search didn't reveal multiple applications.

Repository checks

  • Git repo does contain code.
  • There is a 7.x-1.x revision, but the "master" branch still exists. See the "Issues" for more information.
  • There's over 900 lines of code and more than 5 functions so there's enough handwritten code for review.

Security review

  • PAReview and coder didn't return any security warnings, but does your module store the Acquia Cloud access credentials in plaintext in the database? That might be a security concern if the Drupal site's database gets compromised (I think Drupal salts and hashes the regular account passwords so if the database is compromised the adversary doesn't get the plaintext passwords).

Licensing checks

  • There's no license.txt file in the Git repo.
  • A visual inspection doesn't find any 3rd party/non-GPl code

Documentation checks

  • PAReview didn't return any errors, but running your module through the coder module raised a "comment_comment_docblock_missing" for most functions when viewing minor errors (so very low priority fix). The Drupal doxygen page https://drupal.org/node/1354 has some guidance on documenting functions, parameters, return variables etc.
  • README.txt file has a lot of detail - well done.
  • There's a good amount of inline comments, but my feedback would be to be consistent with your conventions: you change between inline and multiline comments for in-code comments. Some functions in your "acquia_cloud_dashboard.pages.inc" file like "acquia_cloud_dashboard_report()", "acquia_cloud_dashboard_update_ssh_keys()" and "acquia_cloud_dashboard_update_dbs()" do some complex operations, so some inline comments would help.

Coding standards

  • Coder/PAReview don't reveal any major issues.

API and best practices review

Hope this helps saitanay, and good luck.
ajosephau

saitanay’s picture

Hi ajosephau,

Firstly, great thanks for taking time out to come up with such detailed comments. I am sending via your contact form, cloud creds for a personal subscription, in case you wish to try the module further.

Here are the improvements suggested / made:

Suggested: Remove Master Branch
Implemented: Removed Master Branch. Pareview at http://pareview.sh/pareview/httpgitdrupalorgsandboxsaitanay2050807git shows no suggestions as of date.

Suggested: Security In terms of storing Acquia Cloud Creds.
Implemented: Added Autocomplete = off attribute to the form elements of Acquia Cloud Username and Password. This will prevent the autofill or autocomplete on browser and at the same time, it would not mask the field like a password. These fields take long data and masking them might make the entry difficult.
Regarding storing the creds in the database, the API does not accept hashed password to check. I believe the creds should be stored in plain text. Any attempt to store the creds in encrypted format should be accompanied by a decryption algorithm in the module code. The person carrying the compromised database can simply download this module for the decryption algorithm. Even if it requires a key to decrypt, the key should also be stored somewhere on the database.
I short, i believe storing the password in plaintext can not be avoided in this case. I could be wrong though.

Suggested: Remove the variables while uninstall.
Apologies. I should not have missed it earlier. Done

Additional Implementation:
Earlier if the password was incorrect, it used to show some empty report. It has been modified as follows:
* The long batch is not run if the creds are found to be incorrect.
* On the report, a message is show to user that the creds did not work on the last run. The message is shown till the config form is submitted again
Added Doc Comments for comments wherever they would be helpful

Checklist:
* No warnings / errors on pareview at http://pareview.sh/pareview/httpgitdrupalorgsandboxsaitanay2050807git
* No warnings / errors on coder module review, with "minor" option selected

Once again, thanks for your time on the application review.

Cheers
Tanay

saitanay’s picture

Status: Needs work » Needs review

Setting status to "Needs Review"

saitanay’s picture

Fixed #2117595: Report Generation goes into a loop under specific conditions

Checklist:
* No warnings / errors on pareview at http://pareview.sh/pareview/httpgitdrupalorgsandboxsaitanay2050807git
* No warnings / errors on coder module review, with "minor" option selected

saitanay’s picture

Issue summary: View changes

added another review

saitanay’s picture

saitanay’s picture

Issue summary: View changes

another module review added

saitanay’s picture

saitanay’s picture

That makes it 6!

Is there a "PAReview: review Double bonus" tag that I can attach to this application? ;-)

vijaycs85’s picture

Great work @saitanay. Happy to see a sandbox module with full documentation covered. Here is some manual code review comments:

  1.   $items['admin/config/cloud-api'] = array(
        'title' => 'Acquia Cloud Dashboard',
        'description' => 'Control Acquia Cloud Hosting right from Drupal Site',
        'position' => 'left',
        'page callback' => 'system_admin_menu_block_page',
        'access arguments' => array('access cloud api report'),
        'file' => 'system.admin.inc',
        'file path' => drupal_get_path('module', 'system'),
      );
    

    Not sure why we need this? I don't get any page on this location. if it is just to have a separate section in config page, I guess we don't need the callback and file details.

  2. Just a thought: when entering username/password at admin/config/cloud-api/configure it doesn't really do a validation on server side. Does it worth having?
  3. $url = "https://cloudapi.acquia.com/v1/" . $method . ".json"; this can be a variable, so that if version change or sandbox/live environment changes can be managed easily.
  4. Can't move CURD of domain/key (may be that needs username/password?)
saitanay’s picture

Hi Vijay,

Great Thanks for taking your time out on trying the module and for your suggestions.

Reg #1,
Yes Vijay you are correct, it is only for the section. And it would not need callback or filedetails. It was added recently and an existing menu item was cloned, changing the url. My bad that I did not take out the callback. Updated as suggested on 7.x-1.x branch.

Reg #2,
The password validation is being handled this way after #2117595: Report Generation goes into a loop under specific conditions
* If the password is incorrect, it is determined only when report generation is initiated (either automatically or manually)
* The report generation does not continue further and a message is shown to the user to correct the credentials.
* This message is persistent (not one-time) and is shown on report config page as long as the config form is submitted again.

The reason why the password is not being validated is that Cloud API password (as well as username) is not changeable by the user himself. So the frequency of change is probably once per install of Drupal. Not to burden the config form every time other settings are changed, this was a conscious decision.

Reg #3,
The API URL is also very rare to change. And also the module tries to abstract everything from the user not giving him a chance to enter wrong value for the API URL.

However I do agree that with your observation, that when this should be changed, it should not be hidden deep inside the code.

I am not exposing that in the config form, but have moved the url definition to the top of the code as
define("CLOUD_DASHBOARD_API_BASE_URL", "https://cloudapi.acquia.com/v1/");

This will make the maintenance / change of url easier.

Reg #4,
Yes Vijay, these urls would need to take the contextual values passed as parameters to them from the API report generation. These links are not accessible directly.

Thanks again for your time on the review Vijay. Greatly appreciated.

Best
Tanay

vijaycs85’s picture

Thanks for your quick reply on them @saitanay. Here is my updates on individual items in #15

#1 - awesome :)
#2 - It makes lots of sense now. Does it worth documenting it somewhere/add a note on the configuration page about 'check report page to see it work' or something.
#3 - Well, it still can be variable without UI (or just '#markup'). The reason is, consider if we get a dev & prod URIs and we have to make it as part of our build recipe for dev.
#4 - Ok thanks.

klausi’s picture

Status: Needs review » Needs work

Review of the 7.x-1.x branch:

  • Coder Sniffer has found some issues with your code (please check the Drupal coding standards).
    
    FILE: /home/klausi/pareview_temp/acquia_cloud_dashboard.pages.inc
    --------------------------------------------------------------------------------
    FOUND 1 ERROR(S) AFFECTING 1 LINE(S)
    --------------------------------------------------------------------------------
     6 | ERROR | File doc comments must be followed by a blank line.
    --------------------------------------------------------------------------------
    

This automated report was generated with PAReview.sh, your friendly project application review script. You can also use the online version to check your project. You have to get a review bonus to get a review from me.

  1. acquia_cloud_dashboard_curl_caller_post(): Why can't you use drupal_http_request() and must use cURL? Please add a comment. Also you might want do a hook_requirements() if you require the cURL PHP extension, for example like http://api.drupal.org/api/drupal/modules!simpletest!simpletest.install/f...
  2. "array("data" => "Site Name");": all user facing text must run through t() for translation, please check all your strings. This is not done in a couple of places like table headers.
  3. "/* Get Task List for Site": inline single line comments should use the "//" syntax, see https://drupal.org/node/1354#inline
  4. acquia_cloud_dashboard_update_generate_html(): this is vulnerable to XSS exploits. The third party data you retrieve from Acquia must be considered untrusted user provided input, so it needs to be sanitized before printing. Example: "$task_row[] = $value['description'];" should be "$task_row[] = check_plain($value['description']);". Make sure to read https://drupal.org/node/28984 again.

Otherwise looks pretty good! The security issue is a blocker right now.

klausi’s picture

Issue tags: +PAreview: security

Forgot to add the security tag. And please don't remove the security tag, we keep that for statistics and to show examples of security problems.

saitanay’s picture

Assigned: Unassigned » saitanay

Thanks for your time in reviewing the project Klausi.

Reg #4, will make appropriate changes and will get back for a re-review.

Cheers
Tanay

saitanay’s picture

Issue summary: View changes

saitanay’s picture

Issue summary: View changes
Status: Needs work » Needs review

//Coder Sniffer has found some issues - File doc comments must be followed by a blank line.
Added the missing blank line.

Reg #1, there were issues while using drupal_http_request with http authentication. Some discussions at
https://drupal.org/node/715990
Especially when the password contains a slash '/'.
This was the reason curl was considered. Will research further and will use drupal_http_request if it works
Curl has now been added as a requirement in hook_requirements

Reg #2 - all user facing text must run through t() for translation
Added the missing t()s for table headers

Reg #3 - inline single line comments should use the "//" syntax
Modified the comments as mentioned

Reg #4 - acquia_cloud_dashboard_update_generate_html(): this is vulnerable to XSS exploits
All markup/text from API displayed to user now goes through check_plain

Thank you for your earlier feedback.
Changing Status to 'Needs Review'

Best
Tanay

gobinathm’s picture

Status: Needs review » Reviewed & tested by the community

Excellent. Thanks for taking time to make this module. Setting to RTBC, as it's been through enough reviews.

kscheirer’s picture

Status: Reviewed & tested by the community » Fixed

Your 2 constants should be namespaced to the module, NOT_AUTHORIZED_TEXT_RESPONSE_FROM_API should be ACQUIA_CLOUD_DASHBOARD_NOT_AUTHORIZED_TEXT_RESPONSE_FROM_API for example.
In acquia_cloud_dashboard_curl_caller_post() you can use http_build_query() to handle creating a param string from an array.

Those are not major issues though, looks like a great module!

Thanks for your contribution, saitanay!

I updated your account to let you promote this to a full project and also create new projects as either a sandbox or a "full" project.

Here are some recommended readings to help with excellent maintainership:

You can find lots more contributors chatting on IRC in #drupal-contribute. So, come hang out and get involved!

Thanks, also, for your patience with the review process. Anyone is welcome to participate in the review process. Please consider reviewing other projects that are pending review. I encourage you to learn more about that process and join the group of reviewers.

Thanks to the dedicated reviewer(s) as well.

----
Top Shelf Modules - Crafted, Curated, Contributed.

saitanay’s picture

Hi kscheirer,

Thank you for the approval.

The constant has been renamed to follow the namespace convention.

Took a note of using http_build_query() in the curl caller and also as suggested by klausi earlier, will make modifications soon to replace the curl call itself with drupal_http_request.

Thanks to klausi, ajosephau, kscheirer, gobinathm, vijaycs85 for their help with the review.

Best
Tanay

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.