本文整理匯總了Python中globaleaks.settings.GLSettings.drop_privileges方法的典型用法代碼示例。如果您正苦於以下問題:Python GLSettings.drop_privileges方法的具體用法?Python GLSettings.drop_privileges怎麽用?Python GLSettings.drop_privileges使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類globaleaks.settings.GLSettings
的用法示例。
在下文中一共展示了GLSettings.drop_privileges方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: start_globaleaks
# 需要導入模塊: from globaleaks.settings import GLSettings [as 別名]
# 或者: from globaleaks.settings.GLSettings import drop_privileges [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 drop_privileges [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 drop_privileges [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 drop_privileges [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