Skip to content

kezike/solid-slack

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

solid-slack

This package contains a Slack Integration for accessing and managing data stored in Solid, a Web-based personal data management platform.

view profile

Requirements

Hosting solid-slack

At the moment, there are no hosted options for solid-slack, so you will have to provide your own.

There are a number of free options for hosting a web app. As the developer, I have experimented with Heroku and Vercel/now.sh. While I have had tremendous success with the former, I encountered non-trivial challenges with the latter and have concluded that it is not compatible with the deployment model of solid-slack. That said, I encourage folks to use the platform that they are most comfortable with.

Once you have chosen your hosting platform of preference, deploy this code to that platform. Here are instructions for setting up automated deployments between GitHub and Heroku. Note: if you use the Heroku option, only follow from step 4 onward and take note of the application URL that is generated at the end (e.g., https://my-solid-slack.herokuapp.com). You will have to come back to this platform after the Configuring Slack below to set the SLACK_ACCESS_TOKEN and SLACK_SIGNING_SECRET environment variables.

Configuring Slack

OK, let's slack for a bit 😎 Here is some important Slack bookkeeping that you must do before you can use solid-slack:

  1. Create a Slack account here if you don't have one already.
  2. Create a Slack app here.
  3. In the app view, follow some of the instructions under the Add features and functionality section within the Building Apps for Slack block:
  • Create a slash command under Slash Commands: Fill out the form for generating a slash command and add it to your app. Be sure to use /solid as the Command and the URL that was generated in the Hosting solid-slack section above with the entry endpoint as the Request URL (e.g., https://my-solid-slack.herokuapp.com/entry). Optionally, you may also add a description (e.g., This app enables users to access data in their Solid pod) and usage hints (e.g., [login | logout | profile | account | help]).
  • Enable useful actions in your app under Interactivity & Shortcuts: Be sure to use the URL that was generated in the Hosting solid-slack section above with the action endpoint as the Request URL (e.g., https://my-solid-slack.herokuapp.com/action).
  • Enable appropriate application scopes under OAuth & Permissions: Be sure to select the following Bot Token Scopes:
    • commands
    • channels:read
    • chat:write
    • im:write
    • links:write
  • [Optional] Configure DM with Solid bot under App Home: Under the Show Tabs block, enable Messages Tab and select Allow users to send Slash commands and messages from the messages tab.
  1. In the app view, install your app under the Install your app section within the Building Apps for Slack block. This should generate the necessary OAuth tokens for your workspace and enable you to use solid-slack.
  2. Return to the platform configured in the Hosting solid-slack section above and set the following environment variables:
  • SLACK_ACCESS_TOKEN: use the value that was generated under Bot User OAuth Token in the OAuth Tokens for Your Workspace block of the OAuth & Permissions section
  • SLACK_SIGNING_SECRET: use the value that was generated under Signing Secret in the App Credentials block

Configuring Solid

But wait ... you gotta be solid before you can slack ... 😅 Here is some important Solid bookkeeping that you must do before you can use solid-slack:

  1. In order for you to use solid-slack, you must have an account with a Solid compliant identity provider. There are many free community options available out there, including this early and popular one and this one provided by Inrupt, a major gravitational force in the Solid ecosystem today.
  2. If you intend to access private data in your pod (e.g., inbox messages), you must add https://solid-node-client as a trusted app on the pod. This enables solid-slack to use solid-node-client, an npm module that enables read and write access to your pod. In order to make the appropriate permission updates to your pod, follow these instructions.

Commands

Login

Login to your Solid pod with /solid login login

View Profile

View your Solid profile page with /solid profile view profile

Explore Account Data

Navigate through the data in your Solid account with /solid account explore account

Edit Account Data

Edit the data in your Solid account while in account view explore account

Developer Notes

Disclaimers

  • While solid-slack does not expose Solid authentication key material with Slack, it does submit your plaintext data to the Slack API in order to display your data to you in the view presented with the /solid account command. This is only as acceptable as the extent to which you trust Slack. Keep this in mind as you navigate your data in solid-slack.
  • Remember that you are storing SLACK_ACCESS_TOKEN and SLACK_SIGNING_SECRET on a platform that is hosting your deployment of solid-slack (configured in the Hosting solid-slack section above). Make sure that you trust that platform. You have complete control over your choice of this platform, as it could be a VPS, a local server, or even a Raspberry Pi.

Limitations

  • The Slack API does not allow apps to push more than 3 views to the presentation stack. To make this clear to users, there is a visual aid advising users to continue data navigation in the browser where relevant. This limitation is represented in the code with the VIEW_STACK_LIMIT constant.
  • The Slack API does not allow apps to present views that are greater than 3000 characters in length. To make this clear to users, there is a visual aid advising users to view data in the browser where relevant. This limitation is represented in the code with the FILE_SIZE_LIMIT constant.
  • The Slack API does not allow apps to present views without content. To make this clear to users, there is a visual aid informing users that the file is empty while also fulfilling this size requirement for view presentation.

Next Steps

  • Enable content creation
  • Enable content deletion
  • Enable content sharing
  • Develop a stronger security model that avoids sharing plaintext data with Slack
  • Deploy solid-slack to production

Contribute

If any of this is interesting to you, please reach me here to get involved!

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published