• Stars
    star
    134
  • Rank 270,967 (Top 6 %)
  • Language
    Shell
  • Created about 11 years ago
  • Updated almost 3 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Run the ZNC IRC Bouncer in a Docker container.

ZNC for Docker

Run the ZNC IRC Bouncer in a Docker container.

Prerequisites

  1. Install Docker.

Running

ZNC needs to store settings somewhere, so simplest way to run it is to mount a directory from the host machine to /znc-data in the container:

mkdir -p $HOME/.znc
docker run -d -p 6667 -v $HOME/.znc:/znc-data jimeh/znc

This will download the image if needed, and create a default config file in your data directory unless you already have a config in place. The default config has ZNC listening on port 6667. To see which port on the host has been exposed:

docker ps

Or if you want to specify which port to map the default 6667 port to:

docker run -d -p 36667:6667 -v $HOME/.znc:/znc-data jimeh/znc

Resulting in port 36667 on the host mapping to 6667 within the container.

Configuring ZNC

If you've let the container create a default config for you, the default username/password combination is admin/admin. You can access the web-interface to create your own user by pointing your web-browser at the opened port.

For example, if you passed in -p 36667:6667 like above when running the container, the web-interface would be available on: http://hostname:36667/

I'd recommend you create your own user by cloning the admin user, then ensure your new cloned user is set to be an admin user. Once you login with your new user go ahead and delete the default admin user.

External Modules

If you need to use external modules, simply place the original *.cpp source files for the modules in your {DATADIR}/modules directory. The startup script will automatically build all .cpp files in that directory with znc-buildmod every time you start the container.

This ensures that you can easily add new external modules to your znc configuration without having to worry about building them. And it only slows down ZNC's startup with a few seconds.

DATADIR

ZNC stores all it's settings in a Docker volume mounted to /znc-data inside the container.

Mount a Host Directory

The simplest approach is typically to mount a directory off of your host machine into the container. This is done with -v $HOME/.znc:/znc-data like in the example above.

One issue with this though is that ZNC needs to run as it's own user within the container, the directory will have it's ownership changed to UID 1000 (user) and GID 1000 (group). Meaning after the first run, you might need root access to manually modify the data directory.

Use a Volume Container

First we need to create a volume container:

docker run -v /znc-data --name znc-data busybox echo "data for znc"

And then run the znc container using the --volumes-from option instead of -v:

docker run -d -p 6667 --name znc --volumes-from znc-data jimeh/znc

You'll want to periodically back up your znc data to the host:

docker run --volumes-from znc-data -v $(pwd):/backup ubuntu tar cvf /backup/backup.tar /znc-data

And restore them later:

docker run --volumes-from znc-data -v $(pwd):/backup busybox tar xvf /backup/backup.tar

Passing Custom Arguments to ZNC

As docker run passes all arguments after the image name to the entrypoint script, the start-znc script simply passes all arguments along to ZNC.

For example, if you want to use the --makepass option, you would run:

docker run -i -t -v $HOME/.znc:/znc-data jimeh/znc --makepass

Make note of the use of -i and -t instead of -d. This attaches us to the container, so we can interact with ZNC's makepass process. With -d it would simply run in the background.

A note about ZNC 1.6

Starting with version 1.6, ZNC now requires ssl/tls certificate verification! This means that it will not connect to your IRC server(s) if they don't present a valid certificate. This is meant to help keep you safer from MitM attacks.

This image installs the debian/ubuntu ca-certificates package so that servers with valid certificates will automatically be connected to ensuring no additional user intervention needed. If one of your servers doesn't have a valid fingerprint, you will need to connect to your bouncer and respond to *status.

See this article for more information.

Building It Yourself

  1. Follow Prerequisites above.
  2. Checkout source: git clone https://github.com/jimeh/docker-znc.git && cd docker-znc
  3. Build container: sudo docker build -t $(whoami)/znc .
  4. Run container: sudo docker run -d -p 6667 -v $HOME/.znc:/znc-data $(whoami)/znc

More Repositories

1

git-aware-prompt

