本文整理汇总了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()
示例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()
示例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()
示例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