X
Appuyez ici pour vous rendre sur la version mobile du site.

Forum d’assistance

Private server (sync only, based on Weave Minimal) not working with Firefox Home.

Publié

Trying to sync with Weave Minimal Server http://tobyelliott.wordpress.com/2009/09/11/weave-minimal-server/] does not work: FFHome asks for /weave/user/1.0/username/node/weave (404, since the server does not implement registration functions) and stops there, instead of trying to get /weave/1.0/username/info/collections which should be the sync url.

Trying to sync with Weave Minimal Server http://tobyelliott.wordpress.com/2009/09/11/weave-minimal-server/] does not work: FFHome asks for /weave/user/1.0/username/node/weave (404, since the server does not implement registration functions) and stops there, instead of trying to get /weave/1.0/username/info/collections which should be the sync url.

Solution choisie

I got it running via HTTP. I also slightly modified the weave_minimal hack to not hard-code the server URL:

   if ($version == 'user' && $collection == 'node' && $id == 'weave') {
       if (isset($_SERVER['HTTPS'])) {
           exit("https://" . $_SERVER['SERVER_NAME'] . "/weave/");
       } else {
           exit("http://" . $_SERVER['SERVER_NAME'] . "/weave/");
       }
   }
Lire cette réponse dans son contexte 3

Détails additionnels sur le système

Application

  • Agent utilisateur :

Plus d’informations

the-edmeister
  • Top 25 Contributor
  • Moderator
5386 solutions 39975 réponses

Which version of the Firefox Sync extension are you using?
1.4.x or the new 1.5 version?
I suspect the recent Firefox Sync 1.5 update is going to require a mod to the local sync server software.

My suggestion is to post in this forum, where the Sync developers sometimes answer questions.
http://groups.google.com/group/mozilla-labs-weave/topics

Which version of the Firefox Sync extension are you using? <br /> 1.4.x or the new 1.5 version? <br /> I suspect the recent Firefox Sync 1.5 update is going to require a mod to the local sync server software. My suggestion is to post in this forum, where the Sync developers sometimes answer questions. <br /> http://groups.google.com/group/mozilla-labs-weave/topics
rvjr 0 solutions 3 réponses

I've been trying to use FFHome with Sync versions from 1.3 to 1.5, it always behaved this way for me, unfortunately. Is there anybody out there who got this to work with a custom server?

I've been trying to use FFHome with Sync versions from 1.3 to 1.5, it always behaved this way for me, unfortunately. Is there anybody out there who got this to work with a custom server?
antv 0 solutions 1 réponses

The issue happens in index.php, when minimal server checks the request:

       list($version, $username, $function, $collection, $id) = explode('/', $path.'//');
       if ($version != '0.5' && $version != '1.0')
               report_problem('Function not found', 404);

A somewhat ugly (but workable hack) is to edit index.php to return your custom server's url when FFHome requests a node:

        list($version, $username, $function, $collection, $id) = explode('/', $path.'//');
      if ($version == 'user' && $collection == 'node' && $id == 'weave')
               exit('http://www.your-server-address.com/weave/');
       if ($version != '0.5' && $version != '1.0')
               report_problem('Function not found', 404);
The issue happens in index.php, when minimal server checks the request: list($version, $username, $function, $collection, $id) = explode('/', $path.'//'); if ($version != '0.5' && $version != '1.0') report_problem('Function not found', 404); A somewhat ugly (but workable hack) is to edit index.php to return your custom server's url when FFHome requests a node: list($version, $username, $function, $collection, $id) = explode('/', $path.'//'); if ($version == 'user' && $collection == 'node' && $id == 'weave') exit('http://www.your-server-address.com/weave/'); if ($version != '0.5' && $version != '1.0') report_problem('Function not found', 404);

Auteur de la question

antv, yor hack does not seems to work for me, I still get a 404. I even tried to redirect (RedirectMatch in apache conf) to the correct collection url but does not work either, even if it answer with a 200 OK ("Account not found"). Does anyone know what is the behaviour FFHome expects from the server when connecting to /user/1.0/username/node/weave ?

antv, yor hack does not seems to work for me, I still get a 404. I even tried to redirect (RedirectMatch in apache conf) to the correct collection url but does not work either, even if it answer with a 200 OK ("Account not found"). Does anyone know what is the behaviour FFHome expects from the server when connecting to /user/1.0/username/node/weave ?

Modifié le par psychowood

alexschomb 0 solutions 2 réponses

The hack doesn't work for me either. Though I think I found the reason for the problem in my case. I'm using a self-signed SSL certificate on my server and this is currently not supported by FF Home. Someone opened up a Bugreport before but there has been no reaction yet... https://bugzilla.mozilla.org/show_bug.cgi?id=598015

Could someone have a look a that issue and please fix it? :-)

The hack doesn't work for me either. Though I think I found the reason for the problem in my case. I'm using a self-signed SSL certificate on my server and this is currently not supported by FF Home. Someone opened up a Bugreport before but there has been no reaction yet... https://bugzilla.mozilla.org/show_bug.cgi?id=598015 Could someone have a look a that issue and please fix it? :-)