Display current Git branch name in your terminal prompt when in a Git working directory.
Shell
2,139
star
2

tmux-themepack

A pack of various Tmux themes.
Go
1,564
star
3

tmuxifier

Tmuxify your Tmux. Powerful session, window & pane management for Tmux.
Shell
1,018
star
4

build-emacs-for-macos

Somewhat hacky script to automate building of Emac.app on macOS.
Go
434
star
5

emacs-builds

Self-contained Emacs.app builds for macOS, with native-compilation support.
Go
333
star
6

manservant

Browse man pages in style with your personal manservant.
Perl
164
star
7

redistat

A Redis-backed statistics storage and querying library written in Ruby.
Ruby
155
star
8

zsh-peco-history

Search shell history with peco when pressing ctrl+r.
Shell
122
star
9

PastryKit

A little-known and unreleased iPhone web-app Javascript framework developed by Apple.
JavaScript
104
star
10

.emacs.d

My personal Emacs config with any quirks, oddities, bugs, and man-eating errors I live with on a daily basis.
Emacs Lisp
98
star
11

twilight-bright-theme.el

A Emacs port of the TextMate theme by the same name with some minor tweaks and additions.
Emacs Lisp
63
star
12

stub.sh

Helpers for bash script testing to stub/fake binaries and functions. Includes support for validating number of stub calls, and/or if stub has been called with specific arguments.
Shell
53
star
13

php-rack

An implementation of the middleware execution stack from Ruby's Rack library, for PHP.
PHP
52
star
14

common-flow

An attempt to gather a sensible selection of the most common usage patterns of git into a single and concise specification.
41
star
15

dotfiles

My personals dotfiles with any quirks, oddities, bugs, and man-eating errors I live with on a daily basis.
Shell
40
star
16

twilight-anti-bright-theme

A light-on-dark Emacs and TextMate theme inspired by the dark-on-light Twilight Bright TextMate theme.
Emacs Lisp
40
star
17

birds-of-paradise-plus-theme.el

A Emacs port of Joseph Bergantine's light-on-dark theme by the same name.
Emacs Lisp
38
star
18

node-base58

Base58 encoding and decoding for Node.js
JavaScript
33
star
19

rubocopfmt.el

Emacs minor-mode to format Ruby code with RuboCop on save.
Emacs Lisp
16
star
20

go-midjourney

Go
15
star
21

760-grid-system

Use the same principals of the 960 grid system within Facebook's 760 pixel wide frame for Facebook Applications.
Ruby
15
star
22

jimeh.me-v3.0

Jekyll project of a old version my personal website and blog.
CSS
13
star
23

tomorrow-night-paradise-theme.el

A light-on-dark Emacs theme which is essentially a tweaked version of Chris Kempson's Tomorrow Night Bright theme.
Emacs Lisp
11
star
24

litemysql

Very light-weight and simple ORM-like MySQL library for PHP. Kind of like ActiveRecord's little brother.
PHP
11
star
25

amqp-failover

Add multi-server support with failover and fallback to the amqp gem.
Ruby
10
star
26

jimeh.github.io

This is the source-code for my personal website.
SCSS
9
star
27

homebrew-emacs-builds

Ruby
8
star
28

suggest_results

Easily customizable search suggestion plugin for jQuery, which suggests results directly, rather than search terms.
JavaScript
7
star
29

yank-indent

Emacs minor-mode that ensures pasted (yanked) text has the correct indentation level.
Emacs Lisp
7
star
30

collecta_ruby

A light Ruby library / Rails plugin for querying the Collecta API.
Ruby
7
star
31

ansible-adguardhome

Ansible role to install and run AdGuard Home, with support for non-root operation.
Python
7
star
32

mta-sts-on-github-pages

Template repository for hosting MTA-STS (.well-known/mta-sts.txt) on GitHub Pages.
6
star
33

go-golden

Yet another Go package for working with *.golden test files, with a focus on simplicity.
Go
6
star
34

airbrake-statsd

Extends the Airbrake gem to also report exceptions to Esty's StatsD statistics aggregator.
Ruby
6
star
35

