annotate roundup-server @ 464:29f5ac8a0d2b

Fixed bugs: . Fixed file creation and retrieval in same transaction in anydbm backend . Cgi interface now renders new issue after issue creation . Could not set issue status to resolved through cgi interface . Mail gateway was changing status back to 'chatting' if status was omitted as an argument
author Roche Compaan <rochecompaan@users.sourceforge.net>
date Tue, 18 Dec 2001 15:30:34 +0000
parents 5f3c5c3fd524
children fad315a10185
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
213
d45384bc6420 Added the copyright/license notice to (nearly) all files...
Richard Jones <richard@users.sourceforge.net>
parents: 204
diff changeset
21 Based on CGIHTTPServer in the Python library.
27
e5e9ea306a09 moving the bin files to facilitate out-of-the-boxness
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
22
456
5f3c5c3fd524 sys module went away...
Richard Jones <richard@users.sourceforge.net>
parents: 449
diff changeset
23 $Id: roundup-server,v 1.23 2001-12-15 23:47:07 richard Exp $
27
e5e9ea306a09 moving the bin files to facilitate out-of-the-boxness
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
24
e5e9ea306a09 moving the bin files to facilitate out-of-the-boxness
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
25 """
449
141aacfdb34f Centralised the python version check code, bumped version to 2.1.1
Richard Jones <richard@users.sourceforge.net>
parents: 431
diff changeset
26
141aacfdb34f Centralised the python version check code, bumped version to 2.1.1
Richard Jones <richard@users.sourceforge.net>
parents: 431
diff changeset
27 # 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
28 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
29
456
5f3c5c3fd524 sys module went away...
Richard Jones <richard@users.sourceforge.net>
parents: 449
diff changeset
30 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
31 import BaseHTTPServer
e5e9ea306a09 moving the bin files to facilitate out-of-the-boxness
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
32
e5e9ea306a09 moving the bin files to facilitate out-of-the-boxness
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
33 # 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
34 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
35 import roundup.instance
27
e5e9ea306a09 moving the bin files to facilitate out-of-the-boxness
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
36
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 ## Configuration
e5e9ea306a09 moving the bin files to facilitate out-of-the-boxness
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
39 #
e5e9ea306a09 moving the bin files to facilitate out-of-the-boxness
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
40
e5e9ea306a09 moving the bin files to facilitate out-of-the-boxness
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
41 # 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
42 ROUNDUP_INSTANCE_HOMES = {
54
b68bcb176d1a disabled the reloading until it can be done properly
Richard Jones <richard@users.sourceforge.net>
parents: 52
diff changeset
43 'bar': '/tmp/bar',
27
e5e9ea306a09 moving the bin files to facilitate out-of-the-boxness
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
44 }
e5e9ea306a09 moving the bin files to facilitate out-of-the-boxness
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
45
288
c2f287327ca8 server now handles setuid'ing much better
Richard Jones <richard@users.sourceforge.net>
parents: 264
diff changeset
46 ROUNDUP_USER = None
c2f287327ca8 server now handles setuid'ing much better
Richard Jones <richard@users.sourceforge.net>
parents: 264
diff changeset
47
c2f287327ca8 server now handles setuid'ing much better
Richard Jones <richard@users.sourceforge.net>
parents: 264
diff changeset
48
27
e5e9ea306a09 moving the bin files to facilitate out-of-the-boxness
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
49 # 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
50 # 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
51 # 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
52 #class DevNull:
e5e9ea306a09 moving the bin files to facilitate out-of-the-boxness
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
53 # def write(self, info):
e5e9ea306a09 moving the bin files to facilitate out-of-the-boxness
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
54 # pass
e5e9ea306a09 moving the bin files to facilitate out-of-the-boxness
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
55 #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
56 #LOG = DevNull()
e5e9ea306a09 moving the bin files to facilitate out-of-the-boxness
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
57
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 ## end configuration
e5e9ea306a09 moving the bin files to facilitate out-of-the-boxness
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
60 #
e5e9ea306a09 moving the bin files to facilitate out-of-the-boxness
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
61
e5e9ea306a09 moving the bin files to facilitate out-of-the-boxness
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
62
343
ab16997d9cda Started work on supporting a pop3-fetching server
Richard Jones <richard@users.sourceforge.net>
parents: 336
diff changeset
63 class RoundupRequestHandler(BaseHTTPServer.BaseHTTPRequestHandler):
61
820c8bb1b71a Added command-line arg handling to roundup-server...
Richard Jones <richard@users.sourceforge.net>
parents: 54
diff changeset
64 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
65 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
66
e5e9ea306a09 moving the bin files to facilitate out-of-the-boxness
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
67 def run_cgi(self):
e5e9ea306a09 moving the bin files to facilitate out-of-the-boxness
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
68 """ 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
69 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
70 """
e5e9ea306a09 moving the bin files to facilitate out-of-the-boxness
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
71 save_stdin = sys.stdin
e5e9ea306a09 moving the bin files to facilitate out-of-the-boxness
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
72 sys.stdin = self.rfile
e5e9ea306a09 moving the bin files to facilitate out-of-the-boxness
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
73 try:
e5e9ea306a09 moving the bin files to facilitate out-of-the-boxness
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
74 self.inner_run_cgi()
264
a671e5917b33 Many features and fixes.
Richard Jones <richard@users.sourceforge.net>
parents: 252
diff changeset
75 except cgi_client.NotFound:
a671e5917b33 Many features and fixes.
Richard Jones <richard@users.sourceforge.net>
parents: 252
diff changeset
76 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
77 except cgi_client.Unauthorised:
431
a28a80b714f9 Eliminate database close method by using weakrefs.
Richard Jones <richard@users.sourceforge.net>
parents: 411
diff changeset
78 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
79 except:
431
a28a80b714f9 Eliminate database close method by using weakrefs.
Richard Jones <richard@users.sourceforge.net>
parents: 411
diff changeset
80 # 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
81 # any effect...
a28a80b714f9 Eliminate database close method by using weakrefs.
Richard Jones <richard@users.sourceforge.net>
parents: 411
diff changeset
82 self.send_response(400)
a28a80b714f9 Eliminate database close method by using weakrefs.
Richard Jones <richard@users.sourceforge.net>
parents: 411
diff changeset
83 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
84 self.end_headers()
27
e5e9ea306a09 moving the bin files to facilitate out-of-the-boxness
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
85 try:
e5e9ea306a09 moving the bin files to facilitate out-of-the-boxness
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
86 reload(cgitb)
e5e9ea306a09 moving the bin files to facilitate out-of-the-boxness
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
87 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
88 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
89 except:
e5e9ea306a09 moving the bin files to facilitate out-of-the-boxness
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
90 self.wfile.write("<pre>")
e5e9ea306a09 moving the bin files to facilitate out-of-the-boxness
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
91 s = StringIO.StringIO()
e5e9ea306a09 moving the bin files to facilitate out-of-the-boxness
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
92 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
93 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
94 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
95 sys.stdin = save_stdin
e5e9ea306a09 moving the bin files to facilitate out-of-the-boxness
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
96
343
ab16997d9cda Started work on supporting a pop3-fetching server
Richard Jones <richard@users.sourceforge.net>
parents: 336
diff changeset
97 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
98
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
99 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
100 ''' 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
101 '''
431
a28a80b714f9 Eliminate database close method by using weakrefs.
Richard Jones <richard@users.sourceforge.net>
parents: 411
diff changeset
102 self.send_response(200)
a28a80b714f9 Eliminate database close method by using weakrefs.
Richard Jones <richard@users.sourceforge.net>
parents: 411
diff changeset
103 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
104 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
105 w = self.wfile.write
343
ab16997d9cda Started work on supporting a pop3-fetching server
Richard Jones <richard@users.sourceforge.net>
parents: 336
diff changeset
106 w('<html><head><title>Roundup instances index</title></head>\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
107 w('<body><h1>Roundup instances index</h1><ol>\n')
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
108 for instance in self.ROUNDUP_INSTANCE_HOMES.keys():
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
109 w('<li><a href="%s/index">%s</a>\n'%(urllib.quote(instance),
336
b3c103e536ed Fix to CGI top-level index (thanks Juergen Hermann)
Richard Jones <richard@users.sourceforge.net>
parents: 329
diff changeset
110 cgi.escape(instance)))
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 w('</ol></body></html>')
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
112
27
e5e9ea306a09 moving the bin files to facilitate out-of-the-boxness
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
113 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
114 ''' 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
115 '''
e5e9ea306a09 moving the bin files to facilitate out-of-the-boxness
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
116
e5e9ea306a09 moving the bin files to facilitate out-of-the-boxness
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
117 rest = self.path
e5e9ea306a09 moving the bin files to facilitate out-of-the-boxness
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
118 i = rest.rfind('?')
e5e9ea306a09 moving the bin files to facilitate out-of-the-boxness
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
119 if i >= 0:
e5e9ea306a09 moving the bin files to facilitate out-of-the-boxness
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
120 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
121 else:
e5e9ea306a09 moving the bin files to facilitate out-of-the-boxness
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
122 query = ''
e5e9ea306a09 moving the bin files to facilitate out-of-the-boxness
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
123
e5e9ea306a09 moving the bin files to facilitate out-of-the-boxness
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
124 # figure the instance
e5e9ea306a09 moving the bin files to facilitate out-of-the-boxness
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
125 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
126 return self.index()
456
5f3c5c3fd524 sys module went away...
Richard Jones <richard@users.sourceforge.net>
parents: 449
diff changeset
127 l_path = rest.split('/')
264
a671e5917b33 Many features and fixes.
Richard Jones <richard@users.sourceforge.net>
parents: 252
diff changeset
128 instance_name = urllib.unquote(l_path[1])
a671e5917b33 Many features and fixes.
Richard Jones <richard@users.sourceforge.net>
parents: 252
diff changeset
129 if self.ROUNDUP_INSTANCE_HOMES.has_key(instance_name):
a671e5917b33 Many features and fixes.
Richard Jones <richard@users.sourceforge.net>
parents: 252
diff changeset
130 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
131 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
132 else:
264
a671e5917b33 Many features and fixes.
Richard Jones <richard@users.sourceforge.net>
parents: 252
diff changeset
133 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
134
e5e9ea306a09 moving the bin files to facilitate out-of-the-boxness
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
135 # 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
136 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
137 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
138 else:
e5e9ea306a09 moving the bin files to facilitate out-of-the-boxness
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
139 rest = '/'
e5e9ea306a09 moving the bin files to facilitate out-of-the-boxness
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
140
e5e9ea306a09 moving the bin files to facilitate out-of-the-boxness
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
141 # 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
142 env = {}
264
a671e5917b33 Many features and fixes.
Richard Jones <richard@users.sourceforge.net>
parents: 252
diff changeset
143 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
144 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
145 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
146 if query:
e5e9ea306a09 moving the bin files to facilitate out-of-the-boxness
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
147 env['QUERY_STRING'] = query
e5e9ea306a09 moving the bin files to facilitate out-of-the-boxness
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
148 host = self.address_string()
e5e9ea306a09 moving the bin files to facilitate out-of-the-boxness
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
149 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
150 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
151 else:
e5e9ea306a09 moving the bin files to facilitate out-of-the-boxness
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
152 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
153 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
154 if length:
e5e9ea306a09 moving the bin files to facilitate out-of-the-boxness
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
155 env['CONTENT_LENGTH'] = length
e5e9ea306a09 moving the bin files to facilitate out-of-the-boxness
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
156 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
157 if co:
e5e9ea306a09 moving the bin files to facilitate out-of-the-boxness
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
158 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
159 env['SCRIPT_NAME'] = ''
e5e9ea306a09 moving the bin files to facilitate out-of-the-boxness
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
160 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
161 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
162
e5e9ea306a09 moving the bin files to facilitate out-of-the-boxness
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
163 decoded_query = query.replace('+', ' ')
e5e9ea306a09 moving the bin files to facilitate out-of-the-boxness
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
164
e5e9ea306a09 moving the bin files to facilitate out-of-the-boxness
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
165 # do the roundup thang
343
ab16997d9cda Started work on supporting a pop3-fetching server
Richard Jones <richard@users.sourceforge.net>
parents: 336
diff changeset
166 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
167 client.main()
264
a671e5917b33 Many features and fixes.
Richard Jones <richard@users.sourceforge.net>
parents: 252
diff changeset
168
61
820c8bb1b71a Added command-line arg handling to roundup-server...
Richard Jones <richard@users.sourceforge.net>
parents: 54
diff changeset
169 def usage(message=''):
386
59ed29a879f6 Fixed option & associated error handling
Jürgen Hermann <jhermann@users.sourceforge.net>
parents: 343
diff changeset
170 if message: message = 'Error: %s\n\n'%message
61
820c8bb1b71a Added command-line arg handling to roundup-server...
Richard Jones <richard@users.sourceforge.net>
parents: 54
diff changeset
171 print '''%sUsage:
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.
820c8bb1b71a Added command-line arg handling to roundup-server...
Richard Jones <richard@users.sourceforge.net>
parents: 54
diff changeset
184 '''%message
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:
96212178c175 Fixed roundup-server for windows, thanks Juergen Hermann.
Richard Jones <richard@users.sourceforge.net>
parents: 290
diff changeset
210 raise ValueError, "Can't change users - no pwd module"
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:
96212178c175 Fixed roundup-server for windows, thanks Juergen Hermann.
Richard Jones <richard@users.sourceforge.net>
parents: 290
diff changeset
214 raise ValueError, "User %s doesn't exist"%user
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:
96212178c175 Fixed roundup-server for windows, thanks Juergen Hermann.
Richard Jones <richard@users.sourceforge.net>
parents: 290
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:
96212178c175 Fixed roundup-server for windows, thanks Juergen Hermann.
Richard Jones <richard@users.sourceforge.net>
parents: 290
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:
c2f287327ca8 server now handles setuid'ing much better
Richard Jones <richard@users.sourceforge.net>
parents: 264
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)
e5e9ea306a09 moving the bin files to facilitate out-of-the-boxness
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
243 print 'Roundup server started on', address
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 $
456
5f3c5c3fd524 sys module went away...
Richard Jones <richard@users.sourceforge.net>
parents: 449
diff changeset
251 # 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
252 # . 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
253 # 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
254 #
449
141aacfdb34f Centralised the python version check code, bumped version to 2.1.1
Richard Jones <richard@users.sourceforge.net>
parents: 431
diff changeset
255 # 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
256 # . 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
257 # 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
258 # 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
259 # . #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
260 # . #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
261 #
141aacfdb34f Centralised the python version check code, bumped version to 2.1.1
Richard Jones <richard@users.sourceforge.net>
parents: 431
diff changeset
262 # 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
263 # 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
264 # 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
265 # 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
266 #
141aacfdb34f Centralised the python version check code, bumped version to 2.1.1
Richard Jones <richard@users.sourceforge.net>
parents: 431
diff changeset
267 # 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
268 #
431
a28a80b714f9 Eliminate database close method by using weakrefs.
Richard Jones <richard@users.sourceforge.net>
parents: 411
diff changeset
269 # 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
270 # Feature:
a28a80b714f9 Eliminate database close method by using weakrefs.
Richard Jones <richard@users.sourceforge.net>
parents: 411
diff changeset
271 # . 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
272 # the instance.
a28a80b714f9 Eliminate database close method by using weakrefs.
Richard Jones <richard@users.sourceforge.net>
parents: 411
diff changeset
273 # . 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
274 # signature info in e-mails.
a28a80b714f9 Eliminate database close method by using weakrefs.
Richard Jones <richard@users.sourceforge.net>
parents: 411
diff changeset
275 # . 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
276 # . 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
277 #
a28a80b714f9 Eliminate database close method by using weakrefs.
Richard Jones <richard@users.sourceforge.net>
parents: 411
diff changeset
278 # Fixed:
a28a80b714f9 Eliminate database close method by using weakrefs.
Richard Jones <richard@users.sourceforge.net>
parents: 411
diff changeset
279 # . 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
280 #
411
a6088556e9ba Features and fixes.
Richard Jones <richard@users.sourceforge.net>
parents: 386
diff changeset
281 # Revision 1.19 2001/11/12 22:51:04 jhermann
a6088556e9ba Features and fixes.
Richard Jones <richard@users.sourceforge.net>
parents: 386
diff changeset
282 # Fixed option & associated error handling
a6088556e9ba Features and fixes.
Richard Jones <richard@users.sourceforge.net>
parents: 386
diff changeset
283 #
386
59ed29a879f6 Fixed option & associated error handling
Jürgen Hermann <jhermann@users.sourceforge.net>
parents: 343
diff changeset
284 # 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
285 # 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
286 # Fixed bugs:
59ed29a879f6 Fixed option & associated error handling
Jürgen Hermann <jhermann@users.sourceforge.net>
parents: 343
diff changeset
287 # . 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
288 # . bug #477107 ] HTTP header problem
59ed29a879f6 Fixed option & associated error handling
Jürgen Hermann <jhermann@users.sourceforge.net>
parents: 343
diff changeset
289 #
343
ab16997d9cda Started work on supporting a pop3-fetching server
Richard Jones <richard@users.sourceforge.net>
parents: 336
diff changeset
290 # 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
291 # 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
292 #
336
b3c103e536ed Fix to CGI top-level index (thanks Juergen Hermann)
Richard Jones <richard@users.sourceforge.net>
parents: 329
diff changeset
293 # 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
294 # 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
295 #
329
96212178c175 Fixed roundup-server for windows, thanks Juergen Hermann.
Richard Jones <richard@users.sourceforge.net>
parents: 290
diff changeset
296 # 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
297 # 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
298 #
290
8230a9a62794 Didn't clean up after myself :)
Richard Jones <richard@users.sourceforge.net>
parents: 288
diff changeset
299 # 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
300 # server now handles setuid'ing much better
8230a9a62794 Didn't clean up after myself :)
Richard Jones <richard@users.sourceforge.net>
parents: 288
diff changeset
301 #
288
c2f287327ca8 server now handles setuid'ing much better
Richard Jones <richard@users.sourceforge.net>
parents: 264
diff changeset
302 # 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
303 # . 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
304 # on the command-line.
c2f287327ca8 server now handles setuid'ing much better
Richard Jones <richard@users.sourceforge.net>
parents: 264
diff changeset
305 # . 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
306 # properties.
c2f287327ca8 server now handles setuid'ing much better
Richard Jones <richard@users.sourceforge.net>
parents: 264
diff changeset
307 # . 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
308 # 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
309 # "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
310 # 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
311 # . 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
312 # . 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
313 # 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
314 # 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
315 # . 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
316 # Ping - has been removed.
c2f287327ca8 server now handles setuid'ing much better
Richard Jones <richard@users.sourceforge.net>
parents: 264
diff changeset
317 # . 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
318 # 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
319 # . 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
320 # an item now throws an exception.
c2f287327ca8 server now handles setuid'ing much better
Richard Jones <richard@users.sourceforge.net>
parents: 264
diff changeset
321 #
264
a671e5917b33 Many features and fixes.
Richard Jones <richard@users.sourceforge.net>
parents: 252
diff changeset
322 # 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
323 # 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
324 # serve.
a671e5917b33 Many features and fixes.
Richard Jones <richard@users.sourceforge.net>
parents: 252
diff changeset
325 #
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
326 # 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
327 # 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
328 #
214
18134bffab37 stupid typo
Richard Jones <richard@users.sourceforge.net>
parents: 213
diff changeset
329 # Revision 1.10 2001/08/07 00:15:51 richard
18134bffab37 stupid typo
Richard Jones <richard@users.sourceforge.net>
parents: 213
diff changeset
330 # 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
331 # Bizar Software.
18134bffab37 stupid typo
Richard Jones <richard@users.sourceforge.net>
parents: 213
diff changeset
332 #
213
d45384bc6420 Added the copyright/license notice to (nearly) all files...
Richard Jones <richard@users.sourceforge.net>
parents: 204
diff changeset
333 # 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
334 # 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
335 # 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
336 #
204
c1461733cbf9 Instances are now opened by a special function...
Richard Jones <richard@users.sourceforge.net>
parents: 193
diff changeset
337 # 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
338 # 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
339 #
193
241a0323aacb Used the much nicer load_package, pointed out by Steve Majewski.
Richard Jones <richard@users.sourceforge.net>
parents: 190
diff changeset
340 # 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
341 # 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
342 # 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
343 # names.
241a0323aacb Used the much nicer load_package, pointed out by Steve Majewski.
Richard Jones <richard@users.sourceforge.net>
parents: 190
diff changeset
344 #
190
996eaf90c01e Instance import now imports the instance using imp.load_module...
Richard Jones <richard@users.sourceforge.net>
parents: 127
diff changeset
345 # 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
346 # 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
347 #
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
348 # 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
349 # 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
350 # 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
351 #
61
820c8bb1b71a Added command-line arg handling to roundup-server...
Richard Jones <richard@users.sourceforge.net>
parents: 54
diff changeset
352 # 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
353 # 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
354 #
54
b68bcb176d1a disabled the reloading until it can be done properly
Richard Jones <richard@users.sourceforge.net>
parents: 52
diff changeset
355 # 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
356 # 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
357 # 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
358 #
52
33bfce110d1e Fixed the ROUNDUPS decl in roundup-server
Richard Jones <richard@users.sourceforge.net>
parents: 32
diff changeset
359 # 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
360 # actually quit if python version wrong
33bfce110d1e Fixed the ROUNDUPS decl in roundup-server
Richard Jones <richard@users.sourceforge.net>
parents: 32
diff changeset
361 #
32
b475e7d3ce52 actually quit if python version wrong
Anthony Baxter <anthonybaxter@users.sourceforge.net>
parents: 27
diff changeset
362 # 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
363 # 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
364 #
27
e5e9ea306a09 moving the bin files to facilitate out-of-the-boxness
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
365 # 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
366 # More Grande Splite stuff
e5e9ea306a09 moving the bin files to facilitate out-of-the-boxness
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
367 #
e5e9ea306a09 moving the bin files to facilitate out-of-the-boxness
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
368 #
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
369 # vim: set filetype=python ts=4 sw=4 et si

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