How can multiple developers develope one slack app? - slack

I'm developing a slack app with a collegue and we couldn't understand how can both of us develop the server at once.
We're working in socket mode, using Slack-bolt for Python. Each of us has a local copy of the server, and when both local servers are up, just one server gets all the requests from the Slack client.
What is the common practise to allow both of us to develop the server at the same time?
Thanks

Related

Debug MS Teams application without ngrok?

I am working on MS Teams development. I installed the MS Teams toolkit in VS Code, set up my subscription with Azure and sideloading is active in my tenant.
When I run the app, it tries to install ngrok. This step fails as my organization does not allow running ngrok or other words tunnelling from our company laptop. We can run this on a VM to go around this but VM is not always available.
I am looking for a resolution for below scenarios:
Is there a way to debug MS Teams application without ngrok?
If we need a https URL, is it possible to configure a web app to facilitate that?
I tried removing install ngrok step from: /.vscode/tasks.json, but there are subsequent steps it the file dependent on that
I've done quite a bit of research on this question myself as I'd been getting a lot of pushback from our IT department regarding the security threats that come with using a tunneling service like ngrok. It eventually led me to this video posted on the MS forums from a Microsoft engineer who explains it clearly.
What it comes down to is that the Teams client (browser/desktop) approaches webservices (configured in the manifest file) differently depending on the type of interaction. If you're testing configurable tabs, task modules or configuration pages, then you can easily route the app to those sites running on your localhost through the manifest. The Teams client will approach them directly. Problems start to arise when you want to debug what happens when you use a bot or message extension, outgoing webhook or MS Graph change notifications (just quoting the video here, there might be other scenarios).
Basically, what happens is that the Teams client goes through a Microsoft-hosted service first, called Microsoft Teams Services, which will then approach your bot framework cloud service (typically an Azure Bot resource). This then forwards any incoming messages to whatever endpoint you have configured. What happens in these separate stages isn't completely clear to me, but what I do know is that whatever is typed by the user in the Teams client is translated to a JSON structure that can be interpreted by your server-side bot code (for C# apps, this is typically your CloudAdapter-derived class working with your TeamsBot-derived class). These messages are then routed to the relevant TeamsBot class method based on properties in the JSON.
Now the issue that ngrok solves is that, when the Teams client goes onto the public internet to reach the MS Teams Services server and then the Azure Bot resource, it then needs a public address to route the traffic to. It doesn't know about your local network anymore. As ngrok sets up a TCP tunnel between their server and your local PC, it is able to route traffic coming to their server to your PC. The Azure Bot now has a public address to send the messages to.
To my knowledge, there is no way to circumvent this as long as Teams client inner workings always make it go outside of your local network. For chat scenarios, the Bot Framework Emulator might offer a solution for unit testing. As far as I can see it performs the translation of chat input to the JSON message model of the Bot Framework and routes it to a local address for your chatbot to process it. Unfortunately, this doesn't work for chat message extension type messages.
As for the question whether ngrok can be avoided, I think the answer is definitely yes but you would need an alternative. There's several alternatives around that you might be able to host yourself if you have the technical know-how. Depending on your IT department, being in control of the public-internet-facing server might be a more viable solution for them. Another option is to host ngrok on a VM or cloud machine with less access to your internal network's resources than your PC/laptop has and test the code there.
TL;DR: If the the feature you're testing is approached directly by the Teams client, you can enter localhost in the manifest and debug it. If you're testing a feature that the teams client approaches through Microsoft Teams Services and the Bot Framework, you need to find a way to expose your code to the public internet. You can use ngrok or host your own alternative depending on requirements.
use mkcert to generate a certificate for ex. localhost.test
add losthost.test to your host file
use https://localhost.test for debugging

Is it possible to create a custom app for Microsoft Teams that dosn't use a central service provider?

I am working on adding support for our cloud storage solution to MS Teams but there is no central server you can send http messages to and get meaningful relies back from. I have no experience with creating Teams apps so I was hoping someone with Teams apps experience could tell me if this is even possible. At this point I only need my app to work on Windows and OS X.
This is how I would like my Teams App to work:
Each member of the team already has our cloud storage app running locally on their machine which provides access to the files.
Within MS Teams the user adds a file reference to a message via a message extension that would result in a link unfurl creating a card that contains an 'Open' button. The URL in the card would be one generated by our locally running cloud storage app. Other members of the team could then open this file by clicking the 'Open' button. The action of the open button would be to send the URL to our cloud storage app that would then open the local copy of the file on that team members machine.
Is it possible to do something like this within a Teams app? The communication between the Teams app and our cloud storage app would be done over our own protocol.
If it weren't for the fact that all bot communication must be done over https rather than http the local cloud storage app could act as the server.
All the communication in Teams with 3P apps needs to happen over https public endpoint. You could use ngrok to tunnel to local.

Using botframework emulator or bots hosted remotely without internet connectivity

I am trying to test my bot. It is hosted remotely but on a server that has no internet connectivity but is reachable within the LAN. I want to use the Botframework emulator to test. The emulator relies on ngrok. But I have two restrictions :
1) I cannot install ngrok on my corporate machine.
2) Even if I somehow managed to cut through the red tape and install ngrok , without internet connectivity on the server that hosts my bot, the responses would still not reach my emulator.
How can I use a service url that hits my emulator directly without using ngrok ?
First, ngrok is only necessary for connecting to bots hosted remotely. If you are looking to run everything locally on the closed server, then ngrok is not required.
With regards to options, you have a couple that may work for you.
One, you can look at utilizing offline-directline. This option allows you to generate a token locally without having to connect to the public direct line offering on Azure. Be aware that this npm package is configured for the v3 "BotChat" web chat tool. So, utilizing this will require your modifying the configuration to work with the newer v4 Web Chat (not to be confused with the v3/v4 SDKs).
Two, consider using this Browser Bot sample, located here, from the Botbuilder-Samples GitHub repo. In this instance, the bot and web chat adapters are fully contained within the browser and, as such, do not require a connection to direct line to run. The bot adapter uses the v4 Node SDK while the web chat adapter uses the v4 React-based implementation.
Hope of help!

Push Notification - Dedicated server required?

I'm thinking of developing an app that uses Microsoft Push Notification. However, I'm not quite sure what I need on my server. I've currently got a shared hosting account. Can I use this as my server to use Push Notification, or does the server have to be dedicated?
Thanks
The short answer is yes you can use shared or dedicated hosting to send out push notifications. Shared just means there are other web servers running on the same physical hardware which does not effect the api's available to your service.
You can get some more background on this if you want to check out Peter Torr's Mix 2010 talk on the video at around 28 minutes in.

Online server for desktop app - implement as web-server or custom socket application?

A bit of a generic question but let's say you have a desktop app that allows a user to connect to a central server and provides functionality like:
Login
Ability to auto-download profile data on login
Download and uploading save files through the app
A web-server (JSP/ASP.NET/PHP/etc) would do lots of work for you especially on the request-serving and threading front, but it seems a bit of a cheat for a desktop app to use HTTP requests like this.
All thoughts welcome. Maybe this should be community wiki?
If you want to leave things open for other possibilities in the future, go with a web server. That way, if you decide to write a web-based version of your desktop app (or an iPhone/Pre/Android application), you don't have to rewrite your socket server. Almost everything can speak HTTP these days.

Resources