Example #1
0
    def __init__(self, section, cfgfile="tor2web.conf"):
        Storage.__init__(self)

        self._cfgfile = cfgfile
        self._cfgparser = ConfigParser.ConfigParser()
        self._cfgparser.read([self._cfgfile])
        self._section = section
Example #2
0
    def __init__(self, section, cfgfile="tor2web.conf"):
        Storage.__init__(self)

        self._cfgfile = cfgfile
        self._cfgparser = ConfigParser.ConfigParser()
        self._cfgparser.read([self._cfgfile])
        self._section = section
 def __init__(
     self,
     db=None,
     tablename='web2py_ticket'
 ):
     Storage.__init__(self)
     self.db = db
     self.tablename = tablename
Example #4
0
 def __init__(
     self,
     db=None,
     tablename='web2py_ticket'
 ):
     Storage.__init__(self)
     self.db = db
     self.tablename = tablename
Example #5
0
 def __init__(self, config={}):
     '''
     config["path"] should contain the directory of where to read and write
     data to
     '''
     Storage.__init__(self, config)
     if type(config) is dict and config["path"] is not None:
         self.pickle_filepath = config["path"]
     else:
         self.pickle_filepath = "/tmp/pickle.pickle"
Example #6
0
 def __init__(self, config={}):
     '''
     config["path"] should contain the directory of where to read and write
     data to
     '''
     Storage.__init__(self, config)
     if type(config) is dict and config["path"] is not None:
         self.pickle_filepath = config["path"]
     else:
         self.pickle_filepath = "/tmp/pickle.pickle"
Example #7
0
 def __init__(self, cfgfile="/etc/tor2web.conf"):
     Storage.__init__(self)
     self._file = cfgfile
     self._section = 'main'
     self._parser = ConfigParser.ConfigParser()
             
     self.__dict__['nodename'] = 'tor2web'
     self.__dict__['datadir'] = '/home/tor2web'
     self.__dict__['logreqs'] = False
     self.__dict__['debugmode'] = False
     self.__dict__['debugtostdout'] = False
     self.__dict__['processes'] = 1
     self.__dict__['requests_per_process'] = 1000000
     self.__dict__['transport'] = 'BOTH'
     self.__dict__['listen_ipv4'] = '127.0.0.1'
     self.__dict__['listen_ipv6'] = None
     self.__dict__['listen_port_http'] = 80
     self.__dict__['listen_port_https'] = 443
     self.__dict__['basehost'] = 'tor2web.org'
     self.__dict__['sockshost'] = '127.0.0.1'
     self.__dict__['socksport'] = 9050
     self.__dict__['socksoptimisticdata'] = True
     self.__dict__['sockmaxpersistentperhost'] = 5
     self.__dict__['sockcachedconnectiontimeout'] = 240
     self.__dict__['sockretryautomatically'] = True
     self.__dict__['cipher_list'] = 'ECDHE-RSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-SHA384:' \
                                    'ECDHE-RSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-SHA256:' \
                                    'ECDHE-RSA-AES256-SHA:DHE-DSS-AES256-SHA:DHE-RSA-AES128-SHA:' \
                                    'DES-CBC3-SHA' # this last one (not FS) is kept only for
                                                   # compatibility reasons :/
     self.__dict__['mode'] = 'BLACKLIST'
     self.__dict__['onion'] = None
     self.__dict__['blockcrawl'] = True
     self.__dict__['overriderobotstxt'] = True
     self.__dict__['disable_banner'] = False
     self.__dict__['smtp_user'] = ''
     self.__dict__['smtp_pass'] = ''
     self.__dict__['smtp_mail'] = ''
     self.__dict__['smtpmailto_exceptions'] = ''
     self.__dict__['smtpmailto_notifications'] = ''
     self.__dict__['smtpdomain'] = ''
     self.__dict__['smtpport'] = 587
     self.__dict__['exit_node_list_refresh'] = 600
     self.__dict__['automatic_blocklist_updates_source'] = ''
     self.__dict__['automatic_blocklist_updates_refresh'] = 600
     self.__dict__['mirror'] = []
     self.__dict__['dummyproxy'] = None
Example #8
0
    def __init__(self, cfgfile="/etc/tor2web.conf"):
        Storage.__init__(self)
        self._file = cfgfile
        self._section = 'main'
        self._parser = ConfigParser.ConfigParser()

        self.__dict__['nodename'] = 'tor2web'
        self.__dict__['datadir'] = '/home/tor2web'
        self.__dict__['logreqs'] = False
        self.__dict__['debugmode'] = False
        self.__dict__['debugtostdout'] = False
        self.__dict__['processes'] = 1
        self.__dict__['requests_per_process'] = 1000000
        self.__dict__['transport'] = 'BOTH'
        self.__dict__['listen_ipv4'] = '127.0.0.1'
        self.__dict__['listen_ipv6'] = None
        self.__dict__['listen_port_http'] = 80
        self.__dict__['listen_port_https'] = 443
        self.__dict__['basehost'] = 'tor2web.org'
        self.__dict__['sockshost'] = '127.0.0.1'
        self.__dict__['socksport'] = 9050
        self.__dict__['socksoptimisticdata'] = True
        self.__dict__['sockmaxpersistentperhost'] = 5
        self.__dict__['sockcachedconnectiontimeout'] = 240
        self.__dict__['sockretryautomatically'] = True
        self.__dict__['cipher_list'] = 'ECDHE-RSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-SHA384:' \
                                       'ECDHE-RSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-SHA256:' \
                                       'ECDHE-RSA-AES256-SHA:DHE-DSS-AES256-SHA:DHE-RSA-AES128-SHA:' \
                                       'DES-CBC3-SHA' # this last one (not FS) is kept only for
        # compatibility reasons :/
        self.__dict__['mode'] = 'BLACKLIST'
        self.__dict__['onion'] = None
        self.__dict__['blockcrawl'] = True
        self.__dict__['overriderobotstxt'] = True
        self.__dict__['disable_banner'] = False
        self.__dict__['smtp_user'] = ''
        self.__dict__['smtp_pass'] = ''
        self.__dict__['smtp_mail'] = ''
        self.__dict__['smtpmailto_exceptions'] = ''
        self.__dict__['smtpmailto_notifications'] = ''
        self.__dict__['smtpdomain'] = ''
        self.__dict__['smtpport'] = 587
        self.__dict__['exit_node_list_refresh'] = 600
        self.__dict__['automatic_blocklist_updates_source'] = ''
        self.__dict__['automatic_blocklist_updates_refresh'] = 600
        self.__dict__['mirror'] = []
        self.__dict__['dummyproxy'] = None
Example #9
0
    def __init__(self, cfgfile="/etc/tor2web.conf"):
        Storage.__init__(self)
        self._file = cfgfile
        self._section = 'main'
        self._parser = ConfigParser.ConfigParser()

        self.__dict__['nodename'] = 'tor2web'
        self.__dict__['datadir'] = '/home/tor2web'
        self.__dict__['logreqs'] = False
        self.__dict__['debugmode'] = False
        self.__dict__['debugtostdout'] = False
        self.__dict__['processes'] = 1
        self.__dict__['requests_per_process'] = 200
        self.__dict__['transport'] = 'BOTH'
        self.__dict__['listen_ipv4'] = '127.0.0.1'
        self.__dict__['listen_ipv6'] = None
        self.__dict__['listen_port_http'] = 80
        self.__dict__['listen_port_https'] = 443
        self.__dict__['basehost'] = 'tor2web.org'
        self.__dict__['sockshost'] = '127.0.0.1'
        self.__dict__['socksport'] = 9050
        self.__dict__['socksoptimistidata'] = True
        self.__dict__['sockmaxpersistentperhost'] = 5
        self.__dict__['sockcachedconnectiontimeout'] = 240
        self.__dict__['sockretryautomatically'] = True
        self.__dict__[
            'cipher_list'] = 'DHE-RSA-AES256-SHA:DHE-DSS-AES256-SHA:RC4-SHA'
        self.__dict__['mode'] = 'BLACKLIST'
        self.__dict__['onion'] = None
        self.__dict__['blockcrawl'] = True
        self.__dict__['overriderobotstxt'] = True
        self.__dict__['disable_banner'] = False
        self.__dict__['smtp_user'] = ''
        self.__dict__['smtp_pass'] = ''
        self.__dict__['smtp_mail'] = ''
        self.__dict__['smtpmailto_exceptions'] = ''
        self.__dict__['smtpmailto_notifications'] = ''
        self.__dict__['smtpdomain'] = ''
        self.__dict__['smtpport'] = 587
        self.__dict__['exit_node_list_refresh'] = 600
        self.__dict__['automatic_blocklist_updates_source'] = ''
        self.__dict__['automatic_blocklist_updates_refresh'] = 600
        self.__dict__['mirrors'] = [
            'tor2web.org, tor2web.fi', 'tor2web.blutmagie.de', 'onion.sh',
            'onion.to'
        ]
