Edgewall Software

Changes between Version 6 and Version 7 of TracStandalone


Ignore:
Timestamp:
Aug 4, 2005, 3:52:42 PM (19 years ago)
Author:
anonymous
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • TracStandalone

    v6 v7  
    6969
    7070
     71== Generating passwords on Windows ==
     72
     73If you don't have Apache availabel, you can use this Python script to generate your passwords (code borrowed heavily from #845):
     74
     75{{{
     76from optparse import OptionParser
     77import md5
     78
     79# build the options
     80usage = "usage: %prog [options]"
     81parser = OptionParser(usage=usage)
     82parser.add_option("-u", "--username",action="store", dest="username", type = "string",
     83                  help="the username for whom to generate a password")
     84parser.add_option("-p", "--password",action="store", dest="password", type = "string",
     85                  help="the password to use")
     86(options, args) = parser.parse_args()
     87
     88# check options
     89if (options.username is None) or (options.password is None):
     90   parser.error("You must supply both the username and password")
     91   
     92# Generate the string to enter into the htdigest file
     93realm = 'trac'
     94kd = lambda x: md5.md5(':'.join(x)).hexdigest()
     95print ':'.join((options.username, realm, kd([options.username, realm, options.password])))
     96}}}
    7197
    7298----