diff --git a/.meteor/packages b/.meteor/packages index 123626655b97c..071b63aaadec4 100644 --- a/.meteor/packages +++ b/.meteor/packages @@ -3,13 +3,13 @@ # 'meteor add' and 'meteor remove' will edit this file for you, # but you can also edit it by hand. -rocketchat:cors -accounts-facebook@1.2.1 -accounts-github@1.3.0 -accounts-google@1.2.0 -accounts-meteor-developer@1.3.0 -accounts-password@1.4.0 -accounts-twitter@1.3.0 +#rocketchat:cors +#accounts-facebook@1.2.1 +#accounts-github@1.3.0 +#accounts-google@1.2.0 +#accounts-meteor-developer@1.3.0 +#accounts-password@1.4.0 +#accounts-twitter@1.3.0 blaze-html-templates check@1.2.5 ddp-rate-limiter@1.0.7 @@ -36,7 +36,7 @@ spacebars standard-minifier-js@2.1.2 tracker@1.1.3 -rocketchat:2fa +#rocketchat:2fa rocketchat:action-links rocketchat:analytics rocketchat:api @@ -94,7 +94,7 @@ rocketchat:oembed rocketchat:otr rocketchat:push-notifications rocketchat:reactions -#rocketchat:sandstorm +rocketchat:sandstorm #rocketchat:slackbridge rocketchat:slashcommands-archive rocketchat:slashcommands-asciiarts @@ -113,7 +113,7 @@ rocketchat:slashcommands-topic rocketchat:slashcommands-unarchive rocketchat:slider rocketchat:smarsh-connector -rocketchat:spotify +#rocketchat:spotify rocketchat:statistics rocketchat:streamer rocketchat:theme @@ -134,9 +134,9 @@ rocketchat:webrtc rocketchat:wordpress rocketchat:message-snippet #rocketchat:google-natural-language -rocketchat:drupal +#rocketchat:drupal rocketchat:monitoring -#rocketchat:chatops +rocketchat:chatops konecty:change-case konecty:delayed-task diff --git a/.meteor/versions b/.meteor/versions index ddbbb107d92d5..70fbcb160c5a7 100644 --- a/.meteor/versions +++ b/.meteor/versions @@ -1,11 +1,6 @@ accounts-base@1.3.4 -accounts-facebook@1.2.1 -accounts-github@1.3.0 -accounts-google@1.2.0 -accounts-meteor-developer@1.3.0 accounts-oauth@1.1.15 accounts-password@1.4.0 -accounts-twitter@1.3.0 aldeed:simple-schema@1.5.3 allow-deny@1.0.9 autoupdate@1.3.12 @@ -25,6 +20,7 @@ check@1.2.5 coffeescript@1.12.7_1 coffeescript-compiler@1.12.7_1 dandv:caret-position@2.1.1 +dburles:google-maps@1.1.5 ddp@1.3.1 ddp-client@2.1.3 ddp-common@1.2.9 @@ -47,7 +43,6 @@ facebook-oauth@1.3.2 fastclick@1.0.13 francocatena:status@1.5.3 geojson-utils@1.0.10 -github-oauth@1.2.0 google-oauth@1.2.4 hot-code-push@1.0.4 html-tools@1.0.11 @@ -80,7 +75,6 @@ matb33:collection-hooks@0.8.4 mdg:validation-error@0.5.1 meteor@1.7.2 meteor-base@1.1.0 -meteor-developer-oauth@1.2.0 meteorhacks:inject-initial@1.0.4 meteorhacks:meteorx@1.4.1 meteorspark:util@0.2.0 @@ -136,13 +130,12 @@ rocketchat:bot-helpers@0.0.1 rocketchat:cas@1.0.0 rocketchat:channel-settings@0.0.1 rocketchat:channel-settings-mail-messages@0.0.1 +rocketchat:chatops@0.0.1 rocketchat:colors@0.0.1 -rocketchat:cors@0.0.1 rocketchat:crowd@1.0.0 rocketchat:custom-oauth@1.0.0 rocketchat:custom-sounds@1.0.0 rocketchat:dolphin@0.0.2 -rocketchat:drupal@0.0.1 rocketchat:emoji@1.0.0 rocketchat:emoji-custom@1.0.0 rocketchat:emoji-emojione@0.0.1 @@ -189,6 +182,7 @@ rocketchat:otr@0.0.1 rocketchat:postcss@1.0.0 rocketchat:push-notifications@0.0.1 rocketchat:reactions@0.0.1 +rocketchat:sandstorm@0.0.1 rocketchat:slashcommands-archive@0.0.1 rocketchat:slashcommands-asciiarts@0.0.1 rocketchat:slashcommands-create@0.0.1 @@ -207,7 +201,6 @@ rocketchat:slashcommands-unarchive@0.0.1 rocketchat:slider@0.0.1 rocketchat:smarsh-connector@0.0.1 rocketchat:sms@0.0.1 -rocketchat:spotify@0.0.1 rocketchat:statistics@0.0.1 rocketchat:streamer@0.5.0 rocketchat:theme@0.0.1 diff --git a/.sandstorm/sandstorm-pkgdef.capnp b/.sandstorm/sandstorm-pkgdef.capnp index 02b27b0390752..0d71c710f6a2f 100644 --- a/.sandstorm/sandstorm-pkgdef.capnp +++ b/.sandstorm/sandstorm-pkgdef.capnp @@ -95,6 +95,19 @@ const pkgdef :Spk.PackageDefinition = ( (name = "privateMessage", verbPhrase = (defaultText = "sent private message"), requiredPermission = (explicitList = void)), ] ), + powerboxApis = [ + ( + name = "rocket.chat push gateway", + displayInfo = ( + title = (defaultText = "Rocket.Chat Push Gateway"), + ), + path = "/", + tag = ( + canonicalUrl = "https://gateway.rocket.chat" + ), + permissions = [true, true], # read and write + ) + ], saveIdentityCaps = true, ), ); diff --git a/package.json b/package.json index 73cbe39a59f93..810b2b0b75d6c 100644 --- a/package.json +++ b/package.json @@ -126,6 +126,7 @@ "prom-client": "^10.1.1", "semver": "^5.4.1", "toastr": "^2.1.2", + "request":"", "wolfy87-eventemitter": "^5.2.2" } } diff --git a/packages/rocketchat-api/package.js b/packages/rocketchat-api/package.js index 16d34b948044b..1e85d2ef1ebcd 100644 --- a/packages/rocketchat-api/package.js +++ b/packages/rocketchat-api/package.js @@ -41,6 +41,9 @@ Package.onUse(function(api) { api.addFiles('server/v1/settings.js', 'server'); api.addFiles('server/v1/stats.js', 'server'); api.addFiles('server/v1/users.js', 'server'); + + api.addFiles('server/v1/powerbox.js', 'server'); + }); Npm.depends({ diff --git a/packages/rocketchat-api/server/v1/powerbox.js b/packages/rocketchat-api/server/v1/powerbox.js new file mode 100644 index 0000000000000..952caf6b9d305 --- /dev/null +++ b/packages/rocketchat-api/server/v1/powerbox.js @@ -0,0 +1,39 @@ +const request = require('request'); +const fs = require('fs'); + +RocketChat.API.v1.addRoute('claimToken', { authRequired: false }, { + post() { + const par = this.requestParams(); + const headers = this.request.headers; + const claimToken = par.token; + const sessionId = headers['x-sandstorm-session-id']; + // console.log(headers); + // console.log("claimToken:"+claimToken); + // console.log("sessionId:"+sessionId); + request({ + proxy: process.env.HTTP_PROXY, + method: "POST", + url: "http://http-bridge/session/" + sessionId + "/claim", + json: { + requestToken: claimToken, + requiredPermissions: ["read","write"] + } + }, (err, httpResponse, body) => { + if (err) { + console.error(err); + } else { + // console.log(httpResponse); + // console.log("body:"+body.cap); + if (body.cap !== undefined) { + fs.writeFile("/var/token.txt",body.cap,function(err){ + if(err){console.log(err); } + // const powerBoxToken = fs.readFileSync("/var/token.txt",'utf8'); + // console.log("token:"+powerBoxToken); + }); + } + } + });//request + return RocketChat.API.v1.success(); + // return RocketChat.API.v1.failure(); + }//post +}); diff --git a/packages/rocketchat-ui-sidenav/client/accountBox.js b/packages/rocketchat-ui-sidenav/client/accountBox.js index 6b3cb2de581c4..90c672b11949c 100644 --- a/packages/rocketchat-ui-sidenav/client/accountBox.js +++ b/packages/rocketchat-ui-sidenav/client/accountBox.js @@ -106,10 +106,10 @@ Template.accountBox.events({ id: 'account' }, { - icon: 'sign-out', - name: t('Logout'), + icon: 'circle', + name: t('Powerbox'), type: 'open', - id: 'logout' + id: 'powerbox' } ]) } diff --git a/packages/rocketchat-ui-sidenav/client/userStatus.html b/packages/rocketchat-ui-sidenav/client/userStatus.html index b92728ef1379a..d2da9a8c5312d 100644 --- a/packages/rocketchat-ui-sidenav/client/userStatus.html +++ b/packages/rocketchat-ui-sidenav/client/userStatus.html @@ -21,8 +21,10 @@