| | 32 | htdigest authentication can also be used for more than one project. |
| | 33 | The digest file can be shared: |
| | 34 | {{{ |
| | 35 | $ tracd -p 8080 \ |
| | 36 | --auth project1,/tmp/users.htdigest,mycompany.com \ |
| | 37 | --auth project2,/tmp/users.htdigest,mycompany.com \ |
| | 38 | /path/to/project1 /path/to/project2 |
| | 39 | }}} |
| | 40 | |
| | 41 | == Tracd on Windows == |
| | 42 | |
| | 43 | tracd also works on Windows. But on that platform, |
| | 44 | the sensitivity on multithread issues is high. |
| | 45 | tracd is not (yet!) very robust in multithread mode, |
| | 46 | see for example #1401 and #1721 for some of the issues... |
| | 47 | |
| | 48 | I recently found out that all the occasional problems |
| | 49 | (i.e. crashes) I had can be avoided by telling tracd |
| | 50 | to operate in single-threaded mode: |
| | 51 | {{{ |
| | 52 | #!text/x-diff |
| | 53 | Index: trac/web/standalone.py |
| | 54 | =================================================================== |
| | 55 | --- trac/web/standalone.py (revision 1862) |
| | 56 | +++ trac/web/standalone.py (working copy) |
| | 57 | @@ -124,7 +124,7 @@ |
| | 58 | return auth['username'] |
| | 61 | -class TracHTTPServer(ThreadingMixIn, HTTPServer): |
| | 62 | +class TracHTTPServer(HTTPServer): |
| | 63 | |
| | 64 | projects = None |
| | 65 | }}} |
| | 66 | |
| | 67 | == Generating passwords on Windows == |
| | 68 | |
| | 69 | If you don't have Apache available, you can use this Python script to generate your passwords (code borrowed heavily from #845): |
| | 70 | |
| | 71 | {{{ |
| | 72 | from optparse import OptionParser |
| | 73 | import md5 |
| | 74 | |
| | 75 | # build the options |
| | 76 | usage = "usage: %prog [options]" |
| | 77 | parser = OptionParser(usage=usage) |
| | 78 | parser.add_option("-u", "--username",action="store", dest="username", type = "string", |
| | 79 | help="the username for whom to generate a password") |
| | 80 | parser.add_option("-p", "--password",action="store", dest="password", type = "string", |
| | 81 | help="the password to use") |
| | 82 | (options, args) = parser.parse_args() |
| | 83 | |
| | 84 | # check options |
| | 85 | if (options.username is None) or (options.password is None): |
| | 86 | parser.error("You must supply both the username and password") |
| | 87 | |
| | 88 | # Generate the string to enter into the htdigest file |
| | 89 | realm = 'trac' |
| | 90 | kd = lambda x: md5.md5(':'.join(x)).hexdigest() |
| | 91 | print ':'.join((options.username, realm, kd([options.username, realm, options.password]))) |
| | 92 | }}} |
| | 93 | |