From e6d8ec36d050eb182ae31b280ae7209fbe61bcbd Mon Sep 17 00:00:00 2001 From: Henry Ault Date: Thu, 21 May 2015 17:22:56 -0700 Subject: [PATCH] do->cloud rename --- base/ape/{do => cloud}/core.hook | 10 +++++----- base/mar/cloud-auth/door.hook | 16 ++++++++++++++++ base/mar/cloud-secret/door.hook | 9 +++++++++ base/pub/{do => cloud}/fab/hymn.hook | 8 ++++---- base/pub/{do => cloud}/src/main.css | 0 base/pub/{do => cloud}/src/main.js | 20 ++++++++++---------- 6 files changed, 44 insertions(+), 19 deletions(-) rename base/ape/{do => cloud}/core.hook (98%) create mode 100644 base/mar/cloud-auth/door.hook create mode 100644 base/mar/cloud-secret/door.hook rename base/pub/{do => cloud}/fab/hymn.hook (76%) rename base/pub/{do => cloud}/src/main.css (100%) rename base/pub/{do => cloud}/src/main.js (91%) diff --git a/base/ape/do/core.hook b/base/ape/cloud/core.hook similarity index 98% rename from base/ape/do/core.hook rename to base/ape/cloud/core.hook index dc9bcd2908..4912b31884 100644 --- a/base/ape/do/core.hook +++ b/base/ape/cloud/core.hook @@ -150,7 +150,7 @@ $% [%diff %json json] 'code'^code :- 'client_id' 'd8f46b95af38c1ab3d78ad34c2157a6959c23eb0eb5d8e393f650f08e6a75c6f' - 'redirect_uri'^'http://localhost:8443/home/pub/do/fab' + 'redirect_uri'^'http://localhost:8443/home/pub/cloud/fab' == ++ httpreq |= $: ost=bone pour-path=wire @@ -180,7 +180,7 @@ $% [%diff %json json] :_ +>.$ [ost %diff %json (state-to-json drops.vat)]~ :: -++ poke-do-auth +++ poke-cloud-auth |= [[ost=bone you=ship] [cde=cord typ=cord]] ^- [(list move) _+>.$] ~& [cde typ] @@ -194,9 +194,8 @@ $% [%diff %json json] :_ +>.$ ~ :: -++ poke-do-secret +++ poke-cloud-secret |= [[ost=bone you=ship] secret=cord typ=cord] - ~& +<+ ^- [(list move) _+>.$] ::=+ [newvat code path]=[vat(auth auth.vat) ...] ::=. vat newvat @@ -253,7 +252,8 @@ $% [%diff %json json] %. act => jo %- ot - :~ name/so region/so size/so image/(su dem) ssh/(ar so) backups/(mu bo) + :~ name/so region/so size/so image/(su dem) :: id key:img object + ssh/(ar so) backups/(mu bo) 'ipv6'^(mu bo) 'priv_networking'^(mu bo) 'user_data'^(mu so) == :- (create-droplet ost deets) diff --git a/base/mar/cloud-auth/door.hook b/base/mar/cloud-auth/door.hook new file mode 100644 index 0000000000..695a9b6b15 --- /dev/null +++ b/base/mar/cloud-auth/door.hook @@ -0,0 +1,16 @@ +:: this mark is used to receive incoming oauth2 tokens that we use to poke our %gall server +:: +:::: /hook/door/do-auth/mar + :: +/? 310 +!: +|_ cod=cord +:: +++ grab :: converter arm + |% + ++ noun ,@t :: clam from noun + ++ json (cork (ot authcode/so platform/so ~):jo need) :: (need (so:jo jon)) + -- +-- + + diff --git a/base/mar/cloud-secret/door.hook b/base/mar/cloud-secret/door.hook new file mode 100644 index 0000000000..3cdf63110d --- /dev/null +++ b/base/mar/cloud-secret/door.hook @@ -0,0 +1,9 @@ +!: +|_ cod=cord +:: +++ grab :: converter am + |% + ++ noun ,@t :: clam from noun + ++ json (cork (ot secret/so platform/so ~):jo need) :: (need (so:jo jon)) + -- +-- diff --git a/base/pub/do/fab/hymn.hook b/base/pub/cloud/fab/hymn.hook similarity index 76% rename from base/pub/do/fab/hymn.hook rename to base/pub/cloud/fab/hymn.hook index 6a1edce0ca..78bffedd95 100644 --- a/base/pub/do/fab/hymn.hook +++ b/base/pub/cloud/fab/hymn.hook @@ -14,11 +14,11 @@ ;html ;head ;script@"/~/at/home/lib/urb.js"; - ;script: urb.appl = 'do' + ;script: urb.appl = 'cloud' ;script@"https://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.js"; ;script@"https://cdnjs.cloudflare.com/ajax/libs/react/0.12.2/react.js"; - ::;link/"/main/pub/do/src/main.css"(rel "stylesheet"); - ;title: DO Instance Tracker + ::;link/"/main/pub/cloud/src/main.css"(rel "stylesheet"); + ;title: DO & GCE Manager == ;body ;* =+ d=?~(do ~ (trip u.do)) @@ -26,6 +26,6 @@ :_ ~ ;script: authcode='{?~(d g d)}'; console.log(authcode) ;div#container; - ;script@"/home/pub/do/src/main.js"; + ;script@"/home/pub/cloud/src/main.js"; == == diff --git a/base/pub/do/src/main.css b/base/pub/cloud/src/main.css similarity index 100% rename from base/pub/do/src/main.css rename to base/pub/cloud/src/main.css diff --git a/base/pub/do/src/main.js b/base/pub/cloud/src/main.js similarity index 91% rename from base/pub/do/src/main.js rename to base/pub/cloud/src/main.js index d745aabd40..410126bf36 100644 --- a/base/pub/do/src/main.js +++ b/base/pub/cloud/src/main.js @@ -12,14 +12,14 @@ input = React.DOM.input Droplet = React.createClass({ dropletAction:function(id, action){ urb.send({ - appl:"do", + appl:"cloud", data: {action: action, id: id}}) }, rebootDroplet: function() { urb.send({ - appl: "do", + appl: "cloud", data: {action: 'reboot', id: this.props.id}}) }, @@ -52,10 +52,10 @@ Page = recl({ console.log(platform); if(window.authcode.length !== ''){ urb.send({ - appl: "do", + appl: "cloud", data: {authcode:window.authcode, platform:platform}, - mark: "do-auth"}) + mark: "cloud-auth"}) } else { console.log("nocode") } } }, @@ -65,22 +65,22 @@ Page = recl({ console.log(platform,codeid) secret= $(codeid).val() if(secret !== '') { - urb.send({appl: "do", + urb.send({appl: "cloud", data: {secret:secret, platform:platform}, - mark: "do-secret"}) + mark: "cloud-secret"}) } } }, getList: function(){ - urb.send({appl: "do", + urb.send({appl: "cloud", data: {action:"list"}, mark: "json"}) }, createDroplet: function(){ - urb.send({appl: "do", + urb.send({appl: "cloud", data: { action:'create', name:$('#name').val(), @@ -97,8 +97,8 @@ Page = recl({ }, render: function(){ - href = "https://cloud.digitalocean.com/v1/oauth/authorize?client_id=d8f46b95af38c1ab3d78ad34c2157a6959c23eb0eb5d8e393f650f08e6a75c6f&redirect_uri=http%3A%2F%2Flocalhost%3A8443%2Fhome%2Fpub%2Fdo%2Ffab&response_type=code&scope=read+write" - ghref = "https://accounts.google.com/o/oauth2/auth?response_type=token&scope=https://www.googleapis.com/auth/compute&state=someinfo&redirect_uri=http://localhost:8443/home/pub/do/fab&client_id=720541965785-jr3c6ijo8abonu9qj77qre1itsdra52r.apps.googleusercontent.com" + href = "https://cloud.digitalocean.com/v1/oauth/authorize?client_id=d8f46b95af38c1ab3d78ad34c2157a6959c23eb0eb5d8e393f650f08e6a75c6f&redirect_uri=http%3A%2F%2Flocalhost%3A8443%2Fhome%2Fpub%2Fcloud%2Ffab&response_type=code&scope=read+write" + ghref = "https://accounts.google.com/o/oauth2/auth?response_type=token&scope=https://www.googleapis.com/auth/compute&state=someinfo&redirect_uri=http://localhost:8443/home/pub/cloud/fab&client_id=720541965785-jr3c6ijo8abonu9qj77qre1itsdra52r.apps.googleusercontent.com" return (div({}, [ div({}, a({href:href},[