summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBart Verwilst <verwilst@gentoo.org>2001-12-16 18:02:34 +0000
committerBart Verwilst <verwilst@gentoo.org>2001-12-16 18:02:34 +0000
commit26a2203d0c06b3e8876c82e748365e28b3cc9277 (patch)
tree145fbe7250bff0e30e82a063bc4ee80851a44255 /net-im/jabber-server
parentdisabled gnome-print support due to compile problem (diff)
downloadhistorical-26a2203d0c06b3e8876c82e748365e28b3cc9277.tar.gz
historical-26a2203d0c06b3e8876c82e748365e28b3cc9277.tar.bz2
historical-26a2203d0c06b3e8876c82e748365e28b3cc9277.zip
Server Setup Tool upgraded to version 0.4 ..
Diffstat (limited to 'net-im/jabber-server')
-rw-r--r--net-im/jabber-server/files/ServSetup20
-rw-r--r--net-im/jabber-server/files/SetupEngine.py173
-rw-r--r--net-im/jabber-server/files/WriteEngine.py122
3 files changed, 298 insertions, 17 deletions
diff --git a/net-im/jabber-server/files/ServSetup b/net-im/jabber-server/files/ServSetup
index c35d64a507cb..06395f64b2b8 100644
--- a/net-im/jabber-server/files/ServSetup
+++ b/net-im/jabber-server/files/ServSetup
@@ -11,7 +11,7 @@ from SetupEngine import *
from WriteEngine import *
print " "
-print "Gentoo Jabber Server 1.4.1 Configuration Utility (version 0.2)"
+print "Gentoo Jabber Server 1.4.1 Configuration Utility (version 0.4)"
print " "
ShowIntro()
@@ -20,16 +20,22 @@ while Init == 1:
CmdInput = raw_input("Enter your choice: ")
if CmdInput == "1":
SetupGeneral()
- elif CmdInput == "2":
+ elif CmdInput == "2":
JUDConfig()
elif CmdInput == "3":
+ CONConfig()
+ elif CmdInput == "4":
AIMConfig()
- elif CmdInput == "4":
- ICQConfig()
elif CmdInput == "5":
- MSNConfig()
+ ICQConfig()
elif CmdInput == "6":
- WriteConfig()
- Init = 0
+ MSNConfig()
elif CmdInput == "7":
+ YahooConfig()
+ elif CmdInput == "8":
+ SecurityConfig()
+ elif CmdInput == "9":
+ WriteConfig()
+ Init = 0
+ elif CmdInput == "0":
Init = 0
diff --git a/net-im/jabber-server/files/SetupEngine.py b/net-im/jabber-server/files/SetupEngine.py
index 0b0311bd2d41..0125215e951f 100644
--- a/net-im/jabber-server/files/SetupEngine.py
+++ b/net-im/jabber-server/files/SetupEngine.py
@@ -20,7 +20,54 @@ GeneralData['new_welcome'] = 0 ## 0 for no messages, 1 for messages ##
GeneralData['new_welcome_subject'] = ''
GeneralData['new_welcome_body'] = ''
GeneralData['vcard2jud'] = 0 ## 0 for no messages, 1 for messages ##
-#GeneralData[''] = ''
+
+global JUDData
+JUDData = {}
+
+## List all Attribs for JUDData ##
+JUDData['extra_jud'] = 0
+JUDData['jid'] = ''
+JUDData['name'] = ''
+
+global CONData
+CONData = {}
+
+## List all Attribs for CONData ##
+CONData['enable_con'] = 0
+CONData['jid'] = ''
+CONData['name'] = ''
+
+global AIMData
+AIMData = {}
+
+## List all Attribs for AIMData ##
+AIMData['enable_aim'] = 0
+AIMData['jid'] = ''
+AIMData['name'] = ''
+
+global ICQData
+ICQData = {}
+
+## List all Attribs for ICQData ##
+ICQData['enable_icq'] = 0
+ICQData['jid'] = ''
+ICQData['name'] = ''
+
+global MSNData
+MSNData = {}
+
+## List all Attribs for MSNData ##
+MSNData['enable_msn'] = 0
+MSNData['jid'] = ''
+MSNData['name'] = ''
+
+global YahooData
+YahooData = {}
+
+## List all Attribs for MSNData ##
+YahooData['enable_yahoo'] = 0
+YahooData['jid'] = ''
+YahooData['name'] = ''
def ShowIntro():
@@ -28,11 +75,14 @@ def ShowIntro():
print " Choose one of the following options: "
print " [1] General Server Configuration "
print " [2] JUD Configuration "
- print " [3] AIM Transport Configuration "
- print " [4] ICQ Transport Configuration "
- print " [5] MSN Transport Configuration "
- print " [6] Write Configuration File "
- print " [7] Quit "
+ print " [3] Conference Configuration "
+ print " [4] AIM Transport Configuration "
+ print " [5] ICQ Transport Configuration "
+ print " [6] MSN Transport Configuration "
+ print " [7] Yahoo! Transport Configuration "
+ print " [8] Server Security Configuration "
+ print " [9] Write Configuration File "
+ print " [0] Quit "
print " "
def SetupGeneral():
@@ -75,12 +125,115 @@ def SetupGeneral():
print " "
ShowIntro()
+
def JUDConfig():
- pass
+ print " "
+ print "<---| Jabber User Directory Configuration |--------------------------------->"
+
+ a = raw_input(" Do you want to add a second JUD (eg. Intranet JUD?) ([yes]|no):\n # ")
+ if a == "yes" or a == "ye" or a == "y" or a == "":
+ JUDData['extra_jud'] = 1
+ JUDData['jid'] = raw_input(" Enter JabberID for server (eg. users.foo.bar):\n # ")
+ JUDData['name'] = raw_input(" Enter Name for server (eg. My Intranet JUD):\n # ")
+ else:
+ print " * No extra JUD will be configured *"
+ JUDData['extra_jud'] = 0
+
+ print " "
+ print " *** JUD Configuration Finished SuccessFully! ***"
+ print " "
+ ShowIntro()
+
+def CONConfig():
+ print " "
+ print "<---| Conference Configuration |--------------------------------->"
+ a = raw_input(" Do you want to enable Conferencing on your server? ([yes]|no):\n # ")
+ if a == "yes" or a == "ye" or a == "y" or a == "":
+ CONData['enable_con'] = 1
+ CONData['jid'] = raw_input(" Enter Prefix for the Conference Host (default: conference):\n # ")
+ CONData['name'] = raw_input(" Enter Name for Conference Transport (eg. My Own Conf. Transport):\n # ")
+ else:
+ print " * No extra JUD will be configured *"
+ CONData['extra_jud'] = 0
+
+ print " "
+ print " *** Conference Configuration Finished SuccessFully! ***"
+ print " "
+ ShowIntro()
+
def AIMConfig():
- pass
+ print " "
+ print "<---| AIM Transport Configuration |--------------------------------->"
+ a = raw_input(" Do you want to enable the AIM Transport on your server? ([yes]|no):\n # ")
+ if a == "yes" or a == "ye" or a == "y" or a == "":
+ AIMData['enable_aim'] = 1
+ AIMData['jid'] = raw_input(" Enter Prefix for the AIM Host (default: aim):\n # ")
+ AIMData['name'] = raw_input(" Enter Name for AIM Transport (eg. My Own AIM Transport):\n # ")
+ else:
+ print " * AIM Transport will NOT be installed *"
+ AIMData['enable_aim'] = 0
+
+ print " "
+ print " *** AIM Transport Configuration Finished SuccessFully! ***"
+ print " "
+ ShowIntro()
+
def ICQConfig():
- pass
+ print " "
+ print "<---| ICQ Transport Configuration |--------------------------------->"
+ a = raw_input(" Do you want to enable the ICQ Transport on your server? ([yes]|no):\n # ")
+ if a == "yes" or a == "ye" or a == "y" or a == "":
+ ICQData['enable_icq'] = 1
+ ICQData['jid'] = raw_input(" Enter Prefix for the ICQ Host (default: icq):\n # ")
+ ICQData['name'] = raw_input(" Enter Name for ICQ Transport (eg. My Own ICQ Transport):\n # ")
+ else:
+ print " * ICQ Transport will NOT be installed *"
+ ICQData['enable_icq'] = 0
+
+ print " "
+ print " *** ICQ Transport Configuration Finished SuccessFully! ***"
+ print " "
+ ShowIntro()
+
def MSNConfig():
- pass
+ print " "
+ print "<---| MSN Transport Configuration |--------------------------------->"
+ a = raw_input(" Do you want to enable the MSN Transport on your server? ([yes]|no):\n # ")
+ if a == "yes" or a == "ye" or a == "y" or a == "":
+ MSNData['enable_msn'] = 1
+ MSNData['jid'] = raw_input(" Enter Prefix for the MSN Host (default: msn):\n # ")
+ MSNData['name'] = raw_input(" Enter Name for MSN Transport (eg. My Own MSN Transport):\n # ")
+ else:
+ print " * MSN Transport will NOT be installed *"
+ MSNData['enable_msn'] = 0
+
+ print " "
+ print " *** MSN Transport Configuration Finished SuccessFully! ***"
+ print " "
+ ShowIntro()
+
+def YahooConfig():
+ print " "
+ print "<---| Yahoo! Transport Configuration |--------------------------------->"
+ a = raw_input(" Do you want to enable the Yahoo! Transport on your server? ([yes]|no):\n # ")
+ if a == "yes" or a == "ye" or a == "y" or a == "":
+ YahooData['enable_yahoo'] = 1
+ YahooData['jid'] = raw_input(" Enter Prefix for the Yahoo! Host (default: msn):\n # ")
+ YahooData['name'] = raw_input(" Enter Name for Yahoo! Transport (eg. My Own Yahoo! Transport):\n # ")
+ else:
+ print " * Yahoo! Transport will NOT be installed *"
+ MSNData['enable_yahoo'] = 0
+ print " "
+ print " *** Yahoo! Transport Configuration Finished SuccessFully! ***"
+ print " "
+ ShowIntro()
+
+def SecurityConfig():
+ print " "
+ print "<---| Server Security Configuration |--------------------------------->"
+
+ print " "
+ print " *** Server Security Configuration Finished SuccessFully! ***"
+ print " "
+ ShowIntro() \ No newline at end of file
diff --git a/net-im/jabber-server/files/WriteEngine.py b/net-im/jabber-server/files/WriteEngine.py
index 65019903a1f3..7f8e9779f895 100644
--- a/net-im/jabber-server/files/WriteEngine.py
+++ b/net-im/jabber-server/files/WriteEngine.py
@@ -30,10 +30,117 @@ def WriteConfig():
vcard2jud = """
<vcard2jud/>"""
+ if JUDData['extra_jud'] == 1:
+ extra_jud_1 = """
+ <service type="jud" jid=\"""" + JUDData['jid'] + """\" name=\"""" + JUDData['name'] + """\">
+ <ns>jabber:iq:search</ns>
+ <ns>jabber:iq:register</ns>
+ </service>"""
+ extra_jud_2 = """<service id="jud"> <host>jud.""" + GeneralData['domainname'] + """</host>
+ <load><jud>./jud-0.4/jud.so</jud></load>
+ <jud xmlns="jabber:config:jud">
+ <vCard>
+ <FN>User Directory on """ + GeneralData['domainname'] + """</FN>
+ <DESC>This service provides a simple user directory service.</DESC>
+ <URL>""" + GeneralData['vcard_url'] + """</URL>
+ </vCard>
+ </jud>
+ </service>
+ """
+ else:
+ extra_jud_1 = " "
+ extra_jud_2 = " "
+
+ if CONData['enable_con'] == 1:
+ enable_con_1 = "\n<conference type=\"private\" jid=\"" + CONData['jid'] + "\" name=\"" + CONData['name'] + """\"/>"""
+ enable_con_2 = "\n<service id=\"" + CONData['jid'] + "." + GeneralData['domainname'] + "\">" + """
+ <load><conference>./conference-0.4/conference.so</conference></load>
+ <conference xmlns="jabber:config:conference">
+ <vCard>
+ <FN>Conferencing Service</FN>
+ <DESC>This service is for private chatrooms.</DESC>
+ <URL>""" + GeneralData['vcard_url'] + """</URL>
+ </vCard>
+ <history>20</history>
+ <notice>
+ <join> has joined</join>
+ <leave> has left</leave>
+ <rename> is now known as </rename>
+ </notice>
+ </conference>
+ </service>
+ """
+
+ else:
+ enable_con_1 = " "
+ enable_con_2 = " "
+
+
+ if AIMData['enable_aim'] == 1:
+ enable_aim_1 = """
+ <service type="aim" jid=\"""" + AIMData['jid'] + """\" name=\"""" + AIMData['name'] + """\">
+ <ns>jabber:iq:gateway</ns>
+ <ns>jabber:iq:search</ns>
+ <ns>jabber:iq:register</ns>
+ </service>"""
+ enable_aim_2 = "<service id=" + AIMData['jid'] + "." + GeneralData['domainname'] + """>
+ <aimtrans xmlns='jabber:config:aimtrans'>
+ <vCard>
+ <FN>AIM Transport</FN>
+ <DESC>The AIM Transport</DESC>
+ <URL>""" + GeneralData['vcard_url'] + """</URL>
+ </vCard>
+ </aimtrans>
+ <load>
+ <aim_transport>./aim-transport-0.9.24c/src/aimtrans.so</aim_transport>
+ </load>
+ </service>
+ """
+ else:
+ enable_aim_1 = " "
+ enable_aim_2 = " "
+
+
+ if ICQData['enable_icq'] == 1:
+ enable_icq_1 = """
+ <service type="icq" jid=\"""" + ICQData['jid'] + """\" name=\"""" + ICQData['name'] + """\">
+ <ns>jabber:iq:gateway</ns>
+ <ns>jabber:iq:search</ns>
+ <ns>jabber:iq:register</ns>
+ </service>"""
+ enable_icq_2 = "<service id=" + ICQData['jid'] + "." + GeneralData['domainname'] + """>
+ <!-- <aimtrans xmlns='jabber:config:aimtrans'> ?? -->
+ <icqtrans xmlns="jabber:config:icqtrans">
+ <instructions>Please enter your ICQ number (in the "username" field),
+ nickname, and password. Leave the "username" field blank
+ to create a new ICQ number.</instructions>
+ <search>Search for ICQ users</search>
+ <vCard>
+ <FN>ICQ Transport</FN>
+ <DESC>The ICQ Transport</DESC>
+ <URL>""" + GeneralData['vcard_url'] + """</URL>
+ </vCard>
+ <prime>37</prime>
+ <ports>
+ <min>2000</min>
+ <max>3000</max>
+ </ports>
+ </icqtrans>
+ <load>
+ <icqtrans>./aim-transport-0.9.24c/src/aimtrans.so</icqtrans>
+ </load>
+ </service>
+ """
+ else:
+ enable_icq_1 = " "
+ enable_icq_2 = " "
+
f = open('jabber.xml', 'w')
f.write("""
<jabber>
+ <!-- This Jabber Server Configuration File is built with Dr. JabServ,
+ the Jabber Config Tool... -->
<service id="sessions">
@@ -81,6 +188,19 @@ def WriteConfig():
</register>
""" + new_welcome + vcard2jud + """
+
+
+ <browse>
+
+ <service type="jud" jid="users.jabber.org" name="Jabber User Directory">
+ <ns>jabber:iq:search</ns>
+ <ns>jabber:iq:register</ns>
+ </service>
+ """ + extra_jud_1 + enable_con_1 + enable_aim_1 + enable_icq_1 + """
+
+ </browse>
+
+
</jsm>
<load main="jsm">
@@ -182,6 +302,8 @@ def WriteConfig():
</dialback>
</service>
+ """ + extra_jud_2 + enable_con_2 + enable_aim_2 + enable_icq_2 + """
+
<io>
<rate points="5" time="25"/>