diff options
author | Pedro Alvarez <pedro.alvarez@codethink.co.uk> | 2015-01-20 17:46:42 +0000 |
---|---|---|
committer | Pedro Alvarez <pedro.alvarez@codethink.co.uk> | 2015-03-07 19:18:52 +0000 |
commit | 598d835d93aec692e813395215d6fb82d11d3b4c (patch) | |
tree | f75f5280ea35efb8464ff97ef03f4caf05217d5b /baserock_irclogs | |
parent | 50b1d6202e812c298140df356e23607ef8ad5df3 (diff) | |
download | infrastructure-598d835d93aec692e813395215d6fb82d11d3b4c.tar.gz |
Add system to get irclogs from #baserock
Diffstat (limited to 'baserock_irclogs')
-rw-r--r-- | baserock_irclogs/clusters/irclogs.morph | 13 | ||||
-rw-r--r-- | baserock_irclogs/files/baserock.conf | 185 | ||||
-rw-r--r-- | baserock_irclogs/files/irclogs-generation.service | 12 | ||||
-rw-r--r-- | baserock_irclogs/files/irclogs-generation.timer | 9 | ||||
-rw-r--r-- | baserock_irclogs/files/lighttpd-irclogs.conf | 16 | ||||
-rw-r--r-- | baserock_irclogs/files/lighttpd-irclogs.service | 11 | ||||
-rw-r--r-- | baserock_irclogs/files/supybot.service | 15 | ||||
-rw-r--r-- | baserock_irclogs/irclogs.configure | 45 | ||||
-rw-r--r-- | baserock_irclogs/strata/irclogs.morph | 16 | ||||
-rw-r--r-- | baserock_irclogs/systems/irclogs-x86_64.morph | 33 |
10 files changed, 355 insertions, 0 deletions
diff --git a/baserock_irclogs/clusters/irclogs.morph b/baserock_irclogs/clusters/irclogs.morph new file mode 100644 index 00000000..8c899d03 --- /dev/null +++ b/baserock_irclogs/clusters/irclogs.morph @@ -0,0 +1,13 @@ +name: irclogs +kind: cluster +systems: +- morph: baserock_irclogs/systems/irclogs-x86_64.morph + deploy: + irclogs: + type: openstack + location: http://compute.datacentred.io:5000/v2.0/ + DISK_SIZE: 4G + HOSTNAME: irclogs + CLOUD_INIT: yes + KERNEL_ARGS: console=ttyS0 console=tty0 + OPENSTACK_IMAGENAME: irclogs diff --git a/baserock_irclogs/files/baserock.conf b/baserock_irclogs/files/baserock.conf new file mode 100644 index 00000000..df54affd --- /dev/null +++ b/baserock_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/baserock_irclogs/files/irclogs-generation.service b/baserock_irclogs/files/irclogs-generation.service new file mode 100644 index 00000000..ac480a15 --- /dev/null +++ b/baserock_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/baserock_irclogs/files/irclogs-generation.timer b/baserock_irclogs/files/irclogs-generation.timer new file mode 100644 index 00000000..c236c3d6 --- /dev/null +++ b/baserock_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/baserock_irclogs/files/lighttpd-irclogs.conf b/baserock_irclogs/files/lighttpd-irclogs.conf new file mode 100644 index 00000000..0b40346a --- /dev/null +++ b/baserock_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/baserock_irclogs/files/lighttpd-irclogs.service b/baserock_irclogs/files/lighttpd-irclogs.service new file mode 100644 index 00000000..1c09b0d9 --- /dev/null +++ b/baserock_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/baserock_irclogs/files/supybot.service b/baserock_irclogs/files/supybot.service new file mode 100644 index 00000000..49720f70 --- /dev/null +++ b/baserock_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/baserock_irclogs/irclogs.configure b/baserock_irclogs/irclogs.configure new file mode 100644 index 00000000..8a2421ef --- /dev/null +++ b/baserock_irclogs/irclogs.configure @@ -0,0 +1,45 @@ +#!/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" + +# Copy supybot configuration +install -m 644 -g 1010 -o 1010 baserock_irclogs/files/baserock.conf "$ROOT"/home/supybot/supybot-baserock.conf + + +# Enable all the services needed +services="irclogs-generation.service \ +irclogs-generation.timer \ +lighttpd-irclogs.service \ +supybot.service" + +for service in $services; do + cp "baserock_irclogs/files/$service" "$ROOT/etc/systemd/system/$service" + ln -sf "/etc/systemd/system/$service" \ + "$ROOT/etc/systemd/system/multi-user.target.wants/$service" +done + +# Copy lighttpd configuration +cp baserock_irclogs/files/lighttpd-irclogs.conf "$ROOT"/etc/lighttpd-irclogs.conf diff --git a/baserock_irclogs/strata/irclogs.morph b/baserock_irclogs/strata/irclogs.morph new file mode 100644 index 00000000..a2b08fc6 --- /dev/null +++ b/baserock_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/python-core.morph +chunks: +- name: supybot + repo: http://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/baserock_irclogs/systems/irclogs-x86_64.morph b/baserock_irclogs/systems/irclogs-x86_64.morph new file mode 100644 index 00000000..07f42119 --- /dev/null +++ b/baserock_irclogs/systems/irclogs-x86_64.morph @@ -0,0 +1,33 @@ +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: python-core + morph: strata/python-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: baserock_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 +- baserock_irclogs/irclogs |