greek_easter

Never wonder again when easter is in Greece.
Ruby
6
star
36

facebooker_plus

A Ruby on Rails plugin fixing, extending and adding features to Facebooker, possibly beyond the originally intended scope of Facebooker itself.
Ruby
5
star
37

fancy_input

Easily customizable search suggestion plugin for jQuery, which suggests results directly, rather than search terms. (Formally known as suggest_results)
JavaScript
5
star
38

casecmp

Case-insensitive string comparison, as an API. Because ¯\_(ツ)_/¯
Go
5
star
39

docker-flexget

Simple Docker container for running Flexget
Shell
4
star
40

zynapse

Rails-like MVC framework for PHP5. Currently abandoned and published for educational reasons.
JavaScript
4
star
41

twhois

Whois-like command-line tool and Ruby Gem for Twitter users
Ruby
3
star
42

undent

Go package which removes leading indentation/white-space from strings.
Go
3
star
43

tab-bar-notch

Adjust tab-bar height for MacBook Pro notch
Emacs Lisp
3
star
44

Dockerfiles

Small collection of Docker and Docker Compose files I use to run stuff on my personal laptop
Shell
3
star
45

time_ext

Extends the abilities of Ruby's built-in Time class by building on top of ActiveSupport.
Ruby
3
star
46

standardfmt.el

Emacs minor-mode to format JavaScript with standard / semistandard on save.
Emacs Lisp
3
star
47

960-grid-system-plus

A clone/enhancement of the excellent 960 Grid System by Nathan Smith to fit my personal likes and dislikes.
3
star
48

skyline

Ruby-based interactive shell tools to send terminal commands to instances in Amazon EC2 AutoScaling groups
Ruby
2
star
49

fastmail-rules

Go
2
star
50

kotaku-uk-rss

Small experimental web-scraper to provide a RSS feed of kotaku.co.uk for my own personal use.
Go
2
star
51

skyhook

A customized set of scripts and config files to deploy projects and control services on Amazon EC2.
Ruby
2
star
52

rubocopfmt

DEPRECATED! Easy formatting of Ruby code using rubocop. Analogous to gofmt.
Ruby
2
star
53

terraform-cloudflare-email

Terraform module to configure various email related DNS records on Cloudflare.
HCL
2
star
54

envctl

Go package providing test helper functions to temporarily change and restore environment variables.
Go
1
star
55

git-basics

A basic intro to git
1
star
56

cloudflare-dyndns

Go
1
star
57

chef-btsync

A simple and quickly hacked together chef cookbook for installing and configuring BTSync on Ubuntu for my own personal needs.
Ruby
1
star
58

rands

Go package providing a suite of functions that use crypto/rand to generate cryptographically secure random strings in various formats.
Go
1
star
59

tmux-themepack-previews

This holds nothing interesting. Go check out the Tmux Themepack project instead.
Shell
1
star
60

blank_gem

A blank/empty Ruby gem that does nothing.
Ruby
1
star
61

modern_bubbling

An Adium message style.
JavaScript
1
star
62

seedsafe

An attempt to learn about AES encryption.
Go
1
star
63

heartb.it

Ruby
1
star
64

mje

Go
1
star
65

pylight

Quick hack to create an HTTP API for accessing Pygments, and to start teaching myself Python.
Python
1
star
66

bah.io

Static landing page for bah.io
HTML
1
star
67

jimeh.me-api

Experimental project to rewrite my site and blog to run off of an EventMachine-based API. Cause it's fun ^_^
Ruby
1
star
68

update-tags-action

Easily create/update one or more Git tags in a GitHub repository.
JavaScript
1
star
69

play-store-notifier

Small shitty script I originally used to notify myself via email of when the Nexus 4 came back in stock. Now using it to find out when the Nexus 5 becomes available on the Play Store.
Ruby
1
star
70

rbheap

A tool to help with tracking down memory leaks in Ruby.
Go
1
star
71

ps4-20th-tool

A small tool built for educational purposes that attempts to pick apart Sony's 20 Years Of Character's website to find the secret URL.
Go
1
star