當前位置: 首頁>>代碼示例>>Python>>正文


Python GLSettings.fix_file_permissions方法代碼示例

本文整理匯總了Python中globaleaks.settings.GLSettings.fix_file_permissions方法的典型用法代碼示例。如果您正苦於以下問題:Python GLSettings.fix_file_permissions方法的具體用法?Python GLSettings.fix_file_permissions怎麽用?Python GLSettings.fix_file_permissions使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在globaleaks.settings.GLSettings的用法示例。


在下文中一共展示了GLSettings.fix_file_permissions方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: start_globaleaks

# 需要導入模塊: from globaleaks.settings import GLSettings [as 別名]
# 或者: from globaleaks.settings.GLSettings import fix_file_permissions [as 別名]
    def start_globaleaks(self):
        try:
            GLSettings.fix_file_permissions()
            GLSettings.drop_privileges()
            GLSettings.check_directories()

            # Check presence of an existing database and eventually perform its migration
            check = check_db_files()
            if check == -1:
                 self._reactor.stop()
            elif check == 0:
                yield init_db()
            else:
                yield update_version()
                yield init_appdata()

            yield clean_untracked_files()

            yield refresh_memory_variables()

            if GLSettings.cmdline_options:
                yield apply_cmdline_options()

            self.start_asynchronous_jobs()

            log.msg("GLBackend is now running")
            for ip in GLSettings.bind_addresses:
                log.msg("Visit http://%s:%d to interact with me" % (ip, GLSettings.bind_port))

            for host in GLSettings.accepted_hosts:
                if host not in GLSettings.bind_addresses:
                    log.msg("Visit http://%s:%d to interact with me" % (host, GLSettings.bind_port))

            for other in GLSettings.configured_hosts:
                if other:
                    log.msg("Visit %s to interact with me" % other)

            log.msg("Remind: GlobaLeaks is not accessible from other URLs, this is strictly enforced")
            log.msg("Check documentation in https://github.com/globaleaks/GlobaLeaks/wiki/ for special enhancement")

        except Exception as excep:
            log.err("ERROR: Cannot start GlobaLeaks; please manual check the error.")
            log.err("EXCEPTION: %s" % excep)
            self._reactor.stop()
開發者ID:corvolino,項目名稱:GlobaLeaks,代碼行數:46,代碼來源:runner.py

示例2: start_globaleaks

# 需要導入模塊: from globaleaks.settings import GLSettings [as 別名]
# 或者: from globaleaks.settings.GLSettings import fix_file_permissions [as 別名]
    def start_globaleaks(self):
        try:
            GLSettings.fix_file_permissions()
            GLSettings.drop_privileges()
            GLSettings.check_directories()

            GLSettings.orm_tp.start()
            self._reactor.addSystemEventTrigger('after', 'shutdown', GLSettings.orm_tp.stop)

            if GLSettings.initialize_db:
                yield init_db()

            yield clean_untracked_files()

            yield refresh_memory_variables()

            self.start_asynchronous_jobs()

        except Exception as excep:
            log.err("ERROR: Cannot start GlobaLeaks; please manually check the error.")
            log.err("EXCEPTION: %s" % excep)
            self._reactor.stop()
開發者ID:Taipo,項目名稱:GlobaLeaks,代碼行數:24,代碼來源:runner.py

示例3: start_globaleaks

# 需要導入模塊: from globaleaks.settings import GLSettings [as 別名]
# 或者: from globaleaks.settings.GLSettings import fix_file_permissions [as 別名]
    def start_globaleaks(self):
        try:
            GLSettings.fix_file_permissions()
            GLSettings.drop_privileges()
            GLSettings.check_directories()

            if GLSettings.initialize_db:
                yield init_db()
            else:
                yield update_version()
                yield init_appdata()

            yield clean_untracked_files()

            yield refresh_memory_variables()

            self.start_asynchronous_jobs()

        except Exception as excep:
            log.err("ERROR: Cannot start GlobaLeaks; please manual check the error.")
            log.err("EXCEPTION: %s" % excep)
            self._reactor.stop()
開發者ID:anticorruzione,項目名稱:openwhistleblowing,代碼行數:24,代碼來源:runner.py

示例4: globaleaks_start

# 需要導入模塊: from globaleaks.settings import GLSettings [as 別名]
# 或者: from globaleaks.settings.GLSettings import fix_file_permissions [as 別名]
def globaleaks_start():
    GLSettings.fix_file_permissions()
    GLSettings.drop_privileges()
    GLSettings.check_directories()

    if not GLSettings.accepted_hosts:
        log.err("Missing a list of hosts usable to contact GLBackend, abort")
        return False

    d = create_tables()

    d.addCallback(clean_untracked_files)

    @d.addCallback
    @defer.inlineCallbacks
    def cb(res):
        start_asynchronous()
        yield import_memory_variables()
        tor_configured_hosts = yield apply_cli_options()

        log.msg("GLBackend is now running")
        for ip in GLSettings.bind_addresses:
            log.msg("Visit http://%s:%d to interact with me" % (ip, GLSettings.bind_port))

        for host in GLSettings.accepted_hosts:
            if host not in GLSettings.bind_addresses:
                log.msg("Visit http://%s:%d to interact with me" % (host, GLSettings.bind_port))

        if tor_configured_hosts:
            for other in tor_configured_hosts:
                if other:
                    log.msg("Visit %s to interact with me" % other)

        log.msg("Remind: GlobaLeaks is not accessible from other URLs, this is strictly enforced")
        log.msg("Check documentation in https://github.com/globaleaks/GlobaLeaks/wiki/ for special enhancement")

    return True
開發者ID:nsfw,項目名稱:GlobaLeaks,代碼行數:39,代碼來源:runner.py


注:本文中的globaleaks.settings.GLSettings.fix_file_permissions方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。