1 Status of the Framadate packaging for Sandstorm.io - 2015-08-04
2 ================================================================
4 1.- I applied the gist Asheesh Laroia offered (see commit http://repo.or.cz/w/framadate-sandstorm.git/commit/723d6679081200ac653500cad110f347b7fc59c2 ), and in the borrowed machine (local.sandstorm.io:6080) it seems it solved the localization issue, but not with the development environment in my recovered laptop (also local.sandstorm.io:6080), and not in my production sandstorm.io server (lacaja.larjona.net) when I install the framadate.spk. I'm not sure if this is related to the locale I have in the corresponding machine, I may have changed the locale in the borrowed machine when testing things.
5 So, about this issue: I think the problem in the sandstorm.io side is solved and if I have time in September I can figure out how to make it work.
7 2.- After applying that change, I can access the polls/schedules after they are created, just adding the corresponding sufixes to the URL of my machine (for example, my grain is http://local.sandstorm.io:6080/grain/YTf4zS2ZvP4NaRmqATcnvm , then I add /admin/ at the end, and I can see the administration page with the list of polls/schedules).
8 Or I create a poll, and then I can access it adding "studs.php?sondage=3jixswh4rfztfjyw" to the end of the URL of my grain.
11 So, let's go to the admin dashboard:
13 http://local.sandstorm.io:6080/grain/YTf4zS2ZvP4NaRmqATcnvm/admin/
15 It works, it shows all the polls.
17 However, when in that page I click on "See the poll", I get gibberish:
18 \x1f�
\b\x03s��IU��/QH�/�K��
\x02+��!
\x10
20 I know it is because there was a nginx error but gzip is enabled so I see the gibberish instead of the error. But:
21 * The debug log (inside Sandstorm.io, the button of the tool) does not show anything relevant.
22 * I've done vagrant-spk ssh
23 then sudo nano /etc/nginx/nginx.conf and yes, gzip is on, but if I change to off, and then restart nginx with sudo service nginx restart, I still see the gibberish when I click in "see the poll". GRR.
24 * Then, inside vagrant-spk ssh, I tried to see the log of the nginx of the grain:
26 cat /opt/sandstorm/var/sandstorm/grains/YTf4zS2ZvP4NaRmqATcnvm/sandbox/log/nginx
28 And I saw some PHP notices, and the error:
32 PHP message: PHP Notice: Undefined index: X_SANDSTORM_BASE_PATH in /opt/app/app/classes/Framadate/Utils.php on line 31
33 PHP message: PHP Notice: Undefined index: X_SANDSTORM_BASE_PATH in /opt/app/app/classes/Framadate/Utils.php on line 31
34 PHP message: PHP Notice: Undefined index: X_SANDSTORM_BASE_PATH in /opt/app/app/classes/Framadate/Utils.php on line 31" while reading response header from upstream, client: 127.0.0.1,
35 2015/08/04 03:40:31 [error] 80#0: *66 FastCGI sent in stderr: "Primary script unknown" while reading response header from upstream, client: 127.0.0.1, server: localhost, request: "GET /admin/studs.php?sondage=aqg259dth55iuhwm HTTP/1.1", upstream: "fastcgi://unix:/var/run/php5-fpm.sock:", host: "prqbirwvaf5vuhj68utu.local.sandstorm.io:6080"
38 * Strangely, with no changes, some time later I don't get the gibberish any more: I get a "File not found" message when I click "see the poll".
39 Maybe after restarting nginx I have to wait a bit so the new nginx config is propagated to the grains somehow? I don't know. Whatever.
41 * Now I understand what happens: when I click on the link, it tries to gather the URL /admin/studs.php?sondage=aqg259dth55iuhwm instead of /studs.php?sondage=3jixswh4rfztfjyw
42 So I suppose that Framadate does not like something: the change in utils.php (return X_SANDSTORM_BASE_PATH) or the javascript code for synchronizing URLs.
44 * I suppose having a look at the admin/index.php code I could figure out what's happening and maybe fix it, but I have no time until September.
46 3.- Another strange/interesting thing: I've gone to http://local.sandstorm.io:6080/grain/YTf4zS2ZvP4NaRmqATcnvm/admin/ and then I see the table with the existing polls/schedules. If I go to "See the poll" and make right click and copy the destination URL, it's this one:
48 http://71nkasxk0udrfvtdbbhl.local.sandstorm.io:6080/admin/studs.php?sondage=3jixswh4rfztfjyw
50 (instead of http://local.sandstorm.io:6080/grain/YTf4zS2ZvP4NaRmqATcnvm/admin/studs.php?sondage=3jixswh4rfztfjyw or, when I fix the point "2" above, http://local.sandstorm.io:6080/grain/YTf4zS2ZvP4NaRmqATcnvm/studs.php?sondage=3jixswh4rfztfjyw ).
52 I tried to open the link http://71nkasxk0udrfvtdbbhl.local.sandstorm.io:6080/admin/studs.php?sondage=3jixswh4rfztfjyw and nginx says to me "File not found" (normal). But hey, if I try to open http://71nkasxk0udrfvtdbbhl.local.sandstorm.io:6080/studs.php?sondage=3jixswh4rfztfjyw , I can see the poll, and the whole browser page is for framadate: I don't see the sandstorm frames and menus. Strange... and strange that the random string of the grain is 71nkasxk0udrfvtdbbhl instead of YTf4zS2ZvP4NaRmqATcnvm. Then, I tried
53 http://ytf4zs2zvp4narmqatcnvm.local.sandstorm.io:6080/studs.php?sondage=3jixswh4rfztfjyw
54 and I got the message: "No such grain for public ID: ytf4zs2zvp4narmqatcnvm [404]".
58 http://local.sandstorm.io:6080/grain/71nkasxk0udrfvtdbbhl/studs.php?sondage=3jixswh4rfztfjyw and I get the sandstorm menu, and inside that, "Unauthorized [403]".
60 ok, that I suppose it's not a problem, but just something I don't understand, so I leave this point "3" here only as reference for the case it helps to solve the other issues.
62 4.- Ok, let's go to my poll: http://local.sandstorm.io:6080/grain/YTf4zS2ZvP4NaRmqATcnvm/studs.php?sondage=3jixswh4rfztfjyw and try to share it.
64 I click on "Share" and I obtain http://local.sandstorm.io:6080/shared/gDlofjjQvi7Rp1cZlAxG4awUcAn1VwFB5GpXamENn7T
65 I open that in a different browser, and GRR! I get the Framadate initial page (to create a new poll/schedule). If I add "/admin/" at the end of the url, I can see the list of polls available. Mmm that's not what we want.
67 5.- So, I don't know if what we want is to change the "name of the document" from "Schedule or Poll" to "Framadate instance", so each time you create a new sandstorm.io "document", you create a framadate instance, with its database with several different polls and schedules... That's more or less how the app is working now,
71 we want to implement user authentication inside the Sandstorm.io framadate, and make the corresponding hacks so when we share a "document" we only share the current poll/schedule and not the whole framadate (with other polls); and the access to the admin interface is limited to the user that creates the poll/schedule.
73 I suppose this is what we want, so I should follow the advices that Drew gave in the mailing list: add a bridgeConfig section to
74 `.sandstorm/sandstorm-pkgdef.capnp` declaring permissions and roles.
76 But I couldn't find time to read about that.
78 So, if anybody wants to go on during August, perfectly welcome.
79 In September, I'll try to resume the work.
81 Happy summer and happy hacking!