GithubHelp home page GithubHelp logo

docker-irssi's Introduction

SSH + TMUX + IRSSI

Combine ssh, tmux, and irssi to create a remotely hosted IRC client.

This container hosts an ssh server that will automatically create/connect to a tmux session running irssi whenever you log in. This means you can leave irssi connected and remotely access it anywhere using ssh.

Deployment

Here is an example on how to run this container using all supported features.

$ docker run --name irssi --hostname irssi -d \
    -p 2222:22 \
    -p 60000-61000:60000-61000/udp \
    -e ENABLE_MOSH="true" \
    -e SSH_PASSWORD="P455w0rd" \
    -e SSH_AUTHORIZED_KEY="$(< ~/.ssh/id_rsa.pub)" \
    -e IRSSI_REPO="[email protected]:BrowncoatShadow/irssi.git" \
    -e IRSSI_REPO_KEY="$(< ~/.ssh/id_rsa)" \
    -e ENABLE_SCRIPTS="true" \
    browncoatshadow/irssi

Configuration

ssh

-p 2222:22 maps a port on the host to the ssh port in the container.

-e SSH_PASSWORD="P455w0rd" sets the password on the root account in the container, and enables password login for the root account. This can be a convenient fallback, but ssh keys are recommended.

-e SSH_AUTHORIZED_KEY="$(< ~/.ssh/id_rsa.pub)" reads your public ssh key from file from your client, then writes it to root's ~/.ssh/authorized_keys file. This allows secure password-less login.

irssi

-e IRSSI_REPO="[email protected]:BrowncoatShadow/irssi.git" takes a git repo containing your irssi configuration. This allows you to easily deploy your irssi configuration remotely in an easy way. If your irssi configuration contains passwords, it is highly recommended that you store them in a private and/or self hosted repo.

-e IRSSI_REPO_KEY="$(< ~/.ssh/id_rsa)" is useful if your irssi configuration repo is private. It will store your private ssh key into a temp file used to clone the irssi repo. It is then removed.

-e ENABLE_SCRIPTS="true" will install the perl scripting dependencies for irssi plugins and make sure load perl is in the ~/.irssi/startup file.

mosh

-e ENABLE_MOSH="true" will install mosh.

-p 60000-61000:60000-61000/udp publishes the default port range for mosh to establish connections. If you prefer, you can instead publish specific ports and have your mosh client instruct the server to establish connections using those ports.

Connecting

You can connect to the container using ssh, which will automatically open irssi inside of a tmux session. If you need help determining the IP you need to connect to your container, docker's port subcommand is very helpful.

$ docker port irssi 22
192.168.99.100:2222
$ ssh [email protected] -p 2222

You can quit by using the /quit command in irssi, or detach tmux using the key binding ctrl-b d, which will leave irssi connected in the background. Both will disconnect you from the ssh connection.

TIP: tmux_away.pl is an amazingly useful script in this situation. It can automatically mark you as away whenever you are detached from the tmux session and mark you as no longer away when you reconnect.

SSH Config

Simplify connection by adding an entry to your ~/.ssh/config file.

# ~/.ssh/config
Host irssi
  User root
  HostName 192.168.99.100
  Port 2222

Now you can connect using a host alias.

$ ssh irssi

Advanced Deployments

This container was designed to be simple for remote deployments. However, it can easily be used to make something more complex. Here are a couple of examples.

Example: Log Storage

If you want to store your logs you can create a persistent volume for log storage and mount it in your irssi container.

$ docker volume create --name irssi-logs
irssi-logs
$ docker run --name irssi -d \
    -p 2222:22 \
    -e SSH_PASSWORD="P455w0rd" \
    -e IRSSI_REPO="[email protected]:BrowncoatShadow/irssi.git" \
    -v irssi-logs:/root/irclogs \
    browncoatshadow/irssi

Example: Custom Container

You can also use this container as a base for building a custom deployment. Maybe you want to build with your configuration or add additional features or plugin dependencies.

# Dockerfile
FROM browncoatshadow/irssi

ADD /home/browncoatshadow/.irssi /root/.irssi/
ADD /home/browncoatshadow/.ssh/authorized_keys /root/.ssh/authorized_keys

RUN apk --no-cache add irssi-proxy && \
    echo "load proxy" >> /root/.irssi/startup

EXPOSE 6667

Now build and deploy the custom container.

$ docker build . -t browncoatshadow/irssi-proxy
Sending build context to Docker daemon 100.4 kB
...
Successfully built 8d95468e90fb
$ docker run --name irssi-proxy -d \
    -p 2200:22 \
    -p 6667:6667 \
    browncoatshadow/irssi-proxy

docker-irssi's People

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.