"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "Tardis/HttpInterface.py" between
Tardis-1.1.1.tar.gz and Tardis-1.1.2.tar.gz

About: Tardis is a system for making encrypted, incremental backups of filesystems.

HttpInterface.py  (Tardis-1.1.1):HttpInterface.py  (Tardis-1.1.2)
# vim: set et sw=4 sts=4 fileencoding=utf-8: # vim: set et sw=4 sts=4 fileencoding=utf-8:
# #
# Tardis: A Backup System # Tardis: A Backup System
# Copyright 2013-2016, Eric Koldinger, All Rights Reserved. # Copyright 2013-2019, Eric Koldinger, All Rights Reserved.
# kolding@washington.edu # kolding@washington.edu
# #
# Redistribution and use in source and binary forms, with or without # Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met: # modification, are permitted provided that the following conditions are met:
# #
# * Redistributions of source code must retain the above copyright # * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer. # notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above copyright # * Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the # notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution. # documentation and/or other materials provided with the distribution.
skipping to change at line 155 skipping to change at line 155
return response return response
@app.route('/login', methods=['GET', 'POST']) @app.route('/login', methods=['GET', 'POST'])
def login(): def login():
if request.method == 'POST': if request.method == 'POST':
try: try:
#app.logger.debug(str(request)) #app.logger.debug(str(request))
host = request.form['host'] host = request.form['host']
dbPath = os.path.join(args.database, host, dbname) dbPath = os.path.join(args.database, host, dbname)
cache = CacheDir.CacheDir(os.path.join(args.database, host), creat e=False) cache = CacheDir.CacheDir(os.path.join(args.database, host), creat e=False)
upgrade = config.getboolean('Tardis', 'AllowSchemaUpgrades') upgrade = config.getboolean('Remote', 'AllowSchemaUpgrades')
tardis = TardisDB.TardisDB(dbPath, allow_upgrade=upgrade) tardis = TardisDB.TardisDB(dbPath, allow_upgrade=upgrade)
#session['tardis'] = tardis #session['tardis'] = tardis
session['host'] = host session['host'] = host
#app.logger.debug(str(session)) #app.logger.debug(str(session))
dbs[host] = tardis dbs[host] = tardis
caches[host] = cache caches[host] = cache
if tardis.needsAuthentication(): if tardis.needsAuthentication():
status = 'AUTH' status = 'AUTH'
else: else:
skipping to change at line 520 skipping to change at line 520
'rounds': rounds, 'rounds': rounds,
} }
return createResponse(j) return createResponse(j)
def processArgs(): def processArgs():
parser = argparse.ArgumentParser(description='Tardis HTTP Data Server', form atter_class=Util.HelpFormatter, add_help=False) parser = argparse.ArgumentParser(description='Tardis HTTP Data Server', form atter_class=Util.HelpFormatter, add_help=False)
parser.add_argument('--config', dest='config', default=configName, h elp="Location of the configuration file (Default: %(default)s)") parser.add_argument('--config', dest='config', default=configName, h elp="Location of the configuration file (Default: %(default)s)")
(args, remaining) = parser.parse_known_args() (args, remaining) = parser.parse_known_args()
t = 'Tardis' t = 'Remote'
config = configparser.ConfigParser(configDefaults) config = configparser.ConfigParser(configDefaults, default_section='Tardis')
config.add_section(t) # Make it safe for reading other val ues from. config.add_section(t) # Make it safe for reading other val ues from.
config.read(args.config) config.read(args.config)
parser.add_argument('--port', dest='port', default= config.getint(t, 'Port'), type=int, help='Listen on port (Default: %(default)s)' ) parser.add_argument('--port', dest='port', default= config.getint(t, 'Port'), type=int, help='Listen on port (Default: %(default)s)' )
parser.add_argument('--dbname', dest='dbname', default= config.get(t, 'DBName'), help='Use the database name (Default: %(default)s)') parser.add_argument('--dbname', dest='dbname', default= config.get(t, 'DBName'), help='Use the database name (Default: %(default)s)')
parser.add_argument('--database', dest='database', default= config.get(t, 'Database'), help='Database Directory (Default: %(default)s)') parser.add_argument('--database', dest='database', default= config.get(t, 'Database'), help='Database Directory (Default: %(default)s)')
parser.add_argument('--logfile', '-l', dest='logfile', default= config.get(t, 'LogFile'), help='Log to file (Default: %(default)s)') parser.add_argument('--logfile', '-l', dest='logfile', default= config.get(t, 'LogFile'), help='Log to file (Default: %(default)s)')
parser.add_argument('--verbose', '-v', dest='verbose', action=' count', default=config.getint(t, 'Verbose'), help='Increase the verbosity (may b e repeated)') parser.add_argument('--verbose', '-v', dest='verbose', action=' count', default=config.getint(t, 'Verbose'), help='Increase the verbosity (may b e repeated)')
parser.add_argument('--exceptions', dest='exceptions', action=U til.StoreBoolean, default=config.getboolean(t, 'LogExceptions'), help='Log full exception details') parser.add_argument('--exceptions', dest='exceptions', action=U til.StoreBoolean, default=config.getboolean(t, 'LogExceptions'), help='Log full exception details')
 End of changes. 3 change blocks. 
4 lines changed or deleted 4 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)