Skip to content

screenshot2slack is a tool uploading a screenshot to slack with puppeteer on docker.

License

Notifications You must be signed in to change notification settings

ryysud/screenshot2slack

Repository files navigation

screenshot2slack

Tags Docker Build Status Docker Pulls License

Overview

screenshot2slack is a tool uploading a screenshot to slack with puppeteer on docker.

Puppeteer is a Node library which provides a high-level API to control Chrome or Chromium over the DevTools Protocol.
See https://github.com/GoogleChrome/puppeteer .

Requirements

Usage

Getting started

$ docker run --rm \
    -e SLACK_BOT_TOKEN=xxx-xxx-xxx \
    -e CHANNEL=your-channel \
    ryysud/screenshot2slack:latest

Specify URL, width and height

$ docker run --rm \
    -e SLACK_BOT_TOKEN=xxx-xxx-xxx \
    -e CHANNEL=your-channel \
    -e TARGET_URL=https://github.com/ryysud/screenshot2slack \
    -e WIDTH=1920 \
    -e HEIGHT=1080 \
    ryysud/screenshot2slack:latest

Via Basic authentication

$ docker run --rm \
    -e SLACK_BOT_TOKEN=xxx-xxx-xxx \
    -e CHANNEL=your-channel \
    -e TARGET_URL=https://example.com/path/to/basic-authentication-page \
    -e BASIC_AUTH_USERNAME=username \
    -e BASIC_AUTH_PASSWORD=password \
    ryysud/screenshot2slack:latest

Environment Variables

Name Description Required Default
SLACK_BOT_TOKEN Token string to post to slack. -
TARGET_URL Screen shot target URL. - https://github.com
FILE_NAME File name to post. - example.png
WIDTH Width of browser. - 1280
HEIGHT Height of browser. - 768
FULL_PAGE When true, takes a screenshot of the full scrollable page. - false
CHANNEL Slack channel name to post. - general
BASIC_AUTH_USERNAME Username to pass basic authentication. - null
BASIC_AUTH_PASSWORD Password to pass basic authentication. - null
COOKIES JSON Array string to pass to browser. - null
SCREENSHOT_DELAY_SEC Number of seconds to delay time to take screenshot. - null

Example of COOKIES

[
    {"name": "_session", "value": "xxx", ...},
    {"name": "foo", "value": "bar", ...},
    ...
]

See Puppeteer Docs.

License