Skip to content

Instantly share code, notes, and snippets.

@sunapi386
Created January 8, 2019 03:23
Show Gist options
  • Save sunapi386/a5817a671e695e025d307899b6ed8b81 to your computer and use it in GitHub Desktop.
Save sunapi386/a5817a671e695e025d307899b6ed8b81 to your computer and use it in GitHub Desktop.
Guide to getting your own slack export

1 Get a token

From https://api.slack.com/custom-integrations/legacy-tokens

2 Use slack-export and get a copy of your data

Use this tool to download https://github.com/zach-snell/slack-export

wget https://github.com/zach-snell/slack-export/raw/master/slack_export.py

Install dependencies

pip install slacker # https://github.com/os/slacker
pip install pick # https://github.com/wong2/pick

Then run

python3 slack-export.py --token='xoxp-64756569494-[..omitted..]'

After it's done, go into the directory and zip the file, then view in the viewer.

Install the slack export viewer

This will take your zip file and host it locally.

pip install slack-export-viewer

Create a zip from the dump, and host it.

cd 20190107-164818-slack_export/
zip -r ../20190107-164818-slack_export.zip *
cd ..
slack-export-viewer -z 20190107-164818-slack_export.zip

Optionals

Setup nginx to reverse proxy.

Setup with sudo certbot --nginx for https

sudo certbot --nginx

Setup simple authentication

sudo htpasswd -c /etc/nginx/.htpasswd <username>
# enter password
cat /etc/nginx/.htpasswd # view password

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment