summaryrefslogtreecommitdiff
path: root/baserock_webserver
diff options
context:
space:
mode:
authorSam Thursfield <sam.thursfield@codethink.co.uk>2017-10-20 16:49:10 +0100
committerBen Brown <ben.brown@codethink.co.uk>2017-10-23 11:11:14 +0000
commit7a50ac10820b66a588513e9c6438e249bf9f7d12 (patch)
treebce2e832a1c13901a37879e53051f5fe12c91ee6 /baserock_webserver
parentd28577c8f0f602e92e722ac0d2561b86bf618484 (diff)
downloadinfrastructure-7a50ac10820b66a588513e9c6438e249bf9f7d12.tar.gz
Move brlogger bot into the webserver machine
Diffstat (limited to 'baserock_webserver')
-rw-r--r--baserock_webserver/instance-irclogs-config.yml46
-rw-r--r--baserock_webserver/irclogs/irclogs-generation.service24
-rw-r--r--baserock_webserver/irclogs/irclogs-generation.timer9
-rw-r--r--baserock_webserver/irclogs/supybot-baserock.conf190
-rw-r--r--baserock_webserver/irclogs/supybot.service15
5 files changed, 284 insertions, 0 deletions
diff --git a/baserock_webserver/instance-irclogs-config.yml b/baserock_webserver/instance-irclogs-config.yml
new file mode 100644
index 00000000..bdb23962
--- /dev/null
+++ b/baserock_webserver/instance-irclogs-config.yml
@@ -0,0 +1,46 @@
+# Instance-specific configuration for the Baserock IRC logger.
+---
+- hosts: webserver
+ tasks:
+ - name: Install Supybot
+ dnf: name=supybot state=latest
+ become: yes
+ become_user: root
+
+ - name: Install irclog2html
+ dnf: name=irclog2html state=latest
+ become: yes
+ become_user: root
+
+ - name: supybot user
+ user: name=supybot
+ become: yes
+ become_user: root
+
+ - name: /srv/irclogs.baserock.org/
+ file: path=/srv/irclogs.baserock.org/ owner=supybot state=directory
+ become: yes
+ become_user: root
+
+ - name: supybot configuration
+ copy: src=irclogs/supybot-baserock.conf dest=/home/supybot/supybot-baserock.conf owner=supybot
+ become: yes
+ become_user: supybot
+
+ - name: install systemd units
+ copy: src=./irclogs/{{item}} dest=/etc/systemd/system/{{item}}
+ become: yes
+ become_user: root
+ with_items:
+ - irclogs-generation.service
+ - irclogs-generation.timer
+ - supybot.service
+
+ - name: enable systemd units
+ systemd: name={{item}} enabled=yes daemon_reload=yes state=started
+ become: yes
+ become_user: root
+ with_items:
+ - irclogs-generation.service
+ - irclogs-generation.timer
+ - supybot.service
diff --git a/baserock_webserver/irclogs/irclogs-generation.service b/baserock_webserver/irclogs/irclogs-generation.service
new file mode 100644
index 00000000..4be97ec5
--- /dev/null
+++ b/baserock_webserver/irclogs/irclogs-generation.service
@@ -0,0 +1,24 @@
+[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.baserock.org/"
+
+ExecStart=/usr/bin/logs2html -t 'IRC logs for #automotive' -p 'IRC logs for #automotive for ' /home/supybot/logs/ChannelLogger/freenode/#automotive/
+ExecStart=/bin/sh -c "/usr/bin/rsync -a /home/supybot/logs/ChannelLogger/freenode/\#automotive/*html /home/supybot/logs/ChannelLogger/freenode/\#automotive/*css /srv/irclogs.baserock.org/automotive"
+
+ExecStart=/usr/bin/logs2html -t 'IRC logs for #cip' -p 'IRC logs for #cip for ' /home/supybot/logs/ChannelLogger/freenode/#cip/
+ExecStart=/bin/sh -c "/usr/bin/rsync -a /home/supybot/logs/ChannelLogger/freenode/\#cip/*html /home/supybot/logs/ChannelLogger/freenode/\#cip/*css /srv/irclogs.baserock.org/cip"
+
+ExecStart=/usr/bin/logs2html -t 'IRC logs for #trustable' -p 'IRC logs for #trustable for ' /home/supybot/logs/ChannelLogger/freenode/#trustable/
+ExecStart=/bin/sh -c "/usr/bin/rsync -a /home/supybot/logs/ChannelLogger/freenode/\#trustable/*html /home/supybot/logs/ChannelLogger/freenode/\#trustable/*css /srv/irclogs.baserock.org/trustable"
+
+ExecStart=/usr/bin/logs2html -t 'IRC logs for #buildstream' -p 'IRC logs for #buildstream for ' /home/supybot/logs/ChannelLogger/gimp/#buildstream/
+ExecStart=/bin/sh -c "/usr/bin/rsync -a /home/supybot/logs/ChannelLogger/gimp/\#buildstream/*html /home/supybot/logs/ChannelLogger/gimp/\#buildstream/*css /srv/irclogs.baserock.org/buildstream"
+
+[Install]
+WantedBy=multi-user.target
diff --git a/baserock_webserver/irclogs/irclogs-generation.timer b/baserock_webserver/irclogs/irclogs-generation.timer
new file mode 100644
index 00000000..c236c3d6
--- /dev/null
+++ b/baserock_webserver/irclogs/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_webserver/irclogs/supybot-baserock.conf b/baserock_webserver/irclogs/supybot-baserock.conf
new file mode 100644
index 00000000..2a73f6d5
--- /dev/null
+++ b/baserock_webserver/irclogs/supybot-baserock.conf
@@ -0,0 +1,190 @@
+supybot.nick: brlogger
+supybot.nick.alternates: %s` %s_
+supybot.ident: supybot
+supybot.user:
+supybot.networks: freenode gimp
+supybot.networks.freenode.password:
+supybot.networks.gimp.password:
+supybot.networks.freenode.servers: chat.freenode.com:6667
+supybot.networks.gimp.servers: irc.gimp.org:6667
+supybot.networks.freenode.channels: #automotive #baserock #cip #trustable
+supybot.networks.gimp.channels: #buildstream
+supybot.networks.freenode.channels.key:
+supybot.networks.gimp.channels.key:
+supybot.networks.freenode.ssl: False
+supybot.networks.gimp.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_webserver/irclogs/supybot.service b/baserock_webserver/irclogs/supybot.service
new file mode 100644
index 00000000..49720f70
--- /dev/null
+++ b/baserock_webserver/irclogs/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