Pritunl Slack App Slash Commands
Using Poetry
poetry install --extras=flask
Using PIP (source install)
pip install .[flask]
flask run
gunicorn pritunl_slack_app.flask_handler:flask_app \
--bind 0.0.0.0:9000
poetry export --without-hashes \
--format requirements.txt \
--output ./pritunl_slack_app/function/requirements.txt
sam build --use-container
sam deploy --guided
Check out the article Build a Pritunl Slack Slash Commands with a Serverless Backend for the complete Serverless Backend deployment.
docker buildx build . \
--file flask-gunicorn.Dockerfile \
--progress plain \
--target production \
--tag nathanielvarona/pritunl-slack-app
docker run -it --rm \
--env PRITUNL_BASE_URL=https://vpn.domain.tld/ \
--env PRITUNL_API_SECRET="####" \
--env PRITUNL_API_TOKEN="####" \
--env SLACK_SIGNING_SECRET="####" \
--env SLACK_BOT_TOKEN="####" \
--env GUNICORN_CMD_ARGS="--timeout 0" \
--env APP_PORT=8081 \
--publish 8081:8081 \
nathanielvarona/pritunl-slack-app
Example 1: Enable AsyncIO Workers by increasing the number of Gunicorn workers and threads.
docker run -it --rm \
--env PRITUNL_BASE_URL=https://vpn.domain.tld/ \
--env PRITUNL_API_SECRET="####" \
--env PRITUNL_API_TOKEN="####" \
--env SLACK_SIGNING_SECRET="####" \
--env SLACK_BOT_TOKEN="####" \
--env GUNICORN_CMD_ARGS="--timeout 0 --workers 5 --threads 2" \
--env APP_PORT=8081 \
--publish 8081:8081 \
nathanielvarona/pritunl-slack-app
Example 2: Enable debug mode.
docker run -it --rm \
--env PRITUNL_BASE_URL=https://vpn.domain.tld/ \
--env PRITUNL_API_SECRET="####" \
--env PRITUNL_API_TOKEN="####" \
--env SLACK_SIGNING_SECRET="####" \
--env SLACK_BOT_TOKEN="####" \
--env GUNICORN_CMD_ARGS="--timeout 0" \
--env FLASK_DEBUG=True \
--env APP_PORT=8081 \
--publish 8081:8081 \
nathanielvarona/pritunl-slack-app