forked from Nilkanth1999/sIRCd
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathConfig
executable file
·138 lines (95 loc) · 3.4 KB
/
Config
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
#!/usr/bin/env python
"""
Copyright 2014 Sam Dodrill <[email protected]>
edited by Craigory <[email protected]>
This software is under GPL.
"""
from os import system
import os
installloc = ("$HOME/ircd")
installloc2 = os.getenv("HOME")
def promptUser(prompt, default):
inp = raw_input("%s [%s]> " % (prompt, default))
if inp == "":
return default
else:
return inp
def promptYesNo(prompt, default=True):
inp = False if promptUser(prompt, "y") == "n" else True
return inp
configflags = ["./configure"]
art = """
_____ _____ _____ _
|_ _| __ \ / ____| | |
___ | | | |__) | | __| |
/ __| | | | _ /| | / _` |
\__ \_| |_| | \ \| |___| (_| |
|___/_____|_| \_\\_____\__, _|
v6
"""
welcome ="""
Welcome to the sIRCd Configuration script. This script will help you choose the
best compile flags for your installation of sIRCd, whilst install is restricted to /home/<username>/ircd
"""
print(art)
print(welcome)
print("")
print("Please specify the maximum nickname length. This must be the same across")
print("all servers in your network or you risk desyncs. The maximum is 50.")
nicklen = 100
while nicklen > 51:
if nicklen != 100:
print "Error: you must choose a value under 50."
nicklen = int(promptUser("Maximum nickname length?", "31"))
print("")
print("Please specify the maximum topic length. This must be the same across")
print("all servers in your network or you risk netsplits. The maximum is 780.")
topiclen = 800
while topiclen > 781:
if topiclen != 800:
print "Error: you must choose a value under 780."
topiclen = int(promptUser("Maximum topic length?", "390"))
print("")
print("Would you like to use SSL encryption for client and server links? (Recommended)")
usessl = promptYesNo("SSL? (y/n)")
print("")
print("Would you like to disable small network support? This increases the size")
print("of a few buffers in the code and can increase performance on large networks.")
smallnet = promptYesNo("Small network? (y/n)")
print("")
print("Would you like to enable IPv6 Support?")
IPv6 = promptYesNo("IPv6? (y/n)")
configflags.append("--prefix=%s" % installloc)
configflags.append("--with-nicklen=%s" % nicklen)
configflags.append("--with-topiclen=%s" % topiclen)
if usessl:
configflags.append("--enable-openssl")
else:
configflags.append("--disable-openssl")
if not smallnet:
configflags.append("--enable-small-net")
else:
configflags.append("--disable-small-net")
if IPv6:
configflags.append("--enable-ipv6")
else:
configflags.append("")
print("\nThat should be it for now. Running %s" % " ".join(configflags))
print("")
print("")
print("")
raw_input("Press enter to install sIRCd...")
system(" ".join(configflags))
system("clear")
print(art)
print("""
Next, run make and make install. Then copy %s/ircd/etc/example.conf to
%s/ircd/etc/ircd.conf and read through the example configuration completely to make
sure your install is tailored to your needs. After that, run %s/ircd/bin/ircd
and start to connect clients and servers as you need.
If you have any problems, please check the documentation in the doc/ folder
of the source repository. If problems persist please stop by #sIRCd
on irc.letstalkcoding.net and ask. Running sIRCd on large networks is not
recommended (Not sure how stable it is).""" %\
(installloc2, installloc2, installloc2))
# vim: set ts=4 sw=4 tw=0 et