forked from RocketChat/Rocket.Chat
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
PowerBox for Rocket.Chat Push fixed.
- Loading branch information
1 parent
713d77d
commit 523f983
Showing
10 changed files
with
132 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 | ||
[email protected] | ||
[email protected] | ||
[email protected] | ||
[email protected] | ||
[email protected] | ||
[email protected] | ||
#rocketchat:cors | ||
#[email protected] | ||
#[email protected] | ||
#[email protected] | ||
#[email protected] | ||
#[email protected] | ||
#[email protected] | ||
blaze-html-templates | ||
[email protected] | ||
[email protected] | ||
|
@@ -36,7 +36,7 @@ spacebars | |
[email protected] | ||
[email protected] | ||
|
||
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 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters