| 1 |
## -*-ruby-*- vim: set filetype=ruby : |
| 2 |
## |
| 3 |
## Nadoka Sample resource file |
| 4 |
## $Id$ |
| 5 |
# |
| 6 |
# Copyright (c) 2004-2005 SASADA Koichi <ko1 at atdot.net> |
| 7 |
# |
| 8 |
# This program is free software with ABSOLUTELY NO WARRANTY. |
| 9 |
# You can re-distribute and/or modify this program under |
| 10 |
# the same terms of the Ruby's license. |
| 11 |
# |
| 12 |
# |
| 13 |
|
| 14 |
class NADOKA_Config < Nadoka::NDK_ConfigBase |
| 15 |
|
| 16 |
############################################### |
| 17 |
# System setting |
| 18 |
|
| 19 |
# Setting_name = 'IRCNet' |
| 20 |
# # If you don't specify Setting_name, |
| 21 |
# # system use rc file name as setting name |
| 22 |
# # if your rc file is "test.rc", setting name is "test" |
| 23 |
# # (remove last .rc) |
| 24 |
# |
| 25 |
|
| 26 |
# 0: quiet |
| 27 |
# 1: ch log only |
| 28 |
# 2: normal |
| 29 |
# 3: debug |
| 30 |
Loglevel = 2 |
| 31 |
|
| 32 |
|
| 33 |
############################################### |
| 34 |
# client server setting |
| 35 |
Client_server_port = 6667 # or nil (no listen) |
| 36 |
Client_server_host = nil # You can specify binding host(interface) |
| 37 |
Client_server_pass = 'NadokaPassWord' |
| 38 |
Client_server_acl = nil |
| 39 |
Client_server_ssl_cert_file = nil |
| 40 |
Client_server_ssl_key_file = nil |
| 41 |
|
| 42 |
# ACL(Access Control List) example: |
| 43 |
# Client_server_acl = %q{ |
| 44 |
# deny all |
| 45 |
# allow 192.168.1.1 |
| 46 |
# allow 192.168.2.0/24 |
| 47 |
# } # ACL setting must be String |
| 48 |
# |
| 49 |
# or you can set acl directly like follows: |
| 50 |
# |
| 51 |
# ACL_Object = ::ACL.new(...) |
| 52 |
|
| 53 |
# Create a self-signed SSL certificate: |
| 54 |
# $ openssl req -new -days 365 -x509 -nodes -out cert.pem -keyout key.pem |
| 55 |
# |
| 56 |
# And specify cert files: |
| 57 |
# Client_server_ssl_cert_file = 'cert.pem' |
| 58 |
# Client_server_ssl_key_file = 'key.pem' |
| 59 |
|
| 60 |
|
| 61 |
############################################### |
| 62 |
# server setting |
| 63 |
|
| 64 |
# IRCnet servers in Japan |
| 65 |
# see http://www.ircnet.ne.jp/servers.html |
| 66 |
Servers = [ |
| 67 |
{ :host => 'irc.ircnet.ne.jp', |
| 68 |
:port => 6667, # default: 6667 |
| 69 |
:pass => nil, # default: nil |
| 70 |
}, |
| 71 |
# { :host => 'irc.media.kyoto-u.ac.jp', |
| 72 |
# :port => (6660 .. 6669), |
| 73 |
# }, |
| 74 |
# { :host => 'irc.huie.hokudai.ac.jp', |
| 75 |
# without :port, use 6667 as default port |
| 76 |
# }, |
| 77 |
# IPv6 Sample |
| 78 |
# { |
| 79 |
# :host => 'irc6.ircnet.ne.jp', |
| 80 |
# :port => 6667, |
| 81 |
# }, |
| 82 |
# { |
| 83 |
# :host => 'dh6.ircnet.ne.jp', |
| 84 |
# :port => (6660 .. 6669), |
| 85 |
# }, |
| 86 |
] |
| 87 |
|
| 88 |
#Servers = [ |
| 89 |
# SSL Sample |
| 90 |
# { |
| 91 |
# :host => 'ircs.example.net', |
| 92 |
# :port => 6697, |
| 93 |
# :ssl_params => { # with :ssl_params hash, use ssl |
| 94 |
# # :ca_cert => "/etc/ssl/certs", # default: openssl's default certificates |
| 95 |
# }, |
| 96 |
# }, |
| 97 |
#] |
| 98 |
|
| 99 |
|
| 100 |
############################################### |
| 101 |
# userinfo |
| 102 |
User = ENV['USER'] || ENV['USERNAME'] || 'nadokatest' |
| 103 |
Nick = ENV['USER'] || ENV['USERNAME'] || 'ndk_nick' |
| 104 |
Hostname = Socket.gethostname |
| 105 |
Realname = 'nadoka user' |
| 106 |
Mode = nil |
| 107 |
|
| 108 |
Away_Message = 'away' |
| 109 |
|
| 110 |
# If this item is String, your nick will |
| 111 |
# be that when no clients are connected. |
| 112 |
Away_Nick = nil |
| 113 |
|
| 114 |
# Quit_Message = "Quit Nadoka" |
| 115 |
|
| 116 |
|
| 117 |
############################################### |
| 118 |
# channel info |
| 119 |
|
| 120 |
# log filename format |
| 121 |
# ${setting_name} : Setting name |
| 122 |
# ${channel_name} : Channel name |
| 123 |
# %? : Time#strftime format(see ruby reference) |
| 124 |
# |
| 125 |
|
| 126 |
|
| 127 |
Default_log = { |
| 128 |
:file => '${setting_name}-${channel_name}/%y%m%d.log', |
| 129 |
:time_format => '%H:%M:%S', |
| 130 |
:message_format => { |
| 131 |
'PRIVMSG' => '<{nick}> {msg}', |
| 132 |
'NOTICE' => '{{nick}} {msg}', |
| 133 |
'JOIN' => '+ {nick} ({prefix:user}@{prefix:host})', |
| 134 |
'NICK' => '* {nick} -> {newnick}', |
| 135 |
'QUIT' => '- {nick} (QUIT: {msg}) ({prefix:user}@{prefix:host})', |
| 136 |
'PART' => '- {nick} (PART: {msg}) ({prefix:user}@{prefix:host})', |
| 137 |
'KICK' => '- {nick} was kicked by {kicker} ({msg})', |
| 138 |
'MODE' => '* {nick} changed mode ({msg})', |
| 139 |
'TOPIC' => '* TOPIC: {msg} (by {nick})', |
| 140 |
'SYSTEM' => '[NDK] {orig}', |
| 141 |
'OTHER' => '{orig}', |
| 142 |
'SIMPLE' => '{orig}', |
| 143 |
}, |
| 144 |
} |
| 145 |
|
| 146 |
System_log = { |
| 147 |
:file => '${setting_name}-system.log', |
| 148 |
:time_format => '%y/%m/%d-%H:%M:%S', |
| 149 |
:message_format => { |
| 150 |
'PRIVMSG' => '{ch} <{nick}> {msg}', |
| 151 |
'NOTICE' => '{ch} {{nick}} {msg}', |
| 152 |
'JOIN' => '{ch} + {nick} ({prefix:user}@{prefix:host})', |
| 153 |
'NICK' => '{ch} * {nick} -> {newnick}', |
| 154 |
'QUIT' => '{ch} - {nick} (QUIT: {msg}) ({prefix:user}@{prefix:host})', |
| 155 |
'PART' => '{ch} - {nick} (PART: {msg}) ({prefix:user}@{prefix:host})', |
| 156 |
'KICK' => '{ch} - {nick} was kicked by {kicker} ({msg})', |
| 157 |
'MODE' => '{ch} * {nick} changed mode ({msg})', |
| 158 |
'TOPIC' => '{ch} * TOPIC: {msg} (by {nick})', |
| 159 |
'SYSTEM' => '[NDK] {orig}', |
| 160 |
'OTHER' => nil, |
| 161 |
'SIMPLE' => nil, |
| 162 |
}, |
| 163 |
} |
| 164 |
|
| 165 |
Talk_log = { |
| 166 |
:file => '${setting_name}-talk/%y%m%d.log', |
| 167 |
:time_format => Default_log[:time_format], |
| 168 |
:message_format => { |
| 169 |
'PRIVMSG' => '[{sender} => {receiver}] {msg}', |
| 170 |
'NOTICE' => '{{sender} => {receiver}} {msg}', |
| 171 |
} |
| 172 |
} |
| 173 |
|
| 174 |
Channel_info = { |
| 175 |
# nadoka talk (from Japanese server only) |
| 176 |
'#nadoka' => { |
| 177 |
# timing |
| 178 |
# :startup / when nadoka start up <= default |
| 179 |
# :login / when user login |
| 180 |
# otherwise nadoka won't login automatically |
| 181 |
:timing => :startup, |
| 182 |
:log => '${setting_name}-nadoka-chan/%y%m%d.log', |
| 183 |
# :part_message => "bye bye" |
| 184 |
# :initial_mode => "+s" |
| 185 |
}, |
| 186 |
'#nadoka:*.jp' => { |
| 187 |
:timing => :startup, |
| 188 |
:log => '${setting_name}-nadoka-chan-jp/%y%m%d.log', |
| 189 |
}, |
| 190 |
|
| 191 |
# nadoka bot channel |
| 192 |
'#nadoka_check' => { |
| 193 |
:timing => :startup, |
| 194 |
:log => '${setting_name}-nadoka-check/%y%m%d.log', |
| 195 |
# you can specify store backlog lines |
| 196 |
:backlog_lines => 5, |
| 197 |
}, |
| 198 |
|
| 199 |
# |
| 200 |
# '#log_setting_example' => { |
| 201 |
# :log => { |
| 202 |
# :file => 'logfilename', # log filename |
| 203 |
# # :io => $stderr, # or IO object is supported |
| 204 |
# :time_format => '%H:%M:%S', |
| 205 |
# # :channel_name_in_file_name => 'hoge' |
| 206 |
# |
| 207 |
# :message_format => { |
| 208 |
# 'PRIVMSG' => '<{nick}> {msg}', |
| 209 |
# 'NOTICE' => '{{nick}} {msg}', |
| 210 |
# 'JOIN' => '+ {nick} to {ch}', |
| 211 |
# 'NICK' => '* {nick} -> {newnick}', |
| 212 |
# 'QUIT' => '- {nick} ({msg})', |
| 213 |
# 'PART' => '- {nick} from {ch} ({msg})', |
| 214 |
# 'KICK' => '- {nick} kicked by {kicker} ({msg}) from {ch}', |
| 215 |
# 'MODE' => '* {nick} changed mode ({msg})', |
| 216 |
# 'TOPIC' => '<{ch} TOPIC> {msg}', |
| 217 |
# 'SYSTEM' => '[NDK] {msg}', |
| 218 |
# 'OTHER' => nil, |
| 219 |
# 'SIMPLE' => nil, |
| 220 |
# |
| 221 |
# # for more complex log output: |
| 222 |
# # :logwriterclass => your_log_writer_class, |
| 223 |
# # :logwriter => your_log_writer_instance, |
| 224 |
# # :other_logwriterclass_specific_setting => ..., |
| 225 |
# }, |
| 226 |
# }, |
| 227 |
} |
| 228 |
|
| 229 |
BackLog_Lines = 20 |
| 230 |
|
| 231 |
# |
| 232 |
# FilenameEncoding = 'euc' |
| 233 |
# FilenameEncoding = 'sjis' |
| 234 |
# FilenameEncoding = 'utf8' |
| 235 |
# |
| 236 |
# If you not specify FilenameEncoding, nadoka infers |
| 237 |
# suitable encoding (see ndk/config.rb). |
| 238 |
# |
| 239 |
|
| 240 |
############################################### |
| 241 |
# Directory |
| 242 |
Log_dir = './log' |
| 243 |
|
| 244 |
#Plugins_dir = './plugins' |
| 245 |
Plugins_dir = Default_Plugins_dir |
| 246 |
# You can set Plugins_dir as Enumerable object. |
| 247 |
# ex: ['./dir1', './dir2', ...] |
| 248 |
|
| 249 |
|
| 250 |
############################################### |
| 251 |
# Bots |
| 252 |
BotConfig = [ |
| 253 |
# :BotName1, |
| 254 |
# :BotName1, |
| 255 |
# 'BotName1', |
| 256 |
# :BotName2, |
| 257 |
# { :name => :BotName3, |
| 258 |
# :set1 => setting1, |
| 259 |
# }, |
| 260 |
# { :name => :BotName3, |
| 261 |
# :set1 => setting2, |
| 262 |
# }, |
| 263 |
# { :name => :BotName4, |
| 264 |
# :set1 => setting3, |
| 265 |
# }, |
| 266 |
|
| 267 |
:BackLogBot, # strongly recommended |
| 268 |
] |
| 269 |
|
| 270 |
|
| 271 |
############################################### |
| 272 |
# Misc |
| 273 |
|
| 274 |
Privmsg_Filter = nil |
| 275 |
Notice_Filter = nil |
| 276 |
end |