summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPedro Alvarez <pedro.alvarez@codethink.co.uk>2015-01-20 17:46:42 +0000
committerPedro Alvarez <pedro.alvarez@codethink.co.uk>2015-01-31 16:33:31 +0000
commitd6ac7ce62e0d0a8cdf6ae6f4d696513aff17eeb6 (patch)
tree0f51be7b42a36ec74304aa51da87c4507b63888c
parent071058ea16675a499dc05cf00e9516f4786bb258 (diff)
downloadinfrastructure-d6ac7ce62e0d0a8cdf6ae6f4d696513aff17eeb6.tar.gz
Add system to get irclogs from #baserock
-rw-r--r--irclogs/clusters/irclogs.morph12
-rw-r--r--irclogs/files/baserock.conf185
-rw-r--r--irclogs/files/irclogs-generation.service12
-rw-r--r--irclogs/files/irclogs-generation.timer9
-rw-r--r--irclogs/files/lighttpd-irclogs.conf16
-rw-r--r--irclogs/files/lighttpd-irclogs.service11
-rw-r--r--irclogs/files/supybot.service15
-rw-r--r--irclogs/irclogs.configure41
-rw-r--r--irclogs/strata/irclogs.morph16
-rw-r--r--irclogs/systems/irclogs-x86_64.morph31
10 files changed, 348 insertions, 0 deletions
diff --git a/irclogs/clusters/irclogs.morph b/irclogs/clusters/irclogs.morph
new file mode 100644
index 00000000..bc28a7d7
--- /dev/null
+++ b/irclogs/clusters/irclogs.morph
@@ -0,0 +1,12 @@
+name: irclogs-kvm
+kind: cluster
+systems:
+- morph: irclogs/systems/irclogs-x86_64.morph
+ deploy:
+ my-kvm-system:
+ type: kvm
+ location: kvm+ssh://pedro@192.168.122.1/irclogs/home/pedro/baserock/irclogs.img
+ DISK_SIZE: 4G
+ RAM_SIZE: 1G
+ VCPUS: 1
+ HOSTNAME: paste
diff --git a/irclogs/files/baserock.conf b/irclogs/files/baserock.conf
new file mode 100644
index 00000000..df54affd
--- /dev/null
+++ b/irclogs/files/baserock.conf
@@ -0,0 +1,185 @@
+supybot.nick: brlogger
+supybot.nick.alternates: %s` %s_
+supybot.ident: supybot
+supybot.user:
+supybot.networks: freenode
+supybot.networks.freenode.password:
+supybot.networks.freenode.servers: irc.freenode.com:6667
+supybot.networks.freenode.channels: #baserock
+supybot.networks.freenode.channels.key:
+supybot.networks.freenode.ssl: False
+supybot.reply.format.time: %I:%M %p, %B %d, %Y
+supybot.reply.format.time.elapsed.short: False
+supybot.reply.maximumLength: 131072
+supybot.reply.mores: True
+supybot.reply.mores.maximum: 50
+supybot.reply.mores.length: 0
+supybot.reply.mores.instant: 1
+supybot.reply.oneToOne: True
+supybot.reply.whenNotCommand: True
+supybot.reply.error.detailed: False
+supybot.reply.error.inPrivate: False
+supybot.reply.error.withNotice: False
+supybot.reply.error.noCapability: False
+supybot.reply.inPrivate: False
+supybot.reply.withNotice: False
+supybot.reply.withNoticeWhenPrivate: False
+supybot.reply.withNickPrefix: True
+supybot.reply.whenNotAddressed: False
+supybot.reply.requireChannelCommandsToBeSentInChannel: False
+supybot.reply.showSimpleSyntax: False
+supybot.reply.whenAddressedBy.chars:
+supybot.reply.whenAddressedBy.strings:
+supybot.reply.whenAddressedBy.nick: True
+supybot.reply.whenAddressedBy.nick.atEnd: False
+supybot.reply.whenAddressedBy.nicks:
+supybot.followIdentificationThroughNickChanges: False
+supybot.alwaysJoinOnInvite: False
+supybot.replies.success: The operation succeeded.
+supybot.replies.error: An error has occurred and has been logged. Please\
+ contact this bot's administrator for more\
+ information.
+supybot.replies.incorrectAuthentication: Your hostmask doesn't match or your\
+ password is wrong.
+supybot.replies.noUser: I can't find %s in my user database. If you didn't\
+ give a user name, then I might not know what your\
+ user is, and you'll need to identify before this\
+ command might work.
+supybot.replies.notRegistered: You must be registered to use this command.\
+ If you are already registered, you must\
+ either identify (using the identify command)\
+ or add a hostmask matching your current\
+ hostmask (using the "hostmask add" command).
+supybot.replies.noCapability: You don't have the %s capability. If you think\
+ that you should have this capability, be sure\
+ that you are identified before trying again.\
+ The 'whoami' command can tell you if you're\
+ identified.
+supybot.replies.genericNoCapability: You're missing some capability you\
+ need. This could be because you\
+ actually possess the anti-capability\
+ for the capability that's required of\
+ you, or because the channel provides\
+ that anti-capability by default, or\
+ because the global capabilities include\
+ that anti-capability. Or, it could be\
+ because the channel or\
+ supybot.capabilities.default is set to\
+ False, meaning that no commands are\
+ allowed unless explicitly in your\
+ capabilities. Either way, you can't do\
+ what you want to do.
+supybot.replies.requiresPrivacy: That operation cannot be done in a channel.
+supybot.replies.possibleBug: This may be a bug. If you think it is, please\
+ file a bug report at <http://sourceforge.net/tr\
+ acker/?func=add&group_id=58965&atid=489447>.
+supybot.snarfThrottle: 10.0
+supybot.upkeepInterval: 3600
+supybot.flush: True
+supybot.commands.quotes: "
+supybot.commands.nested: True
+supybot.commands.nested.maximum: 10
+supybot.commands.nested.brackets: []
+supybot.commands.nested.pipeSyntax: False
+supybot.commands.defaultPlugins.addcapability: Admin
+supybot.commands.defaultPlugins.capabilities: User
+supybot.commands.defaultPlugins.disable: Owner
+supybot.commands.defaultPlugins.enable: Owner
+supybot.commands.defaultPlugins.help: Misc
+supybot.commands.defaultPlugins.ignore: Admin
+supybot.commands.defaultPlugins.importantPlugins: Plugin Admin Misc User Owner Config Channel
+supybot.commands.defaultPlugins.list: Misc
+supybot.commands.defaultPlugins.reload: Owner
+supybot.commands.defaultPlugins.removecapability: Admin
+supybot.commands.defaultPlugins.unignore: Admin
+supybot.commands.disabled:
+supybot.abuse.flood.command: True
+supybot.abuse.flood.command.maximum: 12
+supybot.abuse.flood.command.punishment: 300
+supybot.abuse.flood.command.invalid: True
+supybot.abuse.flood.command.invalid.maximum: 5
+supybot.abuse.flood.command.invalid.punishment: 600
+supybot.drivers.poll: 1.0
+supybot.drivers.module: default
+supybot.drivers.maxReconnectWait: 300.0
+supybot.directories.conf: /home/supybot/conf
+supybot.directories.data: /home/supybot/data
+supybot.directories.data.tmp: /home/supybot/data/tmp
+supybot.directories.backup: /home/supybot/backup
+supybot.directories.plugins: /home/supybot/plugins
+supybot.directories.log: /home/supybot/logs
+supybot.plugins: Admin ChannelLogger Misc User Owner Config Channel
+supybot.plugins.Admin: True
+supybot.plugins.Admin.public: True
+supybot.plugins.Channel: True
+supybot.plugins.Channel.public: True
+supybot.plugins.Channel.alwaysRejoin: True
+supybot.plugins.ChannelLogger: True
+supybot.plugins.ChannelLogger.public: True
+supybot.plugins.ChannelLogger.enable: True
+supybot.plugins.ChannelLogger.flushImmediately: False
+supybot.plugins.ChannelLogger.stripFormatting: True
+supybot.plugins.ChannelLogger.timestamp: True
+supybot.plugins.ChannelLogger.noLogPrefix: [nolog]
+supybot.plugins.ChannelLogger.rotateLogs: True
+supybot.plugins.ChannelLogger.filenameTimestamp: %Y-%m-%d
+supybot.plugins.ChannelLogger.directories: True
+supybot.plugins.ChannelLogger.directories.network: True
+supybot.plugins.ChannelLogger.directories.channel: True
+supybot.plugins.ChannelLogger.directories.timestamp: False
+supybot.plugins.ChannelLogger.directories.timestamp.format: %B
+supybot.plugins.Config: True
+supybot.plugins.Config.public: True
+supybot.plugins.Misc: True
+supybot.plugins.Misc.public: True
+supybot.plugins.Misc.listPrivatePlugins: True
+supybot.plugins.Misc.timestampFormat: [%H:%M:%S]
+supybot.plugins.Misc.last.nested.includeTimestamp: False
+supybot.plugins.Misc.last.nested.includeNick: False
+supybot.plugins.Owner: True
+supybot.plugins.Owner.public: True
+supybot.plugins.Owner.quitMsg:
+supybot.plugins.User: True
+supybot.plugins.User.public: True
+supybot.plugins.alwaysLoadImportant: True
+supybot.databases:
+supybot.databases.users.filename: users.conf
+supybot.databases.users.timeoutIdentification: 0
+supybot.databases.users.allowUnregistration: False
+supybot.databases.ignores.filename: ignores.conf
+supybot.databases.channels.filename: channels.conf
+supybot.databases.plugins.channelSpecific: True
+supybot.databases.plugins.channelSpecific.link: #
+supybot.databases.plugins.channelSpecific.link.allow: True
+supybot.databases.types.cdb: True
+supybot.databases.types.cdb.maximumModifications: 0.5
+supybot.protocols.irc.banmask: host user
+supybot.protocols.irc.strictRfc: False
+supybot.protocols.irc.umodes:
+supybot.protocols.irc.vhost:
+supybot.protocols.irc.maxHistoryLength: 1000
+supybot.protocols.irc.throttleTime: 1.0
+supybot.protocols.irc.ping: True
+supybot.protocols.irc.ping.interval: 120
+supybot.protocols.irc.queuing.duplicates: False
+supybot.protocols.irc.queuing.rateLimit.join: 0.0
+supybot.protocols.http.peekSize: 4096
+supybot.protocols.http.proxy:
+supybot.defaultIgnore: False
+supybot.externalIP:
+supybot.defaultSocketTimeout: 10
+supybot.pidFile:
+supybot.debug.threadAllCommands: False
+supybot.debug.flushVeryOften: False
+supybot.log.format: %(levelname)s %(asctime)s %(name)s %(message)s
+supybot.log.level: INFO
+supybot.log.timestampFormat: %Y-%m-%dT%H:%M:%S
+supybot.log.stdout: True
+supybot.log.stdout.colorized: False
+supybot.log.stdout.wrap: True
+supybot.log.stdout.format: %(levelname)s %(asctime)s %(message)s
+supybot.log.stdout.level: INFO
+supybot.log.plugins.individualLogfiles: False
+supybot.log.plugins.format: %(levelname)s %(asctime)s %(message)s
+supybot.capabilities: -owner -admin -trusted
+supybot.capabilities.default: True
diff --git a/irclogs/files/irclogs-generation.service b/irclogs/files/irclogs-generation.service
new file mode 100644
index 00000000..ac480a15
--- /dev/null
+++ b/irclogs/files/irclogs-generation.service
@@ -0,0 +1,12 @@
+[Unit]
+Description=Irclogs generation
+Requires=supybot.service
+
+[Service]
+Type=oneshot
+User=supybot
+ExecStart=/usr/bin/logs2html -t 'IRC logs for #baserock' -p 'IRC logs for #baserock for ' /home/supybot/logs/ChannelLogger/freenode/#baserock/
+ExecStart=/bin/sh -c "/usr/bin/rsync -a /home/supybot/logs/ChannelLogger/freenode/\#baserock/*html /home/supybot/logs/ChannelLogger/freenode/\#baserock/*css /srv/irclogs/"
+
+[Install]
+WantedBy=multi-user.target
diff --git a/irclogs/files/irclogs-generation.timer b/irclogs/files/irclogs-generation.timer
new file mode 100644
index 00000000..c236c3d6
--- /dev/null
+++ b/irclogs/files/irclogs-generation.timer
@@ -0,0 +1,9 @@
+[Unit]
+Description=Generates the irclogs in html every 5 minutes
+
+[Timer]
+OnUnitActiveSec=5min
+Unit=irclogs-generation.service
+
+[Install]
+WantedBy=multi-user.target
diff --git a/irclogs/files/lighttpd-irclogs.conf b/irclogs/files/lighttpd-irclogs.conf
new file mode 100644
index 00000000..0b40346a
--- /dev/null
+++ b/irclogs/files/lighttpd-irclogs.conf
@@ -0,0 +1,16 @@
+server.document-root = "/srv/irclogs/"
+
+server.port = 80
+
+server.username = "supybot"
+server.groupname = "supybot"
+
+mimetype.assign = (
+ ".html" => "text/html",
+ ".css" => "text/css",
+ ".txt" => "text/plain",
+ ".jpg" => "image/jpeg",
+ ".png" => "image/png"
+)
+
+index-file.names = ( "index.html" )
diff --git a/irclogs/files/lighttpd-irclogs.service b/irclogs/files/lighttpd-irclogs.service
new file mode 100644
index 00000000..1c09b0d9
--- /dev/null
+++ b/irclogs/files/lighttpd-irclogs.service
@@ -0,0 +1,11 @@
+[Install]
+WantedBy=multi-user.target
+
+[Unit]
+Description=Lighttpd Web Server
+After=network.target
+
+[Service]
+ExecStart=/usr/sbin/lighttpd -f /etc/lighttpd-irclogs.conf -D
+Restart=always
+
diff --git a/irclogs/files/supybot.service b/irclogs/files/supybot.service
new file mode 100644
index 00000000..49720f70
--- /dev/null
+++ b/irclogs/files/supybot.service
@@ -0,0 +1,15 @@
+[Unit]
+Description=Run supybot daemon
+Requires=network-online.target
+After=network-online.target
+# If there's a shared /home or /var subvolume, it must be
+# mounted before this unit runs.
+Requires=local-fs.target
+After=local-fs.target
+
+ConditionPathExists=/home/supybot/supybot-baserock.conf
+
+[Service]
+ExecStart=/usr/bin/supybot /home/supybot/supybot-baserock.conf
+User=supybot
+Restart=always
diff --git a/irclogs/irclogs.configure b/irclogs/irclogs.configure
new file mode 100644
index 00000000..85862417
--- /dev/null
+++ b/irclogs/irclogs.configure
@@ -0,0 +1,41 @@
+#!/bin/sh
+# Copyright (C) 2014 Codethink Limited
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; version 2 of the License.5
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+set -e
+
+ROOT="$1"
+
+echo 'supybot:x:1010:1010:Supybot User:/home/supybot:/bin/bash' >> "$ROOT/etc/passwd"
+echo 'supybot:x:1010:' >> "$ROOT/etc/group"
+mkdir -p "$ROOT/home/supybot"
+mkdir -p "$ROOT/srv/irclogs"
+chown -R 1010:1010 "$ROOT/home/supybot"
+chown -R 1010:1010 "$ROOT/srv/irclogs"
+
+install -m 644 -g 1010 -o 1010 irclogs/files/baserock.conf "$ROOT"/home/supybot/supybot-baserock.conf
+
+services="irclogs-generation.service \
+irclogs-generation.timer \
+lighttpd-irclogs.service \
+supybot.service"
+
+for service in $services; do
+ cp "irclogs/files/$service" "$ROOT/etc/systemd/system/$service"
+ ln -sf "/etc/systemd/system/$service" \
+ "$ROOT/etc/systemd/system/multi-user.target.wants/$service"
+done
+
+cp irclogs/files/lighttpd-irclogs.conf "$ROOT"/etc/lighttpd-irclogs.conf
diff --git a/irclogs/strata/irclogs.morph b/irclogs/strata/irclogs.morph
new file mode 100644
index 00000000..40d039aa
--- /dev/null
+++ b/irclogs/strata/irclogs.morph
@@ -0,0 +1,16 @@
+name: irclogs
+kind: stratum
+description: Tools to create irclogs of a IRC channel
+build-depends:
+- morph: strata/foundation.morph
+chunks:
+- name: supybot
+ repo: git://gitorious.org/supybot/supybot.git
+ ref: 27a4ef0ed338a38f34180012cee7ec55a5ae11d9
+ unpetrify-ref: v0.83.4.1
+ build-depends: []
+- name: irclog2html
+ repo: git://github.com/mgedmin/irclog2html
+ ref: 2e399c2bdbe2442794d0ac7aa3a3941f826c74dc
+ unpetrify-ref: 2.14.0
+ build-depends: []
diff --git a/irclogs/systems/irclogs-x86_64.morph b/irclogs/systems/irclogs-x86_64.morph
new file mode 100644
index 00000000..9e38f929
--- /dev/null
+++ b/irclogs/systems/irclogs-x86_64.morph
@@ -0,0 +1,31 @@
+name: irclogs-system-x86_64
+kind: system
+description: The set of strata required to have a minimal system for a 64-bit x86
+ system.
+arch: x86_64
+strata:
+- name: build-essential
+ morph: strata/build-essential.morph
+- name: core
+ morph: strata/core.morph
+- name: foundation
+ morph: strata/foundation.morph
+- name: bsp-x86_64-generic
+ morph: strata/bsp-x86_64-generic.morph
+- name: tools
+ morph: strata/tools.morph
+- name: irclogs
+ morph: irclogs/strata/irclogs.morph
+- name: pcre-utils
+ morph: strata/pcre-utils.morph
+- name: lighttpd-server
+ morph: strata/lighttpd-server.morph
+- name: cloudinit-support
+ morph: strata/cloudinit-support.morph
+configuration-extensions:
+- set-hostname
+- add-config-files
+- nfsboot
+- install-files
+- cloud-init
+- irclogs/irclogs