-
-
Notifications
You must be signed in to change notification settings - Fork 56
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ad3c3ac
commit f8e5826
Showing
4 changed files
with
92 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
# class: irc::cvtbot | ||
class irc::cvtbot { | ||
$install_path = '/srv/cvtbot' | ||
|
||
# FIXME: should be cvtbot, using relaybot for now | ||
$irc_password = lookup('passwords::irc::relaybot::irc_password') | ||
|
||
stdlib::ensure_packages('mono-complete') | ||
|
||
file { $install_path: | ||
ensure => 'directory', | ||
owner => 'irc', | ||
group => 'irc', | ||
mode => '0644', | ||
recurse => true, | ||
max_files => 1500, | ||
} | ||
|
||
git::clone { 'CVTBot': | ||
ensure => present, | ||
origin => 'https://github.com/Universal-Omega/CVTBot', | ||
directory => $install_path, | ||
owner => 'irc', | ||
group => 'irc', | ||
mode => '0644', | ||
require => File[$install_path], | ||
} | ||
|
||
file { [ | ||
"${install_path}/src/CVTBot.ini", | ||
"${install_path}/src/CVTBot-sample.ini" | ||
]: | ||
ensure => present, | ||
owner => 'root', | ||
group => 'root', | ||
mode => '0644', | ||
content => template('irc/cvtbot/CVTBot.ini.erb'), | ||
require => Git::Clone['CVTBot'], | ||
notify => Service['cvtbot'], | ||
} | ||
|
||
systemd::service { 'cvtbot': | ||
ensure => present, | ||
content => systemd_template('cvtbot'), | ||
restart => true, | ||
require => [ | ||
Git::Clone['CVTBot'], | ||
Package['mono-complete'], | ||
File["${install_path}/src/CVTBot.ini"], | ||
], | ||
} | ||
|
||
monitoring::nrpe { 'CVT Bot': | ||
command => '/usr/lib/nagios/plugins/check_procs -a cvtbot -c 2:2' | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# User | ||
botnick=MirahezeCVTBot | ||
readerbotnick=CVTBotReader | ||
botpass=<%= @irc_password %> | ||
botrealname=MirahezeCVTBot | ||
# Server | ||
ircserver=irc.libera.chat | ||
feedchannel=#miraheze-cvt-feed | ||
controlchannel=None | ||
broadcastchannel=#miraheze-cvt | ||
readerfeedchannel=#miraheze-feed | ||
# Project | ||
centralproject=metawiki | ||
projectsuffix=wiki | ||
projectdomain=miraheze.org | ||
interwikiprefix=mh: | ||
# Files | ||
lists=./Lists.sqlite | ||
messages=./Console.msgs | ||
projects=./Projects.xml | ||
# Feed |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
[Unit] | ||
Description=Miraheze IRC CVT bot | ||
|
||
[Service] | ||
Type=simple | ||
User=irc | ||
SyslogIdentifier=cvtbot | ||
ExecStart=/usr/bin/dotnet run --project <%= @install_path %>/src/CVTBot/CVTBot.csproj --configuration Release | ||
Restart=always | ||
WorkingDirectory=<%= @install_path %>/src/CVTBot/bin/Release | ||
Environment=HOME=<%= @install_path %>/src/CVTBot/bin/Release | ||
|
||
[Install] | ||
WantedBy=multi-user.target |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters