Skip to content

yoeo/pasta

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Pasta

Pretty-paste source code on Slack

Webguesslang

/paste source code

Pasta is a Slack /command that allow you to past source code directly on channels. The source code is converted into a file and its programming language is automatically detected.

Preview

Install & Run

  • Python 3.6+ required

  • Create your Slack app and tokens https://api.slack.com/:

    • Find Client ID at Basic Information > App Credentials > Client ID

    • and Bot token at OAuth & Permissions > OAuth Tokens & Redirect URLs > Tokens for Your Team > Bot User OAuth Access Token

  • Fill config/tokens.json with your Slack app tokens

  • Install Pasta on your server:

pip3 install .
  • Run Pasta:
pasta-gunicorn
  • You can also provide the tokens as environment variables
PASTA_DEBUG=1 \
  PASTA_BOT_TOKEN="my-bot-user-token" \
  PASTA_CLIENT_ID="my-app-client-id" \
  pasta-gunicorn

Create and run Pasta Docker container

  • Create Pasta container
docker build -t pasta-img .
docker create -p 8000:8000 --name pasta \
  -e PASTA_BOT_TOKEN="my-bot-user-token" \
  -e PASTA_CLIENT_ID="my-app-client-id" \
  pasta-img
  • Start Pasta container
docker start pasta
  • Stop Pasta container
docker stop pasta

License and stuff...

About

Pretty-paste source code on Slack

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published