2015-01-12 19:11:35 +01:00
|
|
|
#!/usr/bin/env python
|
2015-01-12 02:03:45 +01:00
|
|
|
|
2015-01-26 20:09:49 +01:00
|
|
|
def main():
|
2015-04-28 00:43:17 +02:00
|
|
|
print "- Starting ZeroNet..."
|
version 0.2.7, plugin system, multiuser plugin for zeroproxies, reworked imports, cookie parse, stats moved to plugin, usermanager class, dont generate site auth on listing, multiline notifications, allow server side prompt from user, update script keep plugins disabled status
2015-03-24 01:33:09 +01:00
|
|
|
import sys, os
|
rev125, Class statistics, OpenSSL disabled on OSX by default because of possible segfault, --disable_openssl command line parameter, Save memory on Connection, Peer and FileRequest objects using slots, Dont store modification time from the far future, Able to query modified files from peer, Allow reannounce in 30secs, Use with command in SiteStorage, Always create dir before write file, PeerCmd shell command to query specific command from peer
2015-04-29 23:12:45 +02:00
|
|
|
main = None
|
2015-02-20 01:37:12 +01:00
|
|
|
try:
|
version 0.2.7, plugin system, multiuser plugin for zeroproxies, reworked imports, cookie parse, stats moved to plugin, usermanager class, dont generate site auth on listing, multiline notifications, allow server side prompt from user, update script keep plugins disabled status
2015-03-24 01:33:09 +01:00
|
|
|
sys.path.insert(0, os.path.join(os.path.dirname(__file__), "src")) # Imports relative to src
|
|
|
|
import main
|
2015-02-20 01:37:12 +01:00
|
|
|
main.start()
|
|
|
|
if main.update_after_shutdown: # Updater
|
|
|
|
import update, sys, os, gc
|
|
|
|
# Update
|
|
|
|
update.update()
|
|
|
|
|
|
|
|
# Close log files
|
2015-04-09 22:20:33 +02:00
|
|
|
logger = sys.modules["main"].logging.getLogger()
|
2015-02-20 01:37:12 +01:00
|
|
|
|
|
|
|
for handler in logger.handlers[:]:
|
|
|
|
handler.flush()
|
|
|
|
handler.close()
|
|
|
|
logger.removeHandler(handler)
|
|
|
|
|
|
|
|
except Exception, err: # Prevent closing
|
|
|
|
import traceback
|
|
|
|
traceback.print_exc()
|
|
|
|
raw_input("-- Error happened, press enter to close --")
|
|
|
|
|
rev125, Class statistics, OpenSSL disabled on OSX by default because of possible segfault, --disable_openssl command line parameter, Save memory on Connection, Peer and FileRequest objects using slots, Dont store modification time from the far future, Able to query modified files from peer, Allow reannounce in 30secs, Use with command in SiteStorage, Always create dir before write file, PeerCmd shell command to query specific command from peer
2015-04-29 23:12:45 +02:00
|
|
|
if main and main.update_after_shutdown: # Updater
|
2015-02-20 01:37:12 +01:00
|
|
|
# Restart
|
|
|
|
gc.collect() # Garbage collect
|
|
|
|
print "Restarting..."
|
|
|
|
args = sys.argv[:]
|
|
|
|
args.insert(0, sys.executable)
|
|
|
|
if sys.platform == 'win32':
|
|
|
|
args = ['"%s"' % arg for arg in args]
|
|
|
|
os.execv(sys.executable, args)
|
|
|
|
print "Bye."
|
2015-01-26 20:09:49 +01:00
|
|
|
|
|
|
|
if __name__ == '__main__':
|
2015-02-20 01:37:12 +01:00
|
|
|
main()
|
version 0.2.4, peerPing and peerGetFile commands, old content update bugfix, new network code and protocol, connection share between sites, connection reuse, dont retry bad file more than 3 times in 20 min, multi threaded include file download, shuffle peers before publish, simple internal stats page, dont retry on failed peers, more than 10 peers publish bugfix
2015-02-23 23:33:31 +01:00
|
|
|
|