D2D ("Drupal-to-Drupal") is a module to built-up a network among Drupal instances using cryptography and XML-RPC.
An instance holds a public/private key pair allowing messages to be encrypted and/or to be signed. The concept of friendship among Drupal instances is introduced. Instances can send friend requests, accept friendship requests and also terminate friendship.
An instance is identified using a globally unique D2D-id. The aim of this id is to solve the naming problem for D2D instances, i.e. you can uniquely refer to a certain instance by this D2D-id, compare the public keys you have stored for an instance with the ones your friends store etc..
Using public key cryptography, an instance can implement secure XML-RPC methods that can be called by friend instances. Friends are organized in groups to allow privileged access to particular methods.
D2D comes already with a developer friendly api, a rich documentation, and full Patterns integration (only with latest development version)
I am currently the main contributor of Patterns v.7 and this module will be used to create a network of instances to share Patterns (but not only)
LINK: https://drupal.org/sandbox/shakty/1889370
GIT: shakty@git.drupal.org:sandbox/shakty/1889370.git
Comments
Comment #1
PA robot commentedThere are some errors reported by automated review tools, did you already check them? See http://ventral.org/pareview/httpgitdrupalorgsandboxshakty1889370git
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.
Comment #2
hazaHi shakty,
First, you should commit a 7.x-1.x branch and put all your code there. Having a "master" branch is discouraged.
Please see the Release naming conventions to understand why.
You should also remove the LICENCE.txt file. It will be added by the drupal's packaging script.
.modulefile
I am not sure to understand why you have some manu require_once there. You can use drupal_load_include() to load those files only when you need them.
Also, all those files that are include doesn't seems to follow the drupal coding standards. (function commented using inline comments, function that doesn't have any comment at all, ...).
In a more general way, it seems to really lacks comments on those files, it is really hard to understand what those files are doing. For example, in the d2d.manage_groups.inc file, you don't have a single line of comment.
d2d_example/d2d_example.info
using files[] in .info files are only used by drupal's class autoloader, so you can remove those 2 lines in your file.
Comment #3
shakty commentedHi Haza,
thank you for your review. I have taken care of adding comments where lacking, and sticking to the Drupal coding convention as much as possible.
Everything is now uploaded in the 7.x-1.x branch, that is the default one. Please have a look!
Thanks a lot.
Comment #4
hazaComment #5
rolando.caldas commentedHello shakty!
manual review:
The code needs a better documentation. An example:
d2d.friendship.inc
The documentation must explain the arguments that recieves the function and the return value. You have a lot of function in the same situation.
same file, line 19:
switch ($instance['friendship_state']) {It's a good idea check if the key friendship_state exists to prevent errors. It happens in a lot of functions.
It's necessary include all the files at the top of .module? The files have to be included only when are necessary.
About module_load_include vs require_once.
module_load_include is better use it when you want to load files of anothers modules (you can't know their location), but if you want include your own module files you can use require_once. module_load_include check the module route and if is the same module this is a extra-job.
With
module_load_include('inc', 'd2d', 'includes/d2d.constants');drupal have to "discover" the route to the module d2d that is your module. Then, include the file with a require.
require_once realpath(__DIR__) . '/includes/d2d.constants.inc';Do the same, but Drupal doesn't have to check the route.
d2d/_example/d2d_example.module
You can use hook_menu instead hook_menu_alter.
d2d/_example/includes/d2d_example.info.inc and d2d/_example/includes/d2d_example.remote_control.inc
don't have the functions documented.
README
Use README.txt instead README.md
Good luck!
Comment #6
rolando.caldas commentedHello.
I have to correct one of the points of my review. Sorry. In the review process of a module of mine told me that instead utilizase module_load_include required, so I adopted that point as a correction to make.
My module has passed the review process, but the person who enabled the publication of the project (cweagans) commented as follows on the subject:
I understand that, in this case, it is better to follow the recommendation of a person who can enable publishing projects.
Comment #7
shakty commentedHi rolando,
thanks for the update. Here is what I have changed
- README.md -> README.txt
- I have extensively documented each function.
- I have used the require_once instead of module_load_include (because they are just includes from the same module, and there is no theme functions, that sometimes create problems.). As you said, this is faster.
- I have kept all the requires files, because they are all needed at the beginning actually.
- I have added some check with the isset method, but not everywhere, because in same parts that is already checked by validation functions, are forced to be there by the callback parent.
Everything pushed up into the 7.x-1.x branch
Cheers
Comment #8
drozasHi all,
I would like just to share that we have been using d2d successfully with the following modules to exchange information between different drupal instances:
Comment #9
shakty commentedForgot to set it to needs review...
Comment #10
kscheirerIn d2d_install() you don't need to set defaults for your variables, you can do that when you read the value with
variable_get('somevar', 'defaultvalue');You also don't need the drupal_uninstall_schema() call, Dupal 7 will remove hook_schema for you automatically.
How does this module compare with the Services? I believe that module also support xml-rpc in a secure fashion. The Deploy module is built on top of that to push content around from one server to another.
Setting to needs work for the above question, I did not do a full code review.
----
Top Shelf Modules - Crafted, Curated, Contributed.
Comment #11
shakty commentedHi kscheirer,
I know that I can set the default values in variable_get, but I think it is just better to have all default values in a central place and not throughout all the code.
I will remove the uninstall schema from the hook_uninstall.
There are many differences between Services and D2D.
- D2D allows to establish friendships relationships between drupal instances
- Once a friendship is established you can create groups and assign permissions to groups to execute remote methods. The granularity is very fine here. The closest thing I have come across with services is https://drupal.org/node/800590 , and looks less flexible.
- D2D uses only signed and encrypted communication between friends (which exchange public keys)
- D2D has an easy to manage interface with an embedded system of notifications that guide the user
In case you have more questions, just write!
Cheers
Comment #12
kscheirerThanks for the additional information!
You have a large number of style issues reported here: http://pareview.sh/pareview/httpgitdrupalorgsandboxshakty1889370git. Some of those will be spurious, but reducing that number would be great. There are a couple notices not to use
form_state['input'], which is a security issue. And remove the master branch from the repo.Setting to "needs work" for security and lots of drupal code style issues. Otherwise, I think is this ready and is not a duplication.
----
Top Shelf Modules - Crafted, Curated, Contributed.
Comment #13
shakty commentedHi kscheirer,
- I have gone through the issues on http://pareview.sh/pareview/httpgitdrupalorgsandboxshakty1889370git
and fixed most of them.
- I have removed the unistall_schema from hook_uninstall
- I have deleted the master branch.
I think we could be ready to go!
Comment #14
kscheirerThanks for those updates!
----
Top Shelf Modules - Crafted, Curated, Contributed.
Comment #15
shakty commentedsorry the dumb question, but do I need to something else in order to promote the project?
I still don't see the Promote button in the Edit tab as explained here https://drupal.org/node/1068952
cheers
Comment #16
kscheirerNo further action is required, but the best thing you can do is get a Review Bonus by reviewing other applications. That will get you to the top of the list of projects to get reviewed (and hopefully approved). Only manual reviews count, just using http://pareview.sh is not enough.
You won't be able to promote your project until you receive "git vetted user" status, there's 1 level of review left.
Comment #17
shakty commentedthanks for the explanation!
Comment #17.0
shakty commentedupdated to latest description
Comment #18
kscheirerIt's been a month without any problems reported, so I'm promoting this myself as per https://drupal.org/node/1125818.
Thanks for your contribution, shakty!
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.