You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jan 15, 2025. It is now read-only.
Copy file name to clipboardexpand all lines: README.md
+53-17
Original file line number
Diff line number
Diff line change
@@ -1,39 +1,73 @@
1
1
# Iskaribot
2
2
3
-
Iskaribot is a Facebook Workplace -> Slack message cross-poster, which registers for webhooks and listes for posts to a particular Workplace group. When receiving such a webhook, it will resend the post to a configured Slack-channel (or channels) with a link back to the original post and an ingress.
3
+
Iskaribot is a Facebook Workplace -> Slack message cross-poster, which registers for webhooks and listens for posts to a particular Workplace group. When receiving such a webhook, it will resend the post to a configured Slack-channel (TODO: channels plural) with a link back to the original post and an ingress.
4
4
5
-
This bot solves the age-old conundrum of how to get developers to read corporate news.
5
+
This bot solves the age-old conundrum of how to get developers to read corporate news. 😎
6
+
7
+
There are three implementations of the same functionality;
8
+
9
+
- Node.js [/node]("node/README.md")
10
+
- .NET Core [/dotnet]("dotnet/README.md")
11
+
- Golang [/go]("go/README.md")
12
+
13
+
Each platform will have the same functionality:
14
+
15
+
- Respond to incoming HTTP requests. Endpoints:
16
+
- GET request from Workplace with 'random' token to be returned in response. Required by Workplace to validate the endpoint. Only done once, on registering the webook and endpoint.
17
+
- POST request from Workplace with a message posted in a Workplace group.
18
+
- Deserialize message from Workplace. Convert from JSON data to in-memory object.
19
+
- Fetch any attachments (images, documents) to the message. Workplace uses a Facebook CDN for attachments.
20
+
- Formats message for sending to Slack.
21
+
- Forwards message to Slack endpoint as a POST HTTP request.
22
+
23
+
Future/planned functionality:
24
+
25
+
- Support multiple source Workplace groups.
26
+
- Support multiple destination Slack channels/servers.
27
+
- Many-to-many relationships between Slack and Workplace groups.
28
+
- Support Microsoft Teams as a destination.
29
+
- Filter messages by hashtag. For instance only send messages if tagged with `#slack`.
30
+
- Frontend admin panel.
6
31
7
32
## Prerequisites
8
33
34
+
These are the prerequisites common for each platform version.
35
+
36
+
#### 1. Workplace by Facebook
37
+
9
38
You need an account in a corporate Facebook Workplace tenant, so if you are not the system administrator (likely not) you will need to cosy up to someone who is, and have them help you out with the proper permissions to read data from Workplace and to register the webhook.
10
-
You then need to repeat the similar procedure on the Slack-side, so you get a Slack webhook URL to post the content to.
39
+
40
+
#### 1.5 Facebook
41
+
42
+
The 'personal' Facebook has the same API's as Workplace, so most likely this bot will work just as well there. This has not been the main focus for development, and has not been tested at the time of this writing.
43
+
44
+
#### 2. Slack
45
+
46
+
You will need to repeat the process in you Slack tenant; cosy up to the admins, if that's not you, and configure an **Incoming Webhook** so you get a URL to post the content from Workplace to.
11
47
12
48
## Development
13
49
14
-
Iskaribot was built using Node 16.1.0 and NPM 7.24.0 so you should be safe if you have the same versions, others at your peril. Not really.
50
+
- You will need Git if you want to clone this repository, or you can download the ZIP file.
15
51
16
-
You will also need Git if you want to clone this repository.
52
+
-You will need a public TLS-enabled endpoint for your localhost process, for this we have used [ngrok](https://ngrok.com/).
17
53
18
-
Then you will need a public TLS-enabled endpoint for your localhost process, so why don't you give [ngrok](https://ngrok.com/) a try?
54
+
### 1. Running Iskaribot locally
19
55
20
-
### Run Iskaribot locally
56
+
Refer to the instructions for your chosen platform:
21
57
22
-
1. Clone this repository.
23
-
1. Install dependencies by running `npm install`
24
-
1. Install `nodemon` globally with `npm i -g nodemon`
25
-
1. Add configuration data to the included `rename.env` file and rename the file to `.env`. Optionally, and for production deployment, the configuration can be added as environment variables.
26
-
1. Run the bot with `npm start` which will run nodemon and listen for changes to the application...
58
+
- Node.js [/node]("node/README.md")
59
+
- .NET Core [/dotnet]("dotnet/README.md")
60
+
- Golang [/go]("go/README.md")
27
61
28
-
### Configure ngrok
62
+
### 2. Configuring ngrok
29
63
30
64
To get webhooks from Workplace to hit your local development environment, you need a public TLS-enabled endpoint to forward the webhook for you. Register at [ngrok](https://ngrok.com), follow the instructions there to get your local ngrok client configured.
31
65
32
66
Run ngrok pointing it to the same TCP port as your local Iskaribot. Default port is 7506. It can look something like this, once running:
33
67
34
68
<imgsrc="images/ngrok_client.png"width=500>
35
69
36
-
### Configure Facebook Workplace
70
+
### 3. Configuring Facebook Workplace
37
71
38
72
Using 'Integrations' in Workplace, you can configure a webhook to trigger Iskaribot whenever there is a new post in your WP group.
39
73
@@ -49,12 +83,14 @@ Using 'Integrations' in Workplace, you can configure a webhook to trigger Iskari
49
83
- Verify token set to the same value as in your local `.env` file.
50
84
- Tick 'posts' to enable the webhook to be 'triggered when a post is added, updated or deleted in a group'.
51
85
52
-
### Configure Slack
86
+
### Configuring Slack
87
+
53
88
In Slack, configure a webhook. Add the webhook url to an environment variable ´SLACK_URL´.
54
-
This URL will be used to post
89
+
This URL will be the endpoint used by Iskaribot to post messages to Slack.
90
+
55
91
## Deployment
56
92
57
-
TODO: Dockerfile to build container image for deployment.
93
+
TODO: Dockerfile to build container image for deployment, one for each platform.
0 commit comments