annotate roundup-server @ 561:13df980755fa

New tests for htmltemplate (well, it's a beginning)
author Richard Jones <richard@users.sourceforge.net>
date Mon, 21 Jan 2002 11:05:48 +0000
parents 18d4051bdae7
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
27
e5e9ea306a09 moving the bin files to facilitate out-of-the-boxness
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
1 #!/usr/bin/python
213
d45384bc6420 Added the copyright/license notice to (nearly) all files...
Richard Jones <richard@users.sourceforge.net>
parents: 204
diff changeset
2 #
d45384bc6420 Added the copyright/license notice to (nearly) all files...
Richard Jones <richard@users.sourceforge.net>
parents: 204
diff changeset
3 # Copyright (c) 2001 Bizar Software Pty Ltd (http://www.bizarsoftware.com.au/)
d45384bc6420 Added the copyright/license notice to (nearly) all files...
Richard Jones <richard@users.sourceforge.net>
parents: 204
diff changeset
4 # This module is free software, and you may redistribute it and/or modify
d45384bc6420 Added the copyright/license notice to (nearly) all files...
Richard Jones <richard@users.sourceforge.net>
parents: 204
diff changeset
5 # under the same terms as Python, so long as this copyright message and
d45384bc6420 Added the copyright/license notice to (nearly) all files...
Richard Jones <richard@users.sourceforge.net>
parents: 204
diff changeset
6 # disclaimer are retained in their original form.
d45384bc6420 Added the copyright/license notice to (nearly) all files...
Richard Jones <richard@users.sourceforge.net>
parents: 204
diff changeset
7 #
214
18134bffab37 stupid typo
Richard Jones <richard@users.sourceforge.net>
parents: 213
diff changeset
8 # IN NO EVENT SHALL BIZAR SOFTWARE PTY LTD BE LIABLE TO ANY PARTY FOR
213
d45384bc6420 Added the copyright/license notice to (nearly) all files...
Richard Jones <richard@users.sourceforge.net>
parents: 204
diff changeset
9 # DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING
d45384bc6420 Added the copyright/license notice to (nearly) all files...
Richard Jones <richard@users.sourceforge.net>
parents: 204
diff changeset
10 # OUT OF THE USE OF THIS CODE, EVEN IF THE AUTHOR HAS BEEN ADVISED OF THE
d45384bc6420 Added the copyright/license notice to (nearly) all files...
Richard Jones <richard@users.sourceforge.net>
parents: 204
diff changeset
11 # POSSIBILITY OF SUCH DAMAGE.
d45384bc6420 Added the copyright/license notice to (nearly) all files...
Richard Jones <richard@users.sourceforge.net>
parents: 204
diff changeset
12 #
d45384bc6420 Added the copyright/license notice to (nearly) all files...
Richard Jones <richard@users.sourceforge.net>
parents: 204
diff changeset
13 # BIZAR SOFTWARE PTY LTD SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING,
d45384bc6420 Added the copyright/license notice to (nearly) all files...
Richard Jones <richard@users.sourceforge.net>
parents: 204
diff changeset
14 # BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
d45384bc6420 Added the copyright/license notice to (nearly) all files...
Richard Jones <richard@users.sourceforge.net>
parents: 204
diff changeset
15 # FOR A PARTICULAR PURPOSE. THE CODE PROVIDED HEREUNDER IS ON AN "AS IS"
d45384bc6420 Added the copyright/license notice to (nearly) all files...
Richard Jones <richard@users.sourceforge.net>
parents: 204
diff changeset
16 # BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE,
d45384bc6420 Added the copyright/license notice to (nearly) all files...
Richard Jones <richard@users.sourceforge.net>
parents: 204
diff changeset
17 # SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
d45384bc6420 Added the copyright/license notice to (nearly) all files...
Richard Jones <richard@users.sourceforge.net>
parents: 204
diff changeset
18 #
27
e5e9ea306a09 moving the bin files to facilitate out-of-the-boxness
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
19 """ HTTP Server that serves roundup.
e5e9ea306a09 moving the bin files to facilitate out-of-the-boxness
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
20
486
Richard Jones <richard@users.sourceforge.net>
parents: 485
diff changeset
21 $Id: roundup-server,v 1.25 2002-01-05 02:21:21 richard Exp $
27
e5e9ea306a09 moving the bin files to facilitate out-of-the-boxness
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
22 """
449
141aacfdb34f Centralised the python version check code, bumped version to 2.1.1
Richard Jones <richard@users.sourceforge.net>
parents: 431
diff changeset
23
141aacfdb34f Centralised the python version check code, bumped version to 2.1.1
Richard Jones <richard@users.sourceforge.net>
parents: 431
diff changeset
24 # python version check
141aacfdb34f Centralised the python version check code, bumped version to 2.1.1
Richard Jones <richard@users.sourceforge.net>
parents: 431
diff changeset
25 from roundup import version_check
27
e5e9ea306a09 moving the bin files to facilitate out-of-the-boxness
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
26
456
5f3c5c3fd524 sys module went away...
Richard Jones <richard@users.sourceforge.net>
parents: 449
diff changeset
27 import sys, os, urllib, StringIO, traceback, cgi, binascii, getopt, imp
27
e5e9ea306a09 moving the bin files to facilitate out-of-the-boxness
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
28 import BaseHTTPServer
e5e9ea306a09 moving the bin files to facilitate out-of-the-boxness
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
29
e5e9ea306a09 moving the bin files to facilitate out-of-the-boxness
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
30 # Roundup modules of use here
e5e9ea306a09 moving the bin files to facilitate out-of-the-boxness
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
31 from roundup import cgitb, cgi_client
204
c1461733cbf9 Instances are now opened by a special function...
Richard Jones <richard@users.sourceforge.net>
parents: 193
diff changeset
32 import roundup.instance
485
fad315a10185 i18n'ification
Richard Jones <richard@users.sourceforge.net>
parents: 456
diff changeset
33 from roundup.i18n import _
27
e5e9ea306a09 moving the bin files to facilitate out-of-the-boxness
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
34
e5e9ea306a09 moving the bin files to facilitate out-of-the-boxness
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
35 #
e5e9ea306a09 moving the bin files to facilitate out-of-the-boxness
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
36 ## Configuration
e5e9ea306a09 moving the bin files to facilitate out-of-the-boxness
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
37 #
e5e9ea306a09 moving the bin files to facilitate out-of-the-boxness
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
38
e5e9ea306a09 moving the bin files to facilitate out-of-the-boxness
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
39 # This indicates where the Roundup instance lives
52
33bfce110d1e Fixed the ROUNDUPS decl in roundup-server
Richard Jones <richard@users.sourceforge.net>
parents: 32
diff changeset
40 ROUNDUP_INSTANCE_HOMES = {
54
b68bcb176d1a disabled the reloading until it can be done properly
Richard Jones <richard@users.sourceforge.net>
parents: 52
diff changeset
41 'bar': '/tmp/bar',
27
e5e9ea306a09 moving the bin files to facilitate out-of-the-boxness
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
42 }
e5e9ea306a09 moving the bin files to facilitate out-of-the-boxness
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
43
288
c2f287327ca8 server now handles setuid'ing much better
Richard Jones <richard@users.sourceforge.net>
parents: 264
diff changeset
44 ROUNDUP_USER = None
c2f287327ca8 server now handles setuid'ing much better
Richard Jones <richard@users.sourceforge.net>
parents: 264
diff changeset
45
c2f287327ca8 server now handles setuid'ing much better
Richard Jones <richard@users.sourceforge.net>
parents: 264
diff changeset
46
27
e5e9ea306a09 moving the bin files to facilitate out-of-the-boxness
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
47 # Where to log debugging information to. Use an instance of DevNull if you
e5e9ea306a09 moving the bin files to facilitate out-of-the-boxness
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
48 # don't want to log anywhere.
e5e9ea306a09 moving the bin files to facilitate out-of-the-boxness
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
49 # TODO: actually use this stuff
e5e9ea306a09 moving the bin files to facilitate out-of-the-boxness
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
50 #class DevNull:
e5e9ea306a09 moving the bin files to facilitate out-of-the-boxness
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
51 # def write(self, info):
e5e9ea306a09 moving the bin files to facilitate out-of-the-boxness
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
52 # pass
e5e9ea306a09 moving the bin files to facilitate out-of-the-boxness
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
53 #LOG = open('/var/log/roundup.cgi.log', 'a')
e5e9ea306a09 moving the bin files to facilitate out-of-the-boxness
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
54 #LOG = DevNull()
e5e9ea306a09 moving the bin files to facilitate out-of-the-boxness
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
55
e5e9ea306a09 moving the bin files to facilitate out-of-the-boxness
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
56 #
e5e9ea306a09 moving the bin files to facilitate out-of-the-boxness
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
57 ## end configuration
e5e9ea306a09 moving the bin files to facilitate out-of-the-boxness
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
58 #
e5e9ea306a09 moving the bin files to facilitate out-of-the-boxness
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
59
e5e9ea306a09 moving the bin files to facilitate out-of-the-boxness
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
60
343
ab16997d9cda Started work on supporting a pop3-fetching server
Richard Jones <richard@users.sourceforge.net>
parents: 336
diff changeset
61 class RoundupRequestHandler(BaseHTTPServer.BaseHTTPRequestHandler):
61
820c8bb1b71a Added command-line arg handling to roundup-server...
Richard Jones <richard@users.sourceforge.net>
parents: 54
diff changeset
62 ROUNDUP_INSTANCE_HOMES = ROUNDUP_INSTANCE_HOMES
288
c2f287327ca8 server now handles setuid'ing much better
Richard Jones <richard@users.sourceforge.net>
parents: 264
diff changeset
63 ROUNDUP_USER = ROUNDUP_USER
27
e5e9ea306a09 moving the bin files to facilitate out-of-the-boxness
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
64
e5e9ea306a09 moving the bin files to facilitate out-of-the-boxness
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
65 def run_cgi(self):
e5e9ea306a09 moving the bin files to facilitate out-of-the-boxness
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
66 """ Execute the CGI command. Wrap an innner call in an error
e5e9ea306a09 moving the bin files to facilitate out-of-the-boxness
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
67 handler so all errors can be caught.
e5e9ea306a09 moving the bin files to facilitate out-of-the-boxness
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
68 """
e5e9ea306a09 moving the bin files to facilitate out-of-the-boxness
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
69 save_stdin = sys.stdin
e5e9ea306a09 moving the bin files to facilitate out-of-the-boxness
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
70 sys.stdin = self.rfile
e5e9ea306a09 moving the bin files to facilitate out-of-the-boxness
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
71 try:
e5e9ea306a09 moving the bin files to facilitate out-of-the-boxness
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
72 self.inner_run_cgi()
264
a671e5917b33 Many features and fixes.
Richard Jones <richard@users.sourceforge.net>
parents: 252
diff changeset
73 except cgi_client.NotFound:
a671e5917b33 Many features and fixes.
Richard Jones <richard@users.sourceforge.net>
parents: 252
diff changeset
74 self.send_error(404, self.path)
27
e5e9ea306a09 moving the bin files to facilitate out-of-the-boxness
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
75 except cgi_client.Unauthorised:
431
a28a80b714f9 Eliminate database close method by using weakrefs.
Richard Jones <richard@users.sourceforge.net>
parents: 411
diff changeset
76 self.send_error(403, self.path)
27
e5e9ea306a09 moving the bin files to facilitate out-of-the-boxness
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
77 except:
431
a28a80b714f9 Eliminate database close method by using weakrefs.
Richard Jones <richard@users.sourceforge.net>
parents: 411
diff changeset
78 # it'd be nice to be able to detect if these are going to have
a28a80b714f9 Eliminate database close method by using weakrefs.
Richard Jones <richard@users.sourceforge.net>
parents: 411
diff changeset
79 # any effect...
a28a80b714f9 Eliminate database close method by using weakrefs.
Richard Jones <richard@users.sourceforge.net>
parents: 411
diff changeset
80 self.send_response(400)
a28a80b714f9 Eliminate database close method by using weakrefs.
Richard Jones <richard@users.sourceforge.net>
parents: 411
diff changeset
81 self.send_header('Content-Type', 'text/html')
a28a80b714f9 Eliminate database close method by using weakrefs.
Richard Jones <richard@users.sourceforge.net>
parents: 411
diff changeset
82 self.end_headers()
27
e5e9ea306a09 moving the bin files to facilitate out-of-the-boxness
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
83 try:
e5e9ea306a09 moving the bin files to facilitate out-of-the-boxness
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
84 reload(cgitb)
e5e9ea306a09 moving the bin files to facilitate out-of-the-boxness
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
85 self.wfile.write(cgitb.breaker())
e5e9ea306a09 moving the bin files to facilitate out-of-the-boxness
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
86 self.wfile.write(cgitb.html())
e5e9ea306a09 moving the bin files to facilitate out-of-the-boxness
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
87 except:
e5e9ea306a09 moving the bin files to facilitate out-of-the-boxness
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
88 self.wfile.write("<pre>")
e5e9ea306a09 moving the bin files to facilitate out-of-the-boxness
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
89 s = StringIO.StringIO()
e5e9ea306a09 moving the bin files to facilitate out-of-the-boxness
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
90 traceback.print_exc(None, s)
e5e9ea306a09 moving the bin files to facilitate out-of-the-boxness
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
91 self.wfile.write(cgi.escape(s.getvalue()))
e5e9ea306a09 moving the bin files to facilitate out-of-the-boxness
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
92 self.wfile.write("</pre>\n")
e5e9ea306a09 moving the bin files to facilitate out-of-the-boxness
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
93 sys.stdin = save_stdin
e5e9ea306a09 moving the bin files to facilitate out-of-the-boxness
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
94
343
ab16997d9cda Started work on supporting a pop3-fetching server
Richard Jones <richard@users.sourceforge.net>
parents: 336
diff changeset
95 do_GET = do_POST = do_HEAD = send_head = run_cgi
ab16997d9cda Started work on supporting a pop3-fetching server
Richard Jones <richard@users.sourceforge.net>
parents: 336
diff changeset
96
252
76c6994aa4e8 CGI interfaces now spit up a top-level index of all instances they can serve.
Richard Jones <richard@users.sourceforge.net>
parents: 214
diff changeset
97 def index(self):
76c6994aa4e8 CGI interfaces now spit up a top-level index of all instances they can serve.
Richard Jones <richard@users.sourceforge.net>
parents: 214
diff changeset
98 ''' Print up an index of the available instances
76c6994aa4e8 CGI interfaces now spit up a top-level index of all instances they can serve.
Richard Jones <richard@users.sourceforge.net>
parents: 214
diff changeset
99 '''
431
a28a80b714f9 Eliminate database close method by using weakrefs.
Richard Jones <richard@users.sourceforge.net>
parents: 411
diff changeset
100 self.send_response(200)
a28a80b714f9 Eliminate database close method by using weakrefs.
Richard Jones <richard@users.sourceforge.net>
parents: 411
diff changeset
101 self.send_header('Content-Type', 'text/html')
a28a80b714f9 Eliminate database close method by using weakrefs.
Richard Jones <richard@users.sourceforge.net>
parents: 411
diff changeset
102 self.end_headers()
252
76c6994aa4e8 CGI interfaces now spit up a top-level index of all instances they can serve.
Richard Jones <richard@users.sourceforge.net>
parents: 214
diff changeset
103 w = self.wfile.write
485
fad315a10185 i18n'ification
Richard Jones <richard@users.sourceforge.net>
parents: 456
diff changeset
104 w(_('<html><head><title>Roundup instances index</title></head>\n'))
fad315a10185 i18n'ification
Richard Jones <richard@users.sourceforge.net>
parents: 456
diff changeset
105 w(_('<body><h1>Roundup instances index</h1><ol>\n'))
252
76c6994aa4e8 CGI interfaces now spit up a top-level index of all instances they can serve.
Richard Jones <richard@users.sourceforge.net>
parents: 214
diff changeset
106 for instance in self.ROUNDUP_INSTANCE_HOMES.keys():
485
fad315a10185 i18n'ification
Richard Jones <richard@users.sourceforge.net>
parents: 456
diff changeset
107 w(_('<li><a href="%(instance_url)s/index">%(instance_name)s</a>\n')%{
fad315a10185 i18n'ification
Richard Jones <richard@users.sourceforge.net>
parents: 456
diff changeset
108 'instance_url': urllib.quote(instance),
fad315a10185 i18n'ification
Richard Jones <richard@users.sourceforge.net>
parents: 456
diff changeset
109 'instance_name': cgi.escape(instance)})
fad315a10185 i18n'ification
Richard Jones <richard@users.sourceforge.net>
parents: 456
diff changeset
110 w(_('</ol></body></html>'))
252
76c6994aa4e8 CGI interfaces now spit up a top-level index of all instances they can serve.
Richard Jones <richard@users.sourceforge.net>
parents: 214
diff changeset
111
27
e5e9ea306a09 moving the bin files to facilitate out-of-the-boxness
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
112 def inner_run_cgi(self):
e5e9ea306a09 moving the bin files to facilitate out-of-the-boxness
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
113 ''' This is the inner part of the CGI handling
e5e9ea306a09 moving the bin files to facilitate out-of-the-boxness
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
114 '''
e5e9ea306a09 moving the bin files to facilitate out-of-the-boxness
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
115
e5e9ea306a09 moving the bin files to facilitate out-of-the-boxness
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
116 rest = self.path
e5e9ea306a09 moving the bin files to facilitate out-of-the-boxness
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
117 i = rest.rfind('?')
e5e9ea306a09 moving the bin files to facilitate out-of-the-boxness
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
118 if i >= 0:
e5e9ea306a09 moving the bin files to facilitate out-of-the-boxness
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
119 rest, query = rest[:i], rest[i+1:]
e5e9ea306a09 moving the bin files to facilitate out-of-the-boxness
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
120 else:
e5e9ea306a09 moving the bin files to facilitate out-of-the-boxness
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
121 query = ''
e5e9ea306a09 moving the bin files to facilitate out-of-the-boxness
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
122
e5e9ea306a09 moving the bin files to facilitate out-of-the-boxness
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
123 # figure the instance
e5e9ea306a09 moving the bin files to facilitate out-of-the-boxness
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
124 if rest == '/':
252
76c6994aa4e8 CGI interfaces now spit up a top-level index of all instances they can serve.
Richard Jones <richard@users.sourceforge.net>
parents: 214
diff changeset
125 return self.index()
456
5f3c5c3fd524 sys module went away...
Richard Jones <richard@users.sourceforge.net>
parents: 449
diff changeset
126 l_path = rest.split('/')
264
a671e5917b33 Many features and fixes.
Richard Jones <richard@users.sourceforge.net>
parents: 252
diff changeset
127 instance_name = urllib.unquote(l_path[1])
a671e5917b33 Many features and fixes.
Richard Jones <richard@users.sourceforge.net>
parents: 252
diff changeset
128 if self.ROUNDUP_INSTANCE_HOMES.has_key(instance_name):
a671e5917b33 Many features and fixes.
Richard Jones <richard@users.sourceforge.net>
parents: 252
diff changeset
129 instance_home = self.ROUNDUP_INSTANCE_HOMES[instance_name]
204
c1461733cbf9 Instances are now opened by a special function...
Richard Jones <richard@users.sourceforge.net>
parents: 193
diff changeset
130 instance = roundup.instance.open(instance_home)
27
e5e9ea306a09 moving the bin files to facilitate out-of-the-boxness
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
131 else:
264
a671e5917b33 Many features and fixes.
Richard Jones <richard@users.sourceforge.net>
parents: 252
diff changeset
132 raise cgi_client.NotFound
27
e5e9ea306a09 moving the bin files to facilitate out-of-the-boxness
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
133
e5e9ea306a09 moving the bin files to facilitate out-of-the-boxness
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
134 # figure out what the rest of the path is
e5e9ea306a09 moving the bin files to facilitate out-of-the-boxness
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
135 if len(l_path) > 2:
e5e9ea306a09 moving the bin files to facilitate out-of-the-boxness
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
136 rest = '/'.join(l_path[2:])
e5e9ea306a09 moving the bin files to facilitate out-of-the-boxness
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
137 else:
e5e9ea306a09 moving the bin files to facilitate out-of-the-boxness
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
138 rest = '/'
e5e9ea306a09 moving the bin files to facilitate out-of-the-boxness
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
139
e5e9ea306a09 moving the bin files to facilitate out-of-the-boxness
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
140 # Set up the CGI environment
e5e9ea306a09 moving the bin files to facilitate out-of-the-boxness
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
141 env = {}
264
a671e5917b33 Many features and fixes.
Richard Jones <richard@users.sourceforge.net>
parents: 252
diff changeset
142 env['INSTANCE_NAME'] = instance_name
27
e5e9ea306a09 moving the bin files to facilitate out-of-the-boxness
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
143 env['REQUEST_METHOD'] = self.command
e5e9ea306a09 moving the bin files to facilitate out-of-the-boxness
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
144 env['PATH_INFO'] = urllib.unquote(rest)
e5e9ea306a09 moving the bin files to facilitate out-of-the-boxness
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
145 if query:
e5e9ea306a09 moving the bin files to facilitate out-of-the-boxness
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
146 env['QUERY_STRING'] = query
e5e9ea306a09 moving the bin files to facilitate out-of-the-boxness
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
147 host = self.address_string()
e5e9ea306a09 moving the bin files to facilitate out-of-the-boxness
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
148 if self.headers.typeheader is None:
e5e9ea306a09 moving the bin files to facilitate out-of-the-boxness
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
149 env['CONTENT_TYPE'] = self.headers.type
e5e9ea306a09 moving the bin files to facilitate out-of-the-boxness
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
150 else:
e5e9ea306a09 moving the bin files to facilitate out-of-the-boxness
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
151 env['CONTENT_TYPE'] = self.headers.typeheader
e5e9ea306a09 moving the bin files to facilitate out-of-the-boxness
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
152 length = self.headers.getheader('content-length')
e5e9ea306a09 moving the bin files to facilitate out-of-the-boxness
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
153 if length:
e5e9ea306a09 moving the bin files to facilitate out-of-the-boxness
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
154 env['CONTENT_LENGTH'] = length
e5e9ea306a09 moving the bin files to facilitate out-of-the-boxness
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
155 co = filter(None, self.headers.getheaders('cookie'))
e5e9ea306a09 moving the bin files to facilitate out-of-the-boxness
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
156 if co:
e5e9ea306a09 moving the bin files to facilitate out-of-the-boxness
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
157 env['HTTP_COOKIE'] = ', '.join(co)
e5e9ea306a09 moving the bin files to facilitate out-of-the-boxness
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
158 env['SCRIPT_NAME'] = ''
e5e9ea306a09 moving the bin files to facilitate out-of-the-boxness
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
159 env['SERVER_NAME'] = self.server.server_name
e5e9ea306a09 moving the bin files to facilitate out-of-the-boxness
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
160 env['SERVER_PORT'] = str(self.server.server_port)
e5e9ea306a09 moving the bin files to facilitate out-of-the-boxness
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
161
e5e9ea306a09 moving the bin files to facilitate out-of-the-boxness
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
162 decoded_query = query.replace('+', ' ')
e5e9ea306a09 moving the bin files to facilitate out-of-the-boxness
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
163
e5e9ea306a09 moving the bin files to facilitate out-of-the-boxness
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
164 # do the roundup thang
343
ab16997d9cda Started work on supporting a pop3-fetching server
Richard Jones <richard@users.sourceforge.net>
parents: 336
diff changeset
165 client = instance.Client(instance, self, env)
27
e5e9ea306a09 moving the bin files to facilitate out-of-the-boxness
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
166 client.main()
264
a671e5917b33 Many features and fixes.
Richard Jones <richard@users.sourceforge.net>
parents: 252
diff changeset
167
61
820c8bb1b71a Added command-line arg handling to roundup-server...
Richard Jones <richard@users.sourceforge.net>
parents: 54
diff changeset
168 def usage(message=''):
485
fad315a10185 i18n'ification
Richard Jones <richard@users.sourceforge.net>
parents: 456
diff changeset
169 if message:
fad315a10185 i18n'ification
Richard Jones <richard@users.sourceforge.net>
parents: 456
diff changeset
170 message = _('Error: %(error)s\n\n')%{'error': message}
fad315a10185 i18n'ification
Richard Jones <richard@users.sourceforge.net>
parents: 456
diff changeset
171 print _('''%(message)sUsage:
61
820c8bb1b71a Added command-line arg handling to roundup-server...
Richard Jones <richard@users.sourceforge.net>
parents: 54
diff changeset
172 roundup-server [-n hostname] [-p port] [name=instance home]*
820c8bb1b71a Added command-line arg handling to roundup-server...
Richard Jones <richard@users.sourceforge.net>
parents: 54
diff changeset
173
820c8bb1b71a Added command-line arg handling to roundup-server...
Richard Jones <richard@users.sourceforge.net>
parents: 54
diff changeset
174 -n: sets the host name
820c8bb1b71a Added command-line arg handling to roundup-server...
Richard Jones <richard@users.sourceforge.net>
parents: 54
diff changeset
175 -p: sets the port to listen on
820c8bb1b71a Added command-line arg handling to roundup-server...
Richard Jones <richard@users.sourceforge.net>
parents: 54
diff changeset
176
820c8bb1b71a Added command-line arg handling to roundup-server...
Richard Jones <richard@users.sourceforge.net>
parents: 54
diff changeset
177 name=instance home
820c8bb1b71a Added command-line arg handling to roundup-server...
Richard Jones <richard@users.sourceforge.net>
parents: 54
diff changeset
178 Sets the instance home(s) to use. The name is how the instance is
820c8bb1b71a Added command-line arg handling to roundup-server...
Richard Jones <richard@users.sourceforge.net>
parents: 54
diff changeset
179 identified in the URL (it's the first part of the URL path). The
820c8bb1b71a Added command-line arg handling to roundup-server...
Richard Jones <richard@users.sourceforge.net>
parents: 54
diff changeset
180 instance home is the directory that was identified when you did
820c8bb1b71a Added command-line arg handling to roundup-server...
Richard Jones <richard@users.sourceforge.net>
parents: 54
diff changeset
181 "roundup-admin init". You may specify any number of these name=home
820c8bb1b71a Added command-line arg handling to roundup-server...
Richard Jones <richard@users.sourceforge.net>
parents: 54
diff changeset
182 pairs on the command-line. For convenience, you may edit the
820c8bb1b71a Added command-line arg handling to roundup-server...
Richard Jones <richard@users.sourceforge.net>
parents: 54
diff changeset
183 ROUNDUP_INSTANCE_HOMES variable in the roundup-server file instead.
486
Richard Jones <richard@users.sourceforge.net>
parents: 485
diff changeset
184 ''')%locals()
61
820c8bb1b71a Added command-line arg handling to roundup-server...
Richard Jones <richard@users.sourceforge.net>
parents: 54
diff changeset
185 sys.exit(0)
820c8bb1b71a Added command-line arg handling to roundup-server...
Richard Jones <richard@users.sourceforge.net>
parents: 54
diff changeset
186
820c8bb1b71a Added command-line arg handling to roundup-server...
Richard Jones <richard@users.sourceforge.net>
parents: 54
diff changeset
187 def main():
820c8bb1b71a Added command-line arg handling to roundup-server...
Richard Jones <richard@users.sourceforge.net>
parents: 54
diff changeset
188 hostname = ''
820c8bb1b71a Added command-line arg handling to roundup-server...
Richard Jones <richard@users.sourceforge.net>
parents: 54
diff changeset
189 port = 8080
820c8bb1b71a Added command-line arg handling to roundup-server...
Richard Jones <richard@users.sourceforge.net>
parents: 54
diff changeset
190 try:
820c8bb1b71a Added command-line arg handling to roundup-server...
Richard Jones <richard@users.sourceforge.net>
parents: 54
diff changeset
191 # handle the command-line args
386
59ed29a879f6 Fixed option & associated error handling
Jürgen Hermann <jhermann@users.sourceforge.net>
parents: 343
diff changeset
192 try:
59ed29a879f6 Fixed option & associated error handling
Jürgen Hermann <jhermann@users.sourceforge.net>
parents: 343
diff changeset
193 optlist, args = getopt.getopt(sys.argv[1:], 'n:p:u:')
59ed29a879f6 Fixed option & associated error handling
Jürgen Hermann <jhermann@users.sourceforge.net>
parents: 343
diff changeset
194 except getopt.GetoptError, e:
59ed29a879f6 Fixed option & associated error handling
Jürgen Hermann <jhermann@users.sourceforge.net>
parents: 343
diff changeset
195 usage(str(e))
59ed29a879f6 Fixed option & associated error handling
Jürgen Hermann <jhermann@users.sourceforge.net>
parents: 343
diff changeset
196
288
c2f287327ca8 server now handles setuid'ing much better
Richard Jones <richard@users.sourceforge.net>
parents: 264
diff changeset
197 user = ROUNDUP_USER
61
820c8bb1b71a Added command-line arg handling to roundup-server...
Richard Jones <richard@users.sourceforge.net>
parents: 54
diff changeset
198 for (opt, arg) in optlist:
820c8bb1b71a Added command-line arg handling to roundup-server...
Richard Jones <richard@users.sourceforge.net>
parents: 54
diff changeset
199 if opt == '-n': hostname = arg
820c8bb1b71a Added command-line arg handling to roundup-server...
Richard Jones <richard@users.sourceforge.net>
parents: 54
diff changeset
200 elif opt == '-p': port = int(arg)
288
c2f287327ca8 server now handles setuid'ing much better
Richard Jones <richard@users.sourceforge.net>
parents: 264
diff changeset
201 elif opt == '-u': user = arg
61
820c8bb1b71a Added command-line arg handling to roundup-server...
Richard Jones <richard@users.sourceforge.net>
parents: 54
diff changeset
202 elif opt == '-h': usage()
820c8bb1b71a Added command-line arg handling to roundup-server...
Richard Jones <richard@users.sourceforge.net>
parents: 54
diff changeset
203
329
96212178c175 Fixed roundup-server for windows, thanks Juergen Hermann.
Richard Jones <richard@users.sourceforge.net>
parents: 290
diff changeset
204 if hasattr(os, 'getuid'):
96212178c175 Fixed roundup-server for windows, thanks Juergen Hermann.
Richard Jones <richard@users.sourceforge.net>
parents: 290
diff changeset
205 # if root, setuid to the running user
96212178c175 Fixed roundup-server for windows, thanks Juergen Hermann.
Richard Jones <richard@users.sourceforge.net>
parents: 290
diff changeset
206 if not os.getuid() and user is not None:
96212178c175 Fixed roundup-server for windows, thanks Juergen Hermann.
Richard Jones <richard@users.sourceforge.net>
parents: 290
diff changeset
207 try:
96212178c175 Fixed roundup-server for windows, thanks Juergen Hermann.
Richard Jones <richard@users.sourceforge.net>
parents: 290
diff changeset
208 import pwd
96212178c175 Fixed roundup-server for windows, thanks Juergen Hermann.
Richard Jones <richard@users.sourceforge.net>
parents: 290
diff changeset
209 except ImportError:
485
fad315a10185 i18n'ification
Richard Jones <richard@users.sourceforge.net>
parents: 456
diff changeset
210 raise ValueError, _("Can't change users - no pwd module")
329
96212178c175 Fixed roundup-server for windows, thanks Juergen Hermann.
Richard Jones <richard@users.sourceforge.net>
parents: 290
diff changeset
211 try:
96212178c175 Fixed roundup-server for windows, thanks Juergen Hermann.
Richard Jones <richard@users.sourceforge.net>
parents: 290
diff changeset
212 uid = pwd.getpwnam(user)[2]
96212178c175 Fixed roundup-server for windows, thanks Juergen Hermann.
Richard Jones <richard@users.sourceforge.net>
parents: 290
diff changeset
213 except KeyError:
485
fad315a10185 i18n'ification
Richard Jones <richard@users.sourceforge.net>
parents: 456
diff changeset
214 raise ValueError, _("User %(user)s doesn't exist")%locals()
329
96212178c175 Fixed roundup-server for windows, thanks Juergen Hermann.
Richard Jones <richard@users.sourceforge.net>
parents: 290
diff changeset
215 os.setuid(uid)
96212178c175 Fixed roundup-server for windows, thanks Juergen Hermann.
Richard Jones <richard@users.sourceforge.net>
parents: 290
diff changeset
216 elif os.getuid() and user is not None:
485
fad315a10185 i18n'ification
Richard Jones <richard@users.sourceforge.net>
parents: 456
diff changeset
217 print _('WARNING: ignoring "-u" argument, not root')
288
c2f287327ca8 server now handles setuid'ing much better
Richard Jones <richard@users.sourceforge.net>
parents: 264
diff changeset
218
329
96212178c175 Fixed roundup-server for windows, thanks Juergen Hermann.
Richard Jones <richard@users.sourceforge.net>
parents: 290
diff changeset
219 # People can remove this check if they're really determined
96212178c175 Fixed roundup-server for windows, thanks Juergen Hermann.
Richard Jones <richard@users.sourceforge.net>
parents: 290
diff changeset
220 if not os.getuid() and user is None:
485
fad315a10185 i18n'ification
Richard Jones <richard@users.sourceforge.net>
parents: 456
diff changeset
221 raise ValueError, _("Can't run as root!")
288
c2f287327ca8 server now handles setuid'ing much better
Richard Jones <richard@users.sourceforge.net>
parents: 264
diff changeset
222
61
820c8bb1b71a Added command-line arg handling to roundup-server...
Richard Jones <richard@users.sourceforge.net>
parents: 54
diff changeset
223 # handle instance specs
820c8bb1b71a Added command-line arg handling to roundup-server...
Richard Jones <richard@users.sourceforge.net>
parents: 54
diff changeset
224 if args:
820c8bb1b71a Added command-line arg handling to roundup-server...
Richard Jones <richard@users.sourceforge.net>
parents: 54
diff changeset
225 d = {}
820c8bb1b71a Added command-line arg handling to roundup-server...
Richard Jones <richard@users.sourceforge.net>
parents: 54
diff changeset
226 for arg in args:
288
c2f287327ca8 server now handles setuid'ing much better
Richard Jones <richard@users.sourceforge.net>
parents: 264
diff changeset
227 try:
456
5f3c5c3fd524 sys module went away...
Richard Jones <richard@users.sourceforge.net>
parents: 449
diff changeset
228 name, home = arg.split('=')
288
c2f287327ca8 server now handles setuid'ing much better
Richard Jones <richard@users.sourceforge.net>
parents: 264
diff changeset
229 except ValueError:
485
fad315a10185 i18n'ification
Richard Jones <richard@users.sourceforge.net>
parents: 456
diff changeset
230 raise ValueError, _("Instances must be name=home")
61
820c8bb1b71a Added command-line arg handling to roundup-server...
Richard Jones <richard@users.sourceforge.net>
parents: 54
diff changeset
231 d[name] = home
820c8bb1b71a Added command-line arg handling to roundup-server...
Richard Jones <richard@users.sourceforge.net>
parents: 54
diff changeset
232 RoundupRequestHandler.ROUNDUP_INSTANCE_HOMES = d
386
59ed29a879f6 Fixed option & associated error handling
Jürgen Hermann <jhermann@users.sourceforge.net>
parents: 343
diff changeset
233 except SystemExit:
59ed29a879f6 Fixed option & associated error handling
Jürgen Hermann <jhermann@users.sourceforge.net>
parents: 343
diff changeset
234 raise
61
820c8bb1b71a Added command-line arg handling to roundup-server...
Richard Jones <richard@users.sourceforge.net>
parents: 54
diff changeset
235 except:
411
a6088556e9ba Features and fixes.
Richard Jones <richard@users.sourceforge.net>
parents: 386
diff changeset
236 exc_type, exc_value = sys.exc_info()[:2]
a6088556e9ba Features and fixes.
Richard Jones <richard@users.sourceforge.net>
parents: 386
diff changeset
237 usage('%s: %s'%(exc_type, exc_value))
61
820c8bb1b71a Added command-line arg handling to roundup-server...
Richard Jones <richard@users.sourceforge.net>
parents: 54
diff changeset
238
820c8bb1b71a Added command-line arg handling to roundup-server...
Richard Jones <richard@users.sourceforge.net>
parents: 54
diff changeset
239 # we don't want the cgi module interpreting the command-line args ;)
820c8bb1b71a Added command-line arg handling to roundup-server...
Richard Jones <richard@users.sourceforge.net>
parents: 54
diff changeset
240 sys.argv = sys.argv[:1]
820c8bb1b71a Added command-line arg handling to roundup-server...
Richard Jones <richard@users.sourceforge.net>
parents: 54
diff changeset
241 address = (hostname, port)
27
e5e9ea306a09 moving the bin files to facilitate out-of-the-boxness
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
242 httpd = BaseHTTPServer.HTTPServer(address, RoundupRequestHandler)
485
fad315a10185 i18n'ification
Richard Jones <richard@users.sourceforge.net>
parents: 456
diff changeset
243 print _('Roundup server started on %(address)s')%locals()
27
e5e9ea306a09 moving the bin files to facilitate out-of-the-boxness
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
244 httpd.serve_forever()
e5e9ea306a09 moving the bin files to facilitate out-of-the-boxness
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
245
61
820c8bb1b71a Added command-line arg handling to roundup-server...
Richard Jones <richard@users.sourceforge.net>
parents: 54
diff changeset
246 if __name__ == '__main__':
820c8bb1b71a Added command-line arg handling to roundup-server...
Richard Jones <richard@users.sourceforge.net>
parents: 54
diff changeset
247 main()
820c8bb1b71a Added command-line arg handling to roundup-server...
Richard Jones <richard@users.sourceforge.net>
parents: 54
diff changeset
248
27
e5e9ea306a09 moving the bin files to facilitate out-of-the-boxness
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
249 #
e5e9ea306a09 moving the bin files to facilitate out-of-the-boxness
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
250 # $Log: not supported by cvs2svn $
486
Richard Jones <richard@users.sourceforge.net>
parents: 485
diff changeset
251 # Revision 1.24 2002/01/05 02:19:03 richard
Richard Jones <richard@users.sourceforge.net>
parents: 485
diff changeset
252 # i18n'ification
Richard Jones <richard@users.sourceforge.net>
parents: 485
diff changeset
253 #
485
fad315a10185 i18n'ification
Richard Jones <richard@users.sourceforge.net>
parents: 456
diff changeset
254 # Revision 1.23 2001/12/15 23:47:07 richard
fad315a10185 i18n'ification
Richard Jones <richard@users.sourceforge.net>
parents: 456
diff changeset
255 # sys module went away...
fad315a10185 i18n'ification
Richard Jones <richard@users.sourceforge.net>
parents: 456
diff changeset
256 #
456
5f3c5c3fd524 sys module went away...
Richard Jones <richard@users.sourceforge.net>
parents: 449
diff changeset
257 # Revision 1.22 2001/12/13 00:20:01 richard
5f3c5c3fd524 sys module went away...
Richard Jones <richard@users.sourceforge.net>
parents: 449
diff changeset
258 # . Centralised the python version check code, bumped version to 2.1.1 (really
5f3c5c3fd524 sys module went away...
Richard Jones <richard@users.sourceforge.net>
parents: 449
diff changeset
259 # needs to be 2.1.2, but that isn't released yet :)
5f3c5c3fd524 sys module went away...
Richard Jones <richard@users.sourceforge.net>
parents: 449
diff changeset
260 #
449
141aacfdb34f Centralised the python version check code, bumped version to 2.1.1
Richard Jones <richard@users.sourceforge.net>
parents: 431
diff changeset
261 # Revision 1.21 2001/12/02 05:06:16 richard
141aacfdb34f Centralised the python version check code, bumped version to 2.1.1
Richard Jones <richard@users.sourceforge.net>
parents: 431
diff changeset
262 # . We now use weakrefs in the Classes to keep the database reference, so
141aacfdb34f Centralised the python version check code, bumped version to 2.1.1
Richard Jones <richard@users.sourceforge.net>
parents: 431
diff changeset
263 # the close() method on the database is no longer needed.
141aacfdb34f Centralised the python version check code, bumped version to 2.1.1
Richard Jones <richard@users.sourceforge.net>
parents: 431
diff changeset
264 # I bumped the minimum python requirement up to 2.1 accordingly.
141aacfdb34f Centralised the python version check code, bumped version to 2.1.1
Richard Jones <richard@users.sourceforge.net>
parents: 431
diff changeset
265 # . #487480 ] roundup-server
141aacfdb34f Centralised the python version check code, bumped version to 2.1.1
Richard Jones <richard@users.sourceforge.net>
parents: 431
diff changeset
266 # . #487476 ] INSTALL.txt
141aacfdb34f Centralised the python version check code, bumped version to 2.1.1
Richard Jones <richard@users.sourceforge.net>
parents: 431
diff changeset
267 #
141aacfdb34f Centralised the python version check code, bumped version to 2.1.1
Richard Jones <richard@users.sourceforge.net>
parents: 431
diff changeset
268 # I also cleaned up the change message / post-edit stuff in the cgi client.
141aacfdb34f Centralised the python version check code, bumped version to 2.1.1
Richard Jones <richard@users.sourceforge.net>
parents: 431
diff changeset
269 # There's now a clearly marked "TODO: append the change note" where I believe
141aacfdb34f Centralised the python version check code, bumped version to 2.1.1
Richard Jones <richard@users.sourceforge.net>
parents: 431
diff changeset
270 # the change note should be added there. The "changes" list will obviously
141aacfdb34f Centralised the python version check code, bumped version to 2.1.1
Richard Jones <richard@users.sourceforge.net>
parents: 431
diff changeset
271 # have to be modified to be a dict of the changes, or somesuch.
141aacfdb34f Centralised the python version check code, bumped version to 2.1.1
Richard Jones <richard@users.sourceforge.net>
parents: 431
diff changeset
272 #
141aacfdb34f Centralised the python version check code, bumped version to 2.1.1
Richard Jones <richard@users.sourceforge.net>
parents: 431
diff changeset
273 # More testing needed.
141aacfdb34f Centralised the python version check code, bumped version to 2.1.1
Richard Jones <richard@users.sourceforge.net>
parents: 431
diff changeset
274 #
431
a28a80b714f9 Eliminate database close method by using weakrefs.
Richard Jones <richard@users.sourceforge.net>
parents: 411
diff changeset
275 # Revision 1.20 2001/11/26 22:55:56 richard
a28a80b714f9 Eliminate database close method by using weakrefs.
Richard Jones <richard@users.sourceforge.net>
parents: 411
diff changeset
276 # Feature:
a28a80b714f9 Eliminate database close method by using weakrefs.
Richard Jones <richard@users.sourceforge.net>
parents: 411
diff changeset
277 # . Added INSTANCE_NAME to configuration - used in web and email to identify
a28a80b714f9 Eliminate database close method by using weakrefs.
Richard Jones <richard@users.sourceforge.net>
parents: 411
diff changeset
278 # the instance.
a28a80b714f9 Eliminate database close method by using weakrefs.
Richard Jones <richard@users.sourceforge.net>
parents: 411
diff changeset
279 # . Added EMAIL_SIGNATURE_POSITION to indicate where to place the roundup
a28a80b714f9 Eliminate database close method by using weakrefs.
Richard Jones <richard@users.sourceforge.net>
parents: 411
diff changeset
280 # signature info in e-mails.
a28a80b714f9 Eliminate database close method by using weakrefs.
Richard Jones <richard@users.sourceforge.net>
parents: 411
diff changeset
281 # . Some more flexibility in the mail gateway and more error handling.
a28a80b714f9 Eliminate database close method by using weakrefs.
Richard Jones <richard@users.sourceforge.net>
parents: 411
diff changeset
282 # . Login now takes you to the page you back to the were denied access to.
a28a80b714f9 Eliminate database close method by using weakrefs.
Richard Jones <richard@users.sourceforge.net>
parents: 411
diff changeset
283 #
a28a80b714f9 Eliminate database close method by using weakrefs.
Richard Jones <richard@users.sourceforge.net>
parents: 411
diff changeset
284 # Fixed:
a28a80b714f9 Eliminate database close method by using weakrefs.
Richard Jones <richard@users.sourceforge.net>
parents: 411
diff changeset
285 # . Lots of bugs, thanks Roché and others on the devel mailing list!
a28a80b714f9 Eliminate database close method by using weakrefs.
Richard Jones <richard@users.sourceforge.net>
parents: 411
diff changeset
286 #
411
a6088556e9ba Features and fixes.
Richard Jones <richard@users.sourceforge.net>
parents: 386
diff changeset
287 # Revision 1.19 2001/11/12 22:51:04 jhermann
a6088556e9ba Features and fixes.
Richard Jones <richard@users.sourceforge.net>
parents: 386
diff changeset
288 # Fixed option & associated error handling
a6088556e9ba Features and fixes.
Richard Jones <richard@users.sourceforge.net>
parents: 386
diff changeset
289 #
386
59ed29a879f6 Fixed option & associated error handling
Jürgen Hermann <jhermann@users.sourceforge.net>
parents: 343
diff changeset
290 # Revision 1.18 2001/11/01 22:04:37 richard
59ed29a879f6 Fixed option & associated error handling
Jürgen Hermann <jhermann@users.sourceforge.net>
parents: 343
diff changeset
291 # Started work on supporting a pop3-fetching server
59ed29a879f6 Fixed option & associated error handling
Jürgen Hermann <jhermann@users.sourceforge.net>
parents: 343
diff changeset
292 # Fixed bugs:
59ed29a879f6 Fixed option & associated error handling
Jürgen Hermann <jhermann@users.sourceforge.net>
parents: 343
diff changeset
293 # . bug #477104 ] HTML tag error in roundup-server
59ed29a879f6 Fixed option & associated error handling
Jürgen Hermann <jhermann@users.sourceforge.net>
parents: 343
diff changeset
294 # . bug #477107 ] HTTP header problem
59ed29a879f6 Fixed option & associated error handling
Jürgen Hermann <jhermann@users.sourceforge.net>
parents: 343
diff changeset
295 #
343
ab16997d9cda Started work on supporting a pop3-fetching server
Richard Jones <richard@users.sourceforge.net>
parents: 336
diff changeset
296 # Revision 1.17 2001/10/29 23:55:44 richard
ab16997d9cda Started work on supporting a pop3-fetching server
Richard Jones <richard@users.sourceforge.net>
parents: 336
diff changeset
297 # Fix to CGI top-level index (thanks Juergen Hermann)
ab16997d9cda Started work on supporting a pop3-fetching server
Richard Jones <richard@users.sourceforge.net>
parents: 336
diff changeset
298 #
336
b3c103e536ed Fix to CGI top-level index (thanks Juergen Hermann)
Richard Jones <richard@users.sourceforge.net>
parents: 329
diff changeset
299 # Revision 1.16 2001/10/27 00:12:21 richard
b3c103e536ed Fix to CGI top-level index (thanks Juergen Hermann)
Richard Jones <richard@users.sourceforge.net>
parents: 329
diff changeset
300 # Fixed roundup-server for windows, thanks Juergen Hermann.
b3c103e536ed Fix to CGI top-level index (thanks Juergen Hermann)
Richard Jones <richard@users.sourceforge.net>
parents: 329
diff changeset
301 #
329
96212178c175 Fixed roundup-server for windows, thanks Juergen Hermann.
Richard Jones <richard@users.sourceforge.net>
parents: 290
diff changeset
302 # Revision 1.15 2001/10/12 02:23:26 richard
96212178c175 Fixed roundup-server for windows, thanks Juergen Hermann.
Richard Jones <richard@users.sourceforge.net>
parents: 290
diff changeset
303 # Didn't clean up after myself :)
96212178c175 Fixed roundup-server for windows, thanks Juergen Hermann.
Richard Jones <richard@users.sourceforge.net>
parents: 290
diff changeset
304 #
290
8230a9a62794 Didn't clean up after myself :)
Richard Jones <richard@users.sourceforge.net>
parents: 288
diff changeset
305 # Revision 1.14 2001/10/12 02:20:32 richard
8230a9a62794 Didn't clean up after myself :)
Richard Jones <richard@users.sourceforge.net>
parents: 288
diff changeset
306 # server now handles setuid'ing much better
8230a9a62794 Didn't clean up after myself :)
Richard Jones <richard@users.sourceforge.net>
parents: 288
diff changeset
307 #
288
c2f287327ca8 server now handles setuid'ing much better
Richard Jones <richard@users.sourceforge.net>
parents: 264
diff changeset
308 # Revision 1.13 2001/10/05 02:23:24 richard
c2f287327ca8 server now handles setuid'ing much better
Richard Jones <richard@users.sourceforge.net>
parents: 264
diff changeset
309 # . roundup-admin create now prompts for property info if none is supplied
c2f287327ca8 server now handles setuid'ing much better
Richard Jones <richard@users.sourceforge.net>
parents: 264
diff changeset
310 # on the command-line.
c2f287327ca8 server now handles setuid'ing much better
Richard Jones <richard@users.sourceforge.net>
parents: 264
diff changeset
311 # . hyperdb Class getprops() method may now return only the mutable
c2f287327ca8 server now handles setuid'ing much better
Richard Jones <richard@users.sourceforge.net>
parents: 264
diff changeset
312 # properties.
c2f287327ca8 server now handles setuid'ing much better
Richard Jones <richard@users.sourceforge.net>
parents: 264
diff changeset
313 # . Login now uses cookies, which makes it a whole lot more flexible. We can
c2f287327ca8 server now handles setuid'ing much better
Richard Jones <richard@users.sourceforge.net>
parents: 264
diff changeset
314 # now support anonymous user access (read-only, unless there's an
c2f287327ca8 server now handles setuid'ing much better
Richard Jones <richard@users.sourceforge.net>
parents: 264
diff changeset
315 # "anonymous" user, in which case write access is permitted). Login
c2f287327ca8 server now handles setuid'ing much better
Richard Jones <richard@users.sourceforge.net>
parents: 264
diff changeset
316 # handling has been moved into cgi_client.Client.main()
c2f287327ca8 server now handles setuid'ing much better
Richard Jones <richard@users.sourceforge.net>
parents: 264
diff changeset
317 # . The "extended" schema is now the default in roundup init.
c2f287327ca8 server now handles setuid'ing much better
Richard Jones <richard@users.sourceforge.net>
parents: 264
diff changeset
318 # . The schemas have had their page headings modified to cope with the new
c2f287327ca8 server now handles setuid'ing much better
Richard Jones <richard@users.sourceforge.net>
parents: 264
diff changeset
319 # login handling. Existing installations should copy the interfaces.py
c2f287327ca8 server now handles setuid'ing much better
Richard Jones <richard@users.sourceforge.net>
parents: 264
diff changeset
320 # file from the roundup lib directory to their instance home.
c2f287327ca8 server now handles setuid'ing much better
Richard Jones <richard@users.sourceforge.net>
parents: 264
diff changeset
321 # . Incorrectly had a Bizar Software copyright on the cgitb.py module from
c2f287327ca8 server now handles setuid'ing much better
Richard Jones <richard@users.sourceforge.net>
parents: 264
diff changeset
322 # Ping - has been removed.
c2f287327ca8 server now handles setuid'ing much better
Richard Jones <richard@users.sourceforge.net>
parents: 264
diff changeset
323 # . Fixed a whole bunch of places in the CGI interface where we should have
c2f287327ca8 server now handles setuid'ing much better
Richard Jones <richard@users.sourceforge.net>
parents: 264
diff changeset
324 # been returning Not Found instead of throwing an exception.
c2f287327ca8 server now handles setuid'ing much better
Richard Jones <richard@users.sourceforge.net>
parents: 264
diff changeset
325 # . Fixed a deviation from the spec: trying to modify the 'id' property of
c2f287327ca8 server now handles setuid'ing much better
Richard Jones <richard@users.sourceforge.net>
parents: 264
diff changeset
326 # an item now throws an exception.
c2f287327ca8 server now handles setuid'ing much better
Richard Jones <richard@users.sourceforge.net>
parents: 264
diff changeset
327 #
264
a671e5917b33 Many features and fixes.
Richard Jones <richard@users.sourceforge.net>
parents: 252
diff changeset
328 # Revision 1.12 2001/09/29 13:27:00 richard
a671e5917b33 Many features and fixes.
Richard Jones <richard@users.sourceforge.net>
parents: 252
diff changeset
329 # CGI interfaces now spit up a top-level index of all the instances they can
a671e5917b33 Many features and fixes.
Richard Jones <richard@users.sourceforge.net>
parents: 252
diff changeset
330 # serve.
a671e5917b33 Many features and fixes.
Richard Jones <richard@users.sourceforge.net>
parents: 252
diff changeset
331 #
252
76c6994aa4e8 CGI interfaces now spit up a top-level index of all instances they can serve.
Richard Jones <richard@users.sourceforge.net>
parents: 214
diff changeset
332 # Revision 1.11 2001/08/07 00:24:42 richard
76c6994aa4e8 CGI interfaces now spit up a top-level index of all instances they can serve.
Richard Jones <richard@users.sourceforge.net>
parents: 214
diff changeset
333 # stupid typo
76c6994aa4e8 CGI interfaces now spit up a top-level index of all instances they can serve.
Richard Jones <richard@users.sourceforge.net>
parents: 214
diff changeset
334 #
214
18134bffab37 stupid typo
Richard Jones <richard@users.sourceforge.net>
parents: 213
diff changeset
335 # Revision 1.10 2001/08/07 00:15:51 richard
18134bffab37 stupid typo
Richard Jones <richard@users.sourceforge.net>
parents: 213
diff changeset
336 # Added the copyright/license notice to (nearly) all files at request of
18134bffab37 stupid typo
Richard Jones <richard@users.sourceforge.net>
parents: 213
diff changeset
337 # Bizar Software.
18134bffab37 stupid typo
Richard Jones <richard@users.sourceforge.net>
parents: 213
diff changeset
338 #
213
d45384bc6420 Added the copyright/license notice to (nearly) all files...
Richard Jones <richard@users.sourceforge.net>
parents: 204
diff changeset
339 # Revision 1.9 2001/08/05 07:44:36 richard
d45384bc6420 Added the copyright/license notice to (nearly) all files...
Richard Jones <richard@users.sourceforge.net>
parents: 204
diff changeset
340 # Instances are now opened by a special function that generates a unique
d45384bc6420 Added the copyright/license notice to (nearly) all files...
Richard Jones <richard@users.sourceforge.net>
parents: 204
diff changeset
341 # module name for the instances on import time.
d45384bc6420 Added the copyright/license notice to (nearly) all files...
Richard Jones <richard@users.sourceforge.net>
parents: 204
diff changeset
342 #
204
c1461733cbf9 Instances are now opened by a special function...
Richard Jones <richard@users.sourceforge.net>
parents: 193
diff changeset
343 # Revision 1.8 2001/08/03 01:28:33 richard
c1461733cbf9 Instances are now opened by a special function...
Richard Jones <richard@users.sourceforge.net>
parents: 193
diff changeset
344 # Used the much nicer load_package, pointed out by Steve Majewski.
c1461733cbf9 Instances are now opened by a special function...
Richard Jones <richard@users.sourceforge.net>
parents: 193
diff changeset
345 #
193
241a0323aacb Used the much nicer load_package, pointed out by Steve Majewski.
Richard Jones <richard@users.sourceforge.net>
parents: 190
diff changeset
346 # Revision 1.7 2001/08/03 00:59:34 richard
241a0323aacb Used the much nicer load_package, pointed out by Steve Majewski.
Richard Jones <richard@users.sourceforge.net>
parents: 190
diff changeset
347 # Instance import now imports the instance using imp.load_module so that
241a0323aacb Used the much nicer load_package, pointed out by Steve Majewski.
Richard Jones <richard@users.sourceforge.net>
parents: 190
diff changeset
348 # we can have instance homes of "roundup" or other existing python package
241a0323aacb Used the much nicer load_package, pointed out by Steve Majewski.
Richard Jones <richard@users.sourceforge.net>
parents: 190
diff changeset
349 # names.
241a0323aacb Used the much nicer load_package, pointed out by Steve Majewski.
Richard Jones <richard@users.sourceforge.net>
parents: 190
diff changeset
350 #
190
996eaf90c01e Instance import now imports the instance using imp.load_module...
Richard Jones <richard@users.sourceforge.net>
parents: 127
diff changeset
351 # Revision 1.6 2001/07/29 07:01:39 richard
996eaf90c01e Instance import now imports the instance using imp.load_module...
Richard Jones <richard@users.sourceforge.net>
parents: 127
diff changeset
352 # Added vim command to all source so that we don't get no steenkin' tabs :)
996eaf90c01e Instance import now imports the instance using imp.load_module...
Richard Jones <richard@users.sourceforge.net>
parents: 127
diff changeset
353 #
127
0791d13baea7 Added vim command to all source so that we don't get no steenkin' tabs :)
Richard Jones <richard@users.sourceforge.net>
parents: 61
diff changeset
354 # Revision 1.5 2001/07/24 01:07:59 richard
0791d13baea7 Added vim command to all source so that we don't get no steenkin' tabs :)
Richard Jones <richard@users.sourceforge.net>
parents: 61
diff changeset
355 # Added command-line arg handling to roundup-server so it's more useful
0791d13baea7 Added vim command to all source so that we don't get no steenkin' tabs :)
Richard Jones <richard@users.sourceforge.net>
parents: 61
diff changeset
356 # out-of-the-box.
0791d13baea7 Added vim command to all source so that we don't get no steenkin' tabs :)
Richard Jones <richard@users.sourceforge.net>
parents: 61
diff changeset
357 #
61
820c8bb1b71a Added command-line arg handling to roundup-server...
Richard Jones <richard@users.sourceforge.net>
parents: 54
diff changeset
358 # Revision 1.4 2001/07/23 10:31:45 richard
820c8bb1b71a Added command-line arg handling to roundup-server...
Richard Jones <richard@users.sourceforge.net>
parents: 54
diff changeset
359 # disabled the reloading until it can be done properly
820c8bb1b71a Added command-line arg handling to roundup-server...
Richard Jones <richard@users.sourceforge.net>
parents: 54
diff changeset
360 #
54
b68bcb176d1a disabled the reloading until it can be done properly
Richard Jones <richard@users.sourceforge.net>
parents: 52
diff changeset
361 # Revision 1.3 2001/07/23 08:53:44 richard
b68bcb176d1a disabled the reloading until it can be done properly
Richard Jones <richard@users.sourceforge.net>
parents: 52
diff changeset
362 # Fixed the ROUNDUPS decl in roundup-server
b68bcb176d1a disabled the reloading until it can be done properly
Richard Jones <richard@users.sourceforge.net>
parents: 52
diff changeset
363 # Move the installation notes to INSTALL
b68bcb176d1a disabled the reloading until it can be done properly
Richard Jones <richard@users.sourceforge.net>
parents: 52
diff changeset
364 #
52
33bfce110d1e Fixed the ROUNDUPS decl in roundup-server
Richard Jones <richard@users.sourceforge.net>
parents: 32
diff changeset
365 # Revision 1.2 2001/07/23 04:05:05 anthonybaxter
33bfce110d1e Fixed the ROUNDUPS decl in roundup-server
Richard Jones <richard@users.sourceforge.net>
parents: 32
diff changeset
366 # actually quit if python version wrong
33bfce110d1e Fixed the ROUNDUPS decl in roundup-server
Richard Jones <richard@users.sourceforge.net>
parents: 32
diff changeset
367 #
32
b475e7d3ce52 actually quit if python version wrong
Anthony Baxter <anthonybaxter@users.sourceforge.net>
parents: 27
diff changeset
368 # Revision 1.1 2001/07/23 03:46:48 richard
b475e7d3ce52 actually quit if python version wrong
Anthony Baxter <anthonybaxter@users.sourceforge.net>
parents: 27
diff changeset
369 # moving the bin files to facilitate out-of-the-boxness
b475e7d3ce52 actually quit if python version wrong
Anthony Baxter <anthonybaxter@users.sourceforge.net>
parents: 27
diff changeset
370 #
27
e5e9ea306a09 moving the bin files to facilitate out-of-the-boxness
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
371 # Revision 1.1 2001/07/22 11:15:45 richard
e5e9ea306a09 moving the bin files to facilitate out-of-the-boxness
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
372 # More Grande Splite stuff
e5e9ea306a09 moving the bin files to facilitate out-of-the-boxness
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
373 #
e5e9ea306a09 moving the bin files to facilitate out-of-the-boxness
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
374 #
127
0791d13baea7 Added vim command to all source so that we don't get no steenkin' tabs :)
Richard Jones <richard@users.sourceforge.net>
parents: 61
diff changeset
375 # vim: set filetype=python ts=4 sw=4 et si

Roundup Issue Tracker: http://roundup-tracker.org/