Giter Club home page Giter Club logo

hastebin-docker's Introduction

Docker Pulls Docker Build Status Docker Repository on Quay

docker-pastebin

A dev oriented pastebin like container for sharing code and text. A lot more usefull though, thanking John Crepezzi Paste your stuff however :)

Quickstart

Run

docker run --name hastebin -p 80:80 catthehacker/hastebin

Compose

hastebin:
    image: catthehacker/hastebin
    container_name: hastebin
    hostname: hastebin
    restart: unless-stopped
    expose:
      - 80/tcp
    volumes:
      # If mounting on Docker Desktop for Windows
      - C:\path\to\data\:/opt/haste/data
      # If mounting on Docker on Linux
      - /path/to/data:/opt/haste/data

Labels for Traefik with Let's Encrypt

    labels:
      traefik.enable: true
      traefik.http.routers.hastebin.tls: true
      traefik.http.routers.hastebin.rule: "Host(`bin.docker.localhost`)"
      traefik.http.routers.hastebin.tls.certresolver: "le"
      traefik.http.routers.hastebin.entrypoints: "websecure"

Settings

Overview

  • host - the host the server runs on (default localhost)
  • port - the port the server runs on (default 7777)
  • keyLength - the length of the keys to user (default 10)
  • maxLength - maximum length of a paste (default none)
  • staticMaxAge - max age for static assets (86400)
  • recompressStatisAssets - whether or not to compile static js assets (true)
  • documents - static documents to serve (ex: http://hastebin.com/about.com) in addition to static assets. These will never expire.
  • storage - storage options (see below)
  • logging - logging preferences
  • keyGenerator - key generator options (see below)

Details

For easy use the details are almost equal to the originals. You can find original configuration documentation at John's github page

Key Generation

Phonetic

Attempts to generate phonetic keys, similar to pwgen

{
  "type": "phonetic"
}

Random

Generates a random key

{
  "type": "random",
  "keyspace": "abcdef"
}

The optional keySpace argument is a string of acceptable characters for the key.

Storage

File

To use file storage (the default) change the storage section in config.js to something like:

{
  "path": "./data",
  "type": "file"
}

Where path represents where you want the files stored

Redis

To use redis storage you must install the redis package in npm

npm install redis

Once you've done that, your config section should look like:

{
  "type": "redis",
  "host": "localhost",
  "port": 6379,
  "db": 2
}

You can also set an expire option to the number of seconds to expire keys in. This is off by default, but will constantly kick back expirations on each view or post.

All of which are optional except type with very logical default values.

Memcached

To use memcached storage you must install the memcache package via npm

npm install memcache

Once you've done that, your config section should look like:

{
  "type": "memcached",
  "host": "127.0.0.1",
  "port": 11211
}

You can also set an expire option to the number of seconds to expire keys in. This behaves just like the redis expirations, but does not push expirations forward on GETs.

All of which are optional except type with very logical default values.

Clients

Web

After starting the container you can navigate to 'targethost:targetport' and start using the bin via your browser.

Linux & OSX (ruby)

Install

Usually ruby is provided by OSX basic installation.

If your Linux Distro doesn't have ruby, you may want to install it. You should include the dev variant, as several games depend on them e.g.

Ubuntu/Debian

apt-get install ruby-dev

RHEL/CentOS

yum install ruby-dev

Client Install

After you ensure to have ruby installed use the following instruction.

gem install haste

Usage

Add Content

cat file | haste

Read content

haste file

Non-Ruby install

For those who don't like great ruby stuff - you may use following script as an alternative.

haste() { a=$(cat); curl -X POST -s -d "$a" http://hastebin.com/documents | awk -F '"' '{print "http://hastebin.com/"$4}'; }

Windows

If you want to acces via Windows have a look at Aidan Ryan's WinHaste

hastebin-docker's People

Contributors

catthehacker avatar lus avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

patrickhult

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.