Auteur de la question

Not my case, my weave server is via HTTP (VPNd, of course).

Not my case, my weave server is via HTTP (VPNd, of course).
j.ed. 1 solutions 1 réponses

Solution choisie

I got it running via HTTP. I also slightly modified the weave_minimal hack to not hard-code the server URL:

   if ($version == 'user' && $collection == 'node' && $id == 'weave') {
       if (isset($_SERVER['HTTPS'])) {
           exit("https://" . $_SERVER['SERVER_NAME'] . "/weave/");
       } else {
           exit("http://" . $_SERVER['SERVER_NAME'] . "/weave/");
       }
   }
I got it running via HTTP. I also slightly modified the weave_minimal hack to not hard-code the server URL: if ($version == 'user' && $collection == 'node' && $id == 'weave') { if (isset($_SERVER['HTTPS'])) { exit("https://" . $_SERVER['SERVER_NAME'] . "/weave/"); } else { exit("http://" . $_SERVER['SERVER_NAME'] . "/weave/"); } }

Auteur de la question

j.ed. solution works for me, together with latest update of FFHome.

j.ed. solution works for me, together with latest update of FFHome.
alexschomb 0 solutions 2 réponses

Is this hack for the index.php of the "weave minimal server"? Where did you put it? Couldn't find a similar line to replace. Do I need to replace 'user' with my username?

Is this hack for the index.php of the "weave minimal server"? Where did you put it? Couldn't find a similar line to replace. Do I need to replace 'user' with my username?
rvjr 0 solutions 3 réponses

Réponse utile

That's awesome, finally my FFHome is working! My index.php somehow looked a little different, I guess that's because my weave is not the 'minimal' and uses MySQL, but still I figured out which is the right line and adopted your solution, works great! Here's my modification in index.php:


62 $path = substr($path, 1); #chop the lead slash 
63 list($username, $function, $collection, $id) = explode('/', $path . '///');
64
65 ### >>> Hack to make iPhone Firefox Home work
66
67 if ($function == 'node') {
68     if (!isset($_SERVER['HTTPS'])) {
69         exit("http://" . $_SERVER['SERVER_NAME'] . "/");
70     } else {
71         exit("https://" . $_SERVER['SERVER_NAME'] . "/");
72     }
73 }
74
75 ### <<<
76 if ($function != "info" && $function != "storage")
77     report_problem(WEAVE_ERROR_FUNCTION_NOT_SUPPORTED, 400);

I also observed in the apache logfiles, that the desktop Firefox (which works) accesses the server via the URL format

"/1.0/username/storage/..."

whereas FFHome uses

"/user/1.0/username/storage/..."

To make these requests match the ones from the desktop browser plugin I added an alias in the virtual server section of Apache:

Alias /user/1.0 /var/www/weavesync/1.0/index.php

Where I also had one existing Alias for /1.0 to that destination.

I hope this helps some of you to figure out what the problem is on your server and to finally get your bookmarks and tabs to your phone!

Best Rainer

That's awesome, finally my FFHome is working! My index.php somehow looked a little different, I guess that's because my weave is not the 'minimal' and uses MySQL, but still I figured out which is the right line and adopted your solution, works great! Here's my modification in index.php: 62 $path = substr($path, 1); #chop the lead slash 63 list($username, $function, $collection, $id) = explode('/', $path . '///'); 64 65 ### >>> Hack to make iPhone Firefox Home work 66 67 if ($function == 'node') { 68 if (!isset($_SERVER['HTTPS'])) { 69 exit("http://" . $_SERVER['SERVER_NAME'] . "/"); 70 } else { 71 exit("https://" . $_SERVER['SERVER_NAME'] . "/"); 72 } 73 } 74 75 ### <<< 76 if ($function != "info" && $function != "storage") 77 report_problem(WEAVE_ERROR_FUNCTION_NOT_SUPPORTED, 400); I also observed in the apache logfiles, that the desktop Firefox (which works) accesses the server via the URL format "/1.0/username/storage/..." whereas FFHome uses "/user/1.0/username/storage/..." To make these requests match the ones from the desktop browser plugin I added an alias in the virtual server section of Apache: Alias /user/1.0 /var/www/weavesync/1.0/index.php Where I also had one existing Alias for /1.0 to that destination. I hope this helps some of you to figure out what the problem is on your server and to finally get your bookmarks and tabs to your phone! Best Rainer

Modifié le par rvjr

rvjr 0 solutions 3 réponses

Ouch... sorry, the index.php snipped got messed up a little. You can probably sort it, I added the line numbers from the file at the beginning of each line...

EDIT: Ok, it's sorted now...

Ouch... sorry, the index.php snipped got messed up a little. You can probably sort it, I added the line numbers from the file at the beginning of each line... EDIT: Ok, it's sorted now...

Modifié le par rvjr