-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.php
346 lines (345 loc) · 8.53 KB
/
index.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
<?php
header('Content-type: text/plain');
require_once('header.php');
if(!isset($_GET['user']) || !isset($_GET['key']) || !isset($_GET['server'])){
$opts = getopt('u:k:s:',Array('user:','key:','server:'));
$_GET['user'] = isset($opts['user'])?$opts['user']:(isset($opts['u'])?$opts['u']:false);
$_GET['key'] = isset($opts['key'])?$opts['key']:(isset($opts['k'])?$opts['k']:false);
$_GET['server'] = isset($opts['server'])?$opts['server']:(isset($opts['s'])?$opts['s']:false);
if(!$_GET['user'] || !$_GET['key'] || !$_GET['server']){
header('Location: site/');
die();
}
}
$user = get_current_user_obj('netadmin') or $user = get_current_user_obj('servermanager') or $user = get_current_user_obj('globaladmin') or die('# Invalid user/key pair.');
$server = get_current_server_obj() or die('# Invalid server name');;
$opers = get_opers_for_server_obj($server['id']);
$pass = mkpasswd(get_conf('server-pass'));
?>
#################################################
## Classes ##
#################################################
class clients
{
pingfreq 120;
maxclients 500;
sendq 100000;
recvq 8000;
};
class servers
{
pingfreq 120;
maxclients 11;
sendq 1000000;
connfreq 100;
};
#################################################
## Me ##
#################################################
me {
name "<?php echo $server['host'];?>";
info "<?php echo $server['description'];?>";
numeric <?php echo $server['id'];?>;
};
#################################################
## Admin ##
#################################################
admin {
"<?php echo $user['real_name'];?>";
"<?php echo $user['nick'];?>";
"<?php echo $user['email'];?>";
};
#################################################
## Listeners ##
#################################################
listen *:6697
{
options
{
ssl;
clientsonly;
};
};
listen *:8067;
listen *:6667;
listen *:6666;
listen *:6665;
listen *:7150
{
options
{
serversonly;
};
};
listen *:7100
{
options
{
ssl;
serversonly;
};
};
#################################################
## Link ##
#################################################
<?php
$ulines = get_ulines_obj();
foreach($ulines as $k => $u){?>
link <?php echo $u['host'];?> {
username *;
hostname *;
bind-ip *;
hub *;
port 7150;
password-receive "<?php echo $pass ?>" { sha1; };
password-connect "<?php echo get_conf('server-pass'); ?>";
class servers;
};
<?php
}
if(!is_null($server['parent'])){?>
link <?php echo $server['parent']['host'];?> {
username *;
hostname <?php echo $server['parent']['ip'];?>;
bind-ip *;
hub *;
port 7100;
password-receive "<?php echo $pass ?>" { sha1; };
password-connect "<?php echo get_conf('server-pass'); ?>";
class servers;
options
{
zip;
ssl;
autoconnect;
nodnscache;
nohostcheck;
};
};
<?php
}
if(isset($server['children'])){
foreach($server['children'] as $k => $c){?>
link <?php echo $c['host'];?> {
username *;
hostname <?php echo $c['ip'];?>;
bind-ip *;
hub *;
port 7100;
password-receive "<?php echo $pass ?>" { sha1; };
password-connect "<?php echo get_conf('server-pass'); ?>";
class servers;
options
{
zip;
ssl;
autoconnect;
nodnscache;
nohostcheck;
};
};
<?php }
}
?>
ulines {
<?php
$ulines = get_ulines();
foreach($ulines as $k => $uline){
echo $uline.";\n";
if($k < count($ulines)-1){
echo "\t";
}
}
?>
};
#################################################
## Log ##
#################################################
log "ircd.log" {
flags {
oper;
kline;
connects;
server-connects;
kills;
errors;
sadmin-commands;
chg-commands;
oper-override;
spamfilter;
};
};
#################################################
## Alias ##
#################################################
alias "glinebot" {
format ".+" {
command "gline";
type real;
parameters "%1 2d Bots are not allowed on this server, please read the faq at http://www.example.com/faq/123";
};
type command;
};
alias statserv { type stats; };
alias ss { target statserv; type stats; };
#################################################
## DRPass ##
#################################################
drpass {
restart "<?php echo $pass ?>" { sha1; };
die "<?php echo $pass ?>" { sha1; };
};
#################################################
## Network Settings ##
#################################################
set {
network-name "omnimaga.org";
default-server "irc.omnimaga.org";
services-server "<?php echo get_conf('services-server','string'); ?>";
stats-server "<?php echo get_conf('stats-server','string'); ?>";
help-channel "#omnimaga";
hiddenhost-prefix "omni";
cloak-keys {
"XFGasdgREWhgreTG43FDSfweqfew";
"FDSAyh5ghREFadhrGHrewGQEg324";
"ASGfdah4431fgdsagdsagASgrw32";
};
hosts {
local "local.users.irc.omnimaga.org";
global "global.users.irc.omnimaga.org";
coadmin "coadmin.users.irc.omnimaga.org";
admin "admin.users.irc.omnimaga.org";
servicesadmin "servicesadmin.users.irc.omnimaga.org";
netadmin "netadmin.users.irc.omnimaga.org";
host-on-oper-up "yes";
};
modes-on-join "+nt";
kline-address "[email protected]";
modes-on-connect "+G";
modes-on-oper "+wgs";
oper-auto-join "<?php echo get_conf('ops-channel','string'); ?>";
options {
hide-ulines;
show-connect-info;
};
maxchannelsperuser 50;
anti-spam-quit-message-time 10s;
oper-only-stats "okfGsMRUEelLCXzdD";
throttle {
connections 3;
period 60s;
};
anti-flood {
nick-flood 3:60;
};
spamfilter {
ban-time 1d;
ban-reason "Spam/Advertising";
virus-help-channel "#help";
};
};
#################################################
## Enable Mibbit ##
#################################################
// Datacenter one:
cgiirc {
type webirc;
hostname 64.62.228.82;
password <?php echo get_conf('mibbit-password','string'); ?>;
};
// Datacenter two:
cgiirc {
type webirc;
hostname 207.192.75.252;
password <?php echo get_conf('mibbit-password','string'); ?>;
};
// Datacenter three:
cgiirc {
type webirc;
hostname 78.129.202.38;
password <?php echo get_conf('mibbit-password','string'); ?>;
};
// Datacenter four:
cgiirc {
type webirc;
hostname 109.169.29.95;
password <?php echo get_conf('mibbit-password','string'); ?>;
};
#################################################
## Allow ##
#################################################
allow {
ip *@*;
hostname *@*;
class clients;
maxperip 10;
};
#################################################
## Deny ##
#################################################
deny dcc {
filename "*sub7*";
reason "Possible Sub7 Virus";
};
#################################################
## Bans ##
#################################################
ban nick {
mask "*C*h*a*n*S*e*r*v*";
reason "Reserved for Services";
};
#################################################
## Localization ##
#################################################
files {
motd "motd/en.txt";
rules "rules/en.txt";
};
tld {
mask *@*.ca;
motd "motd/en_CA.txt";
rules "rules/en_CA.txt";
};
tld {
mask *@*.com;
motd "motd/en_US.txt";
rules "rules/en_US.txt";
};
tld {
mask *@*.fr;
motd "motd/fr.txt";
rules "rules/fr.txt";
};
#################################################
## Opers ##
#################################################
oper RehashServ {
class clients;
from {
userhost RehashServ@localhost;
userhost <?php echo get_conf('services-server'); ?>;
userhost <?php echo get_conf('stats-server'); ?>;
userhost <?php echo get_conf('irc-server'); ?>;
userhost <?php echo get_conf('rehash-host'); ?>;
};
password "<?php echo mkpasswd(get_conf('rehash-pass')); ?>" { sha1; };
flags {
can_rehash;
netadmin;
};
};
<?php foreach($opers as $k => $oper){?>
oper <?php echo $oper['nick'];?> {
class clients;
from {
<?php foreach($oper['hosts'] as $k => $host){?>
userhost <?php echo $host;?>;
<?php } ?>
};
password "<?php echo $oper['password'];?>" { <?php echo $oper['password_type'];?>; };
flags {
<?php echo $oper['flags'];?>
};
swhois "<?php echo $oper['swhois'];?>";
};
<?php }?>