I myself am a supporter of the idea that if you like a product, then you need to buy it and with your money support programmers.
But sometimes it happens that the company cannot spend money on this software or does not want to. It is especially difficult to pay from $ 100 per month when there are free analogues or if the chats are used for non-commercial purposes.
I will describe how you can deploy a service to store the history of all your team’s public posts on slack and get rid of the main, unpleasant, sometimes disruptive restrictions - up to 10k of your team’s most recent messages (you can only search and search among 10,000 recent messages)
Among the ready-made solutions are:
In more detail I will tell about the last decision, I liked it the most.
')
As you can easily see, the main idea belongs to Lê Việt Hồng (
github.com/suoinguon ) I took his decision as a basis and began to add various features there.
Since this is a regular Django application, then adding new features there was very easy to add.
Compared with the original now appeared:
- Full text search django-watson history
- Indexing only public groups and a reduced token level with only the necessary rights
- Formatting messages as in slack, including django-emoji smiles
- Upgrade all libraries and support django 1.10
- Importing data from a paged archive
- Fixed bugs in the logic of obtaining data on the API
- Added new pages - user messages, statistics using django orm
- Added navigation in order to be able to send a link to a specific message including pagination of django-pagination
Among the further plans I would like to note:
- Support work with multiple teams
- Improve file handling
- Add advanced search feature
- Add more fun or useful statistics
Server creation
And now to the point, let's unfold this project.
First we need a virtual server. For small teams, a minimal configuration will suffice.
For example, what can be launched quickly and cheaply:
Total, you can get a separate server for 200 rubles per month or even free of charge for the first time.
I checked the script for Centos7 so when creating it, select it, find out its ip address or domain name and remember them, they will be required at the next step.
Register slack application
Next, we need to register the slack application to access the API.
- Go to api.slack.com/applications
- Create a new application

- Add the address of the newly created server to oauth redirects

- We keep Client ID and Client Secret

Run the application
- Connect via ssh to server
- Run the command
curl -O https://raw.githubusercontent.com/menemy/slack-backup/master/provisioning_on_centos7.sh
- Fix three settings at the beginning of the script.
- SLACK_CLIENT_ID = [your_client_id]
- SLACK_CLIENT_SECRET = [your_client_secret]
- DOMAIN = [your_domain]
- We fix the rights and run
- chmod 777 provisioning_on_amazonlinux.sh
- sudo ./provisioning_on_amazonlinux.sh
- Everything, after that the application is launched and available at your address, the history is synchronized every five minutes
- You need to go to the site and provide access to your slack account.
Optionally, restore message history
If you find out about this decision late - it does not matter, slack actually continues to store your history and allows you to upload the entire history as a zip archive.
But this is only for administrators group.
- Go to my.slack.com/services/export
- Create unload
- Wait for the end
- Reload the page and download the zip file
- Upload the file to the server and upload it to the / usr / local / src / slack-backup / full_history / folder
- Run the python command /usr/local/src/slack-backup/manage.py restore_backup
- Wait until the end, it may take time.

I would be glad if my efforts would be helpful. If you have questions about the work or need help with the installation I will be happy to help in the comments.