Server side configuration #362

merged 62 commits into from Mar 22, 2014


None yet

2 participants


Handle all configuration, including all per-user options, notebook lists, and notebook attributes, as specific, highly-granular RCS key/value pairs, rather than glomming them into the config.json relic.

Introduces an upgrade script scripts/upgradeRCS1_0.R which moves keys around in RCS (using whatever backend is configured).

Fixes #324 potential RCS conflict with a user named notebook (by moving notebook metadata to .notebook.
Fixes #351, removing config.json
Fixes #307, making sure different sessions don't clobber each others notebooks (by virtue of much finer granularity changes to the configuration).
Introduces a Most Recently Used list for a better notebook to open when removing the current one for #235
Makes life easier for #298 per-user options.
Helps #345 Secure RCS.

gordonwoodhull added some commits Feb 14, 2014
@gordonwoodhull gordonwoodhull first pass at extracting config functions into rcloud.js
mostly works... still testing.
@gordonwoodhull gordonwoodhull go back to jqTree updateNode because it's suitably fast enough
and it's error-prone to duplicate all the UI in that in create_tree_li
@gordonwoodhull gordonwoodhull Merge branch 'develop' into feature/server-side-config
@gordonwoodhull gordonwoodhull update bluebird to 1.0.5
will log unhandled scalar rejections
@gordonwoodhull gordonwoodhull make rcloud.config 'crazy globals'
the config is reused across sessions
most things work now
@gordonwoodhull gordonwoodhull artifacts c69636a
@gordonwoodhull gordonwoodhull update bluebird to 1.0.6
handles more unhandled rejections
@gordonwoodhull gordonwoodhull whitespace 6398138
@gordonwoodhull gordonwoodhull fake hovers for history and public/private buttons as well
fixes #111
@gordonwoodhull gordonwoodhull Merge branch 'develop' into feature/server-side-config
@gordonwoodhull gordonwoodhull some half-hearted stabs at #351 - currently broken! 6661551
@gordonwoodhull gordonwoodhull obsolete k bd99bf5
@gordonwoodhull gordonwoodhull export rcs.rm
I did this mostly for development, but I think if the other
rcs methods are exposed, this one should be too?
@gordonwoodhull gordonwoodhull migrating notebook lists for RCloud 1.0
rename rcs keys notebook/* to .notebook/*
next: deal with config.json
@gordonwoodhull gordonwoodhull print filename when file doesn't exist 31d6223
@gordonwoodhull gordonwoodhull config migration mostly works 576765d
@gordonwoodhull gordonwoodhull move upgrade script to scripts/ aff0cef
@gordonwoodhull gordonwoodhull make RCS 1.0 upgrade script into free-standing entity 2e3126e
@gordonwoodhull gordonwoodhull upgrade all notebooks list 604f739
@gordonwoodhull gordonwoodhull rcs-based rcloud.config methods and ocaps eef56af
@gordonwoodhull gordonwoodhull start porting editor_tab to rcs-based config
@gordonwoodhull gordonwoodhull remove errant config interface 1a613f8
@gordonwoodhull gordonwoodhull do not run RCloud when build fails fda1167
@gordonwoodhull gordonwoodhull fix notebook attribute fetching 7bc8b81
@gordonwoodhull gordonwoodhull whitespace c3c64f9
@gordonwoodhull gordonwoodhull mistakenly checked-in file afbfeec
@gordonwoodhull gordonwoodhull no user in config interface 7a7a7dc
@gordonwoodhull gordonwoodhull r error handling 1816f5c
@gordonwoodhull gordonwoodhull server-side config closer to working (but not quite) 91cb5ea
@gordonwoodhull gordonwoodhull rebuild js script 6476ee7
@gordonwoodhull gordonwoodhull do notebook key extraction server-side 13d7b60
@gordonwoodhull gordonwoodhull various fixes for server-side config
including each_r_list and r_vector
@gordonwoodhull gordonwoodhull a little bit of error checking on setting notebook info 5f5b470
@gordonwoodhull gordonwoodhull various fixes to bring editor_tab up to date with server-side config 7de4532
@gordonwoodhull gordonwoodhull Merge branch 'develop' into feature/server-side-config
@gordonwoodhull gordonwoodhull put ocap path into message
(error in merge)
@gordonwoodhull gordonwoodhull artifacts 7acd1d0

@cscheid, @s-u, in particular could you review the changes to RCS documented here both to consider concurrency issues and to make sure this follows the new schema and doesn't drive us too far away from #345 Secure RCS?

One potential issue I am aware of is that I propose here that .notebook is public, yet a non-owner should not be able to modify the "published" or "visible" bits of another user's notebooks.

@cscheid cscheid and 1 other commented on an outdated diff Mar 1, 2014
- if(links[b])
- return [{version: b, f: links[b]}];
- var path;
- for(var l in links)
- if((path = find_path(l, b))) {
- path.unshift({version: l, f: links[l]});
- return path;
- }
- return null;
- }
- var migration_path = find_path(old_version, CONFIG_VERSION);
- for(var i = 0; i < migration_path.length; ++i)
- migration_path[i].f(config_);
- config_.config_version = CONFIG_VERSION;
- return true;
+ // work around oddities of rcloud.js
cscheid Mar 1, 2014 Collaborator

You mean rserve-js here, right?

gordonwoodhull Mar 1, 2014 Member

Yep... I wonder if these helpers are enough (and should go in rserve.js) or if there is a better abstraction.

(I imagine an explicit step, with schemas describing how to convert the R sexps, at the rcloud.js level).

@cscheid cscheid and 1 other commented on an outdated diff Mar 1, 2014
@@ -334,13 +359,17 @@ var editor = function () {
function update_tree(root, user, gistname, path, last_chance, create) {
+ if(!root)
+ throw "need root";
+ if(!user)
+ throw "need user";
+ if(!gistname)
+ throw "need gistname";
cscheid Mar 1, 2014 Collaborator

if you throw these with "new Error('need ...')" then you'll capture stack traces with it.

gordonwoodhull Mar 1, 2014 Member

Oops, right, will do.


I've changed my mind about moving "private" notebook keys out of .notebook/<notebook-id>. We should only allow internal functions to write to .notebook, because otherwise user code could change star counts directly, which would be pretty destructive. Not as bad as making a notebook public, but pretty bad.

So IMO public and visibility can also stay under .notebook, as long as the only access to those are through functions that only allow changing notebooks one owns. I'm changing the code accordingly.


note, i've been fixing a lot of other bugs in this branch because editor_tab is waaaaay better over here. but the relevant changes for review are in the R files, and especially in scripts/upgradeRCS1_0.R

gordonwoodhull added some commits Mar 13, 2014
@gordonwoodhull gordonwoodhull last vestige of interest redundancy 0a847b4
@gordonwoodhull gordonwoodhull "sticky users" / "friends" / "colleagues"
sort folders of users whose notebooks we've starred at top of All Notebooks
(i'm also open to having a different root, but this seems simpler)

fixes #135
@gordonwoodhull gordonwoodhull modified the milestone: 1.0 Mar 18, 2014
@gordonwoodhull gordonwoodhull merged commit cc36588 into develop Mar 22, 2014
@gordonwoodhull gordonwoodhull deleted the feature/server-side-config branch Mar 27, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment