index.php 8.5 KB

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