Example #10
0
 def __init__(self, cfgfile="/etc/tor2web.conf"):
     Storage.__init__(self)
     self._file = cfgfile
     self._section = 'main'
     self._parser = ConfigParser.ConfigParser()
             
     self.__dict__['nodename'] = 'tor2web'
     self.__dict__['datadir'] = '/home/tor2web'
     self.__dict__['logreqs'] = False
     self.__dict__['debugmode'] = False
     self.__dict__['debugtostdout'] = False
     self.__dict__['processes'] = 1
     self.__dict__['requests_per_process'] = 200
     self.__dict__['transport'] = 'BOTH'
     self.__dict__['listen_ipv4'] = '127.0.0.1'
     self.__dict__['listen_ipv6'] = None
     self.__dict__['listen_port_http'] = 80
     self.__dict__['listen_port_https'] = 443
     self.__dict__['basehost'] = 'tor2web.org'
     self.__dict__['sockshost'] = '127.0.0.1'
     self.__dict__['socksport'] = 9050
     self.__dict__['socksoptimistidata'] = True
     self.__dict__['sockmaxpersistentperhost'] = 5
     self.__dict__['sockcachedconnectiontimeout'] = 240
     self.__dict__['sockretryautomatically'] = True
     self.__dict__['cipher_list'] = 'DHE-RSA-AES256-SHA:DHE-DSS-AES256-SHA:RC4-SHA'
     self.__dict__['mode'] = 'BLACKLIST'
     self.__dict__['onion'] = None
     self.__dict__['blockcrawl'] = True
     self.__dict__['overriderobotstxt'] = True
     self.__dict__['disable_banner'] = False
     self.__dict__['smtp_user'] = ''
     self.__dict__['smtp_pass'] = ''
     self.__dict__['smtp_mail'] = ''
     self.__dict__['smtpmailto_exceptions'] = ''
     self.__dict__['smtpmailto_notifications'] = ''
     self.__dict__['smtpdomain'] = ''
     self.__dict__['smtpport'] = 587
     self.__dict__['exit_node_list_refresh'] = 600
     self.__dict__['automatic_blocklist_updates_source'] = ''
     self.__dict__['automatic_blocklist_updates_refresh'] = 600
     self.__dict__['mirrors'] = ['tor2web.org, tor2web.fi',
                                 'tor2web.blutmagie.de',
                                 'onion.sh',
                                 'onion.to']
Example #11
0
 def __init__(self):
     Storage.__init__(self)
     self.env = Storage()
     self.cookies = Cookie.SimpleCookie()
     self.get_vars = Storage()
     self.post_vars = Storage()
     self.vars = Storage()
     self.folder = None
     self.application = None
     self.function = None
     self.args = List()
     self.extension = 'html'
     self.now = datetime.datetime.now()
     self.utcnow = datetime.datetime.utcnow()
     self.is_restful = False
     self.is_https = False
     self.is_local = False
     self.global_settings = settings.global_settings
Example #12
0
 def __init__(self):
     Storage.__init__(self)
     self.env = Storage()
     self.cookies = Cookie.SimpleCookie()
     self.get_vars = Storage()
     self.post_vars = Storage()
     self.vars = Storage()
     self.folder = None
     self.application = None
     self.function = None
     self.args = List()
     self.extension = 'html'
     self.now = datetime.datetime.now()
     self.utcnow = datetime.datetime.utcnow()
     self.is_restful = False
     self.is_https = False
     self.is_local = False
     self.global_settings = settings.global_settings
Example #13
0
 def __init__(self, env):
     Storage.__init__(self)
     self.env = Storage(env)
     self.env.web2py_path = global_settings.applications_parent
     self.env.update(global_settings)
     self.cookies = Cookie.SimpleCookie()
     self._get_vars = None
     self._post_vars = None
     self._vars = None
     self.folder = None
     self.application = None
     self.function = None
     self.args = List()
     self.extension = "html"
     self.now = datetime.datetime.now()
     self.utcnow = datetime.datetime.utcnow()
     self.is_restful = False
     self.is_https = False
     self.is_local = False
     self.global_settings = settings.global_settings
Example #14
0
 def __init__(self):
     Storage.__init__(self)
     self.status = 200
     self.headers = dict()
     self.headers['X-Powered-By'] = 'web2py'
     self.body = cStringIO.StringIO()
     self.session_id = None
     self.cookies = Cookie.SimpleCookie()
     self.postprocessing = []
     self.flash = ''  # used by the default view layout
     self.meta = Storage()  # used by web2py_ajax.html
     self.menu = []  # used by the default view layout
     self.files = []  # used by web2py_ajax.html
     self.generic_patterns = []  # patterns to allow generic views
     self.delimiters = ('{{', '}}')
     self._vars = None
     self._caller = lambda f: f()
     self._view_environment = None
     self._custom_commit = None
     self._custom_rollback = None
Example #15
0
 def __init__(self):
     Storage.__init__(self)
     self.status = 200
     self.headers = dict()
     self.headers['X-Powered-By'] = 'web2py'
     self.body = cStringIO.StringIO()
     self.session_id = None
     self.cookies = Cookie.SimpleCookie()
     self.postprocessing = []
     self.flash = ''            # used by the default view layout
     self.meta = Storage()      # used by web2py_ajax.html
     self.menu = []             # used by the default view layout
     self.files = []            # used by web2py_ajax.html
     self.generic_patterns = []  # patterns to allow generic views
     self.delimiters = ('{{', '}}')
     self._vars = None
     self._caller = lambda f: f()
     self._view_environment = None
     self._custom_commit = None
     self._custom_rollback = None
Example #16
0
 def __init__(self, env):
     Storage.__init__(self)
     self.env = Storage(env)
     self.env.web2py_path = global_settings.applications_parent
     self.env.update(global_settings)
     self.cookies = Cookie.SimpleCookie()
     self._get_vars = None
     self._post_vars = None
     self._vars = None
     self.folder = None
     self.application = None
     self.function = None
     self.args = List()
     self.extension = 'html'
     self.now = datetime.datetime.now()
     self.utcnow = datetime.datetime.utcnow()
     self.is_restful = False
     self.is_https = False
     self.is_local = False
     self.global_settings = settings.global_settings
Example #17
0
 def __init__(self):
     """
     Create an storage instance passing an Amazon S3 connection
     """
     Storage.__init__(self, Connection().s3_connection())
Example #18
0
 def __init__ (self, id, fchosts, vcenter):
     Storage.__init__(self, id, fchosts)
     self.vcenter_id = ''
     if vcenter:
         self.vcenter = VCenter(vcenter)
         self.vcenter_id = vcenter
Example #19
0
    def __init__(self, file_name):
        Storage.__init__(self, file_name)

        self.load()
Example #20
0
    def __init__(self):
        Storage.__init__(self)
        self._section = 'main'
        self._parser = ConfigParser.ConfigParser()

        parser = OptionParser()
        parser.add_option("-c", "--configfile", dest="configfile", default="/etc/tor2web.conf")
        parser.add_option("-p", "--pidfile", dest="pidfile", default='/var/run/tor2web/t2w.pid')
        parser.add_option("-u", "--uid", dest="uid", default='')
        parser.add_option("-g", "--gid", dest="gid", default='')
        parser.add_option("-n", "--nodaemon", dest="nodaemon", default=False, action="store_true")
        parser.add_option("-d", "--rundir", dest="rundir", default='/var/run/tor2web/')
        parser.add_option("-x", "--command", dest="command", default='start')
        (options, args) = parser.parse_args()

        self._file = options.configfile

        self.__dict__['configfile'] = options.configfile
        self.__dict__['pidfile'] = options.pidfile
        self.__dict__['uid'] = options.uid
        self.__dict__['gid'] = options.gid
        self.__dict__['nodaemon'] = options.nodaemon
        self.__dict__['command'] = options.command
        self.__dict__['nodename'] = 'tor2web'
        self.__dict__['datadir'] = '/home/tor2web'
        self.__dict__['ssl_key'] = os.path.join(self.__dict__['datadir'], "certs/tor2web-key.pem")
        self.__dict__['ssl_cert'] = os.path.join(self.__dict__['datadir'], "certs/tor2web-intermediate.pem")
        self.__dict__['ssl_dh'] = os.path.join(self.__dict__['datadir'], "certs/tor2web-dh.pem")
        self.__dict__['rundir'] = options.rundir
        self.__dict__['logreqs'] = False
        self.__dict__['debugmode'] = False
        self.__dict__['debugtostdout'] = False
        self.__dict__['processes'] = 1
        self.__dict__['requests_per_process'] = 1000000
        self.__dict__['transport'] = 'BOTH'
        self.__dict__['listen_ipv4'] = '127.0.0.1'
        self.__dict__['listen_ipv6'] = None
        self.__dict__['listen_port_http'] = 80
        self.__dict__['listen_port_https'] = 443
        self.__dict__['basehost'] = 'tor2web.org'
        self.__dict__['sockshost'] = '127.0.0.1'
        self.__dict__['socksport'] = 9050
        self.__dict__['socksoptimisticdata'] = True
        self.__dict__['sockmaxpersistentperhost'] = 5
        self.__dict__['sockcachedconnectiontimeout'] = 240
        self.__dict__['sockretryautomatically'] = True
        self.__dict__['cipher_list'] = 'ECDHE-RSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-SHA384:' \
                                       'ECDHE-RSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-SHA256:' \
                                       'ECDHE-RSA-AES256-SHA:DHE-DSS-AES256-SHA:DHE-RSA-AES128-SHA:' \
                                       'DES-CBC3-SHA' # this last one (not FS) is kept only for
                                                      # compatibility reasons :/
        self.__dict__['mode'] = 'BLACKLIST'
        self.__dict__['onion'] = None
        self.__dict__['blockcrawl'] = True
        self.__dict__['overriderobotstxt'] = True
        self.__dict__['blockhotlinking'] = True
        self.__dict__['blockhotlinking_exts'] = ['jpg', 'png', 'gif']
        self.__dict__['disable_disclaimer'] = False
        self.__dict__['disable_banner'] = False
        self.__dict__['smtp_user'] = ''
        self.__dict__['smtp_pass'] = ''
        self.__dict__['smtp_mail'] = ''
        self.__dict__['smtpmailto_exceptions'] = '*****@*****.**'
        self.__dict__['smtpmailto_notifications'] = '*****@*****.**'
        self.__dict__['smtpdomain'] = ''
        self.__dict__['smtpport'] = 587
        self.__dict__['exit_node_list_refresh'] = 600
        self.__dict__['automatic_blocklist_updates_source'] = ''
        self.__dict__['automatic_blocklist_updates_refresh'] = 600
        self.__dict__['automatic_blocklist_updates_mode'] = "MERGE"
        self.__dict__['publish_lists'] = False
        self.__dict__['mirror'] = []
        self.__dict__['dummyproxy'] = None

        # Development VS. Production
        localpath = os.path.abspath(os.path.join(os.path.dirname(sys.argv[0]), "..", "data"))
        if os.path.exists(localpath):
            self.__dict__['sysdatadir'] = localpath
        else:
            self.__dict__['sysdatadir'] = '/usr/share/tor2web'

        self.load()
Example #21
0
 def __init__(self, filename):
     Storage.__init__(self, filename)
     pass
Example #22
0
 def __init__(self):
     """
     Create an storage instance with an OpenStack (Swift) storage connection
     """
     Storage.__init__(self, Connection().openstack_swift_connection())
Example #23
0
 def __init__(self, cfgfile="/etc/tor2web.conf"):
     Storage.__init__(self)
     self._file = cfgfile
     self._section = 'main'
     self._parser = ConfigParser.ConfigParser()
Example #24
0
 def __init__(self, filename, max_items=10):
     Storage.__init__(self, filename, max_item_count=max_items)
     pass
Example #25
0
 def __init__(self, filename, max_items=10):
     Storage.__init__(self, filename, max_item_count=max_items)
     pass
Example #26
0
    def __init__(self, filename, max_file_size_kb=-1):
        Storage.__init__(self, filename, max_file_size_kb=max_file_size_kb)

        self._enabled = True
        pass
Example #27
0
    def __init__(self, filename, max_file_size_kb=-1):
        Storage.__init__(self, filename, max_file_size_kb=max_file_size_kb)

        self._enabled = True
        pass
Example #28
0
 def __init__(self, cfgfile="/etc/tor2web.conf"):
     Storage.__init__(self)
     self._file = cfgfile
     self._section = 'main'
     self._parser = ConfigParser.ConfigParser()
Example #29
0
 def __init__(self):
     """
     Create an storage instance passing an Amazon S3 connection
     """
     Storage.__init__(self, Connection().s3_connection())
Example #30
0
    def __init__(self, file_name):
        Storage.__init__(self)

        self.file_name = file_name
Example #31
0
    def __init__(self):
        Storage.__init__(self)
        self._section = 'main'
        self._parser = ConfigParser.ConfigParser()

        parser = OptionParser()
        parser.add_option("-c", "--configfile", dest="configfile", default="/etc/tor2web.conf")
        parser.add_option("-p", "--pidfile", dest="pidfile", default='/var/run/tor2web/t2w.pid')
        parser.add_option("-u", "--uid", dest="uid", default='')
        parser.add_option("-g", "--gid", dest="gid", default='')
        parser.add_option("-n", "--nodaemon", dest="nodaemon", default=False, action="store_true")
        parser.add_option("-d", "--rundir", dest="rundir", default='/var/run/tor2web/')
        parser.add_option("-x", "--command", dest="command", default='start')
        options, _ = parser.parse_args()

        self._file = options.configfile

        self.__dict__['configfile'] = options.configfile
        self.__dict__['pidfile'] = options.pidfile
        self.__dict__['uid'] = options.uid
        self.__dict__['gid'] = options.gid
        self.__dict__['nodaemon'] = options.nodaemon
        self.__dict__['command'] = options.command
        self.__dict__['nodename'] = 'tor2web'
        self.__dict__['datadir'] = '/home/tor2web'
        self.__dict__['sysdatadir'] = '/usr/share/tor2web/data'
        self.__dict__['ssl_key'] = None
        self.__dict__['ssl_cert'] = None
        self.__dict__['ssl_intermediate'] = None
        self.__dict__['ssl_dh'] = None
        self.__dict__['rundir'] = options.rundir
        self.__dict__['logreqs'] = False
        self.__dict__['debugmode'] = False
        self.__dict__['debugtostdout'] = False
        self.__dict__['processes'] = 1
        self.__dict__['requests_per_process'] = 1000000
        self.__dict__['transport'] = 'BOTH'
        self.__dict__['listen_ipv4'] = '127.0.0.1'
        self.__dict__['listen_ipv6'] = None
        self.__dict__['listen_port_http'] = 80
        self.__dict__['listen_port_https'] = 443
        self.__dict__['basehost'] = 'tor2web.org'
        self.__dict__['sockshost'] = '127.0.0.1'
        self.__dict__['socksport'] = 9050
        self.__dict__['socksoptimisticdata'] = True
        self.__dict__['sockmaxpersistentperhost'] = 5
        self.__dict__['sockcachedconnectiontimeout'] = 240
        self.__dict__['sockretryautomatically'] = True
        self.__dict__['cipher_list'] = 'ECDHE-RSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-SHA384:' \
                                       'ECDHE-RSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-SHA256:' \
                                       'ECDHE-RSA-AES256-SHA:DHE-DSS-AES256-SHA:DHE-RSA-AES128-SHA:'
        self.__dict__['ssl_tofu_cache_size'] = 100
        self.__dict__['mode'] = 'BLOCKLIST'
        self.__dict__['onion'] = None
        self.__dict__['blockcrawl'] = True
        self.__dict__['overriderobotstxt'] = True
        self.__dict__['blockhotlinking'] = True
        self.__dict__['blockhotlinking_exts'] = ['jpg', 'png', 'gif']
        self.__dict__['deny_caching'] = True
        self.__dict__['extra_http_response_headers'] = None
        self.__dict__['disable_disclaimer'] = False
        self.__dict__['disable_banner'] = False
        self.__dict__['disable_tor_redirection'] = False
        self.__dict__['disable_gettor'] = False
        self.__dict__['avoid_rewriting_visible_content'] = False
        self.__dict__['smtpuser'] = '******'
        self.__dict__['smtppass'] = '******'
        self.__dict__['smtpmail'] = '*****@*****.**'
        self.__dict__['smtpmailto_exceptions'] = '*****@*****.**'
        self.__dict__['smtpmailto_notifications'] = '*****@*****.**'
        self.__dict__['smtpdomain'] = 'demo.globaleaks.org'
        self.__dict__['smtpport'] = 9267
        self.__dict__['smtpsecurity'] = 'TLS'
        self.__dict__['exit_node_list_refresh'] = 600
        self.__dict__['automatic_blocklist_updates_source'] = ''
        self.__dict__['automatic_blocklist_updates_refresh'] = 600
        self.__dict__['automatic_blocklist_updates_mode'] = "MERGE"
        self.__dict__['publish_lists'] = False
        self.__dict__['mirror'] = []
        self.__dict__['dummyproxy'] = None
        self.__dict__['proto'] = 'http://' if self.__dict__['transport'] == 'HTTP' else 'https://'
        self.__dict__['bufsize'] = 4096

        # Development VS. Production
        localpath = os.path.abspath(os.path.join(os.path.dirname(sys.argv[0]), "..", "data"))
        if os.path.exists(localpath):
            self.__dict__['sysdatadir'] = localpath

        self.load()

        if self.__dict__['ssl_key'] is None:
            self.__dict__['ssl_key'] = os.path.join(self.__dict__['datadir'], "certs/tor2web-key.pem")

        if self.__dict__['ssl_cert'] is None:
            self.__dict__['ssl_cert'] = os.path.join(self.__dict__['datadir'], "certs/tor2web-cert.pem")

        if self.__dict__['ssl_intermediate'] is None:
            self.__dict__['ssl_intermediate'] = os.path.join(self.__dict__['datadir'], "certs/tor2web-intermediate.pem")

        if self.__dict__['ssl_dh'] is None:
            self.__dict__['ssl_dh'] = os.path.join(self.__dict__['datadir'], "certs/tor2web-dh.pem")

        if self.__dict__['mode'] == 'BLACKLIST':
            self.__dict__['mode'] = 'BLOCKLIST'
Example #32
0
    def __init__(self):
        Storage.__init__(self)
        self._section = 'main'
        self._parser = ConfigParser.ConfigParser()

        parser = OptionParser()
        parser.add_option("-c", "--configfile", dest="configfile", default="/etc/tor2web.conf")
        parser.add_option("-p", "--pidfile", dest="pidfile", default='/var/run/tor2web/t2w.pid')
        parser.add_option("-u", "--uid", dest="uid", default='')
        parser.add_option("-g", "--gid", dest="gid", default='')
        parser.add_option("-n", "--nodaemon", dest="nodaemon", default=False, action="store_true")
        parser.add_option("-d", "--rundir", dest="rundir", default='/var/run/tor2web/')
        parser.add_option("-x", "--command", dest="command", default='start')
        options, _ = parser.parse_args()

        self._file = options.configfile

        self.__dict__['configfile'] = options.configfile
        self.__dict__['pidfile'] = options.pidfile
        self.__dict__['uid'] = options.uid
        self.__dict__['gid'] = options.gid
        self.__dict__['nodaemon'] = options.nodaemon
        self.__dict__['command'] = options.command
        self.__dict__['nodename'] = 'tor2web'
        self.__dict__['datadir'] = '/home/tor2web'
        self.__dict__['sysdatadir'] = '/usr/share/tor2web/data'
        self.__dict__['ssl_key'] = None
        self.__dict__['ssl_cert'] = None
        self.__dict__['ssl_intermediate'] = None
        self.__dict__['ssl_dh'] = None
        self.__dict__['rundir'] = options.rundir
        self.__dict__['logreqs'] = False
        self.__dict__['debugmode'] = False
        self.__dict__['debugtostdout'] = False
        self.__dict__['processes'] = 1
        self.__dict__['requests_per_process'] = 1000000
        self.__dict__['transport'] = 'BOTH'
        self.__dict__['listen_ipv4'] = '127.0.0.1'
        self.__dict__['listen_ipv6'] = None
        self.__dict__['listen_port_http'] = 80
        self.__dict__['listen_port_https'] = 443
        self.__dict__['basehost'] = 'AUTO'
        self.__dict__['sockshost'] = '127.0.0.1'
        self.__dict__['socksport'] = 9050
        self.__dict__['socksoptimisticdata'] = True
        self.__dict__['sockmaxpersistentperhost'] = 5
        self.__dict__['sockcachedconnectiontimeout'] = 240
        self.__dict__['sockretryautomatically'] = True
        self.__dict__['cipher_list'] = 'ECDHE-RSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-SHA384:' \
                                       'ECDHE-RSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-SHA256:' \
                                       'ECDHE-RSA-AES256-SHA:DHE-DSS-AES256-SHA:DHE-RSA-AES128-SHA:'
        self.__dict__['ssl_tofu_cache_size'] = 100
        self.__dict__['mode'] = 'BLOCKLIST'
        self.__dict__['onion'] = None
        self.__dict__['blockhotlinking'] = True
        self.__dict__['blockhotlinking_exts'] = ['jpg', 'png', 'gif']
        self.__dict__['extra_http_response_headers'] = None
        self.__dict__['disable_disclaimer'] = False
        self.__dict__['disable_banner'] = False
        self.__dict__['disable_tor_redirection'] = False
        self.__dict__['disable_gettor'] = False
        self.__dict__['avoid_rewriting_visible_content'] = False
        self.__dict__['smtpuser'] = '******'
        self.__dict__['smtppass'] = '******'
        self.__dict__['smtpmail'] = '*****@*****.**'
        self.__dict__['smtpmailto_exceptions'] = '*****@*****.**'
        self.__dict__['smtpmailto_notifications'] = '*****@*****.**'
        self.__dict__['smtpdomain'] = 'demo.globaleaks.org'
        self.__dict__['smtpport'] = 9267
        self.__dict__['smtpsecurity'] = 'TLS'
        self.__dict__['exit_node_list_refresh'] = 600
        self.__dict__['automatic_blocklist_updates_source'] = ''
        self.__dict__['automatic_blocklist_updates_refresh'] = 600
        self.__dict__['automatic_blocklist_updates_mode'] = "MERGE"
        self.__dict__['publish_lists'] = False
        self.__dict__['mirror'] = []
        self.__dict__['dummyproxy'] = None
        self.__dict__['proto'] = 'http://' if self.__dict__['transport'] == 'HTTP' else 'https://'
        self.__dict__['bufsize'] = 4096

        # Development VS. Production
        localpath = os.path.abspath(os.path.join(os.path.dirname(sys.argv[0]), "..", "data"))
        if os.path.exists(localpath):
            self.__dict__['sysdatadir'] = localpath

        self.load()

        if self.__dict__['ssl_key'] is None:
            self.__dict__['ssl_key'] = os.path.join(self.__dict__['datadir'], "certs/tor2web-key.pem")

        if self.__dict__['ssl_cert'] is None:
            self.__dict__['ssl_cert'] = os.path.join(self.__dict__['datadir'], "certs/tor2web-cert.pem")

        if self.__dict__['ssl_intermediate'] is None:
            self.__dict__['ssl_intermediate'] = os.path.join(self.__dict__['datadir'], "certs/tor2web-intermediate.pem")

        if self.__dict__['ssl_dh'] is None:
            self.__dict__['ssl_dh'] = os.path.join(self.__dict__['datadir'], "certs/tor2web-dh.pem")
Example #33
0
    def __init__(self, file_name):
        Storage.__init__(self)

        self.file_name = file_name
Example #34
0
 def __init__(self):
     """
     Create an storage instance with an OpenStack (Swift) storage connection
     """
     Storage.__init__(self, Connection().openstack_swift_connection())