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
|
version 0.3.0, rev187, Trusted authorization sites support, --publish option on signing, cryptSign command line option, OpenSSL enabled on OSX, Crypto verify allows list of valid addresses, Option for version 2 json DB tables, DbCursor SELECT parameters bugfix, Add peer to site on ListModified, Download blind includes when new site added, Publish command better messages, Multi-threaded announce, New http Torrent trackers, Wait for dbschema.json on query, Handle json import errors, More compact writeJson storage command, Testcase for signing and verifying, Workaround to make non target=_top links work, More clean UiWebsocket command route, Send cert_user_id on siteinfo, Notify other local clients on local file modify, Option to wait for file download before sql query, File rules websocket API command, Cert add and select, set websocket API command, Put focus on innerframe, innerloaded wrapper api command to add hashtag, Allow more file error on big sites, Keep worker running after stuked on done task, New more stable openSSL layer that works on OSX, Noparallel parameter bugfix, RateLimit allowed again interval bugfix, Updater skips non-writeable files, Try to close openssl dll before update
2015-05-25 01:26:33 +02:00
|
|
|
# Try cleanup openssl
|
|
|
|
try:
|
|
|
|
if "lib.opensslVerify" in sys.modules:
|
2015-05-27 16:58:36 +02:00
|
|
|
sys.modules["lib.opensslVerify"].opensslVerify.closeLibrary()
|
version 0.3.0, rev187, Trusted authorization sites support, --publish option on signing, cryptSign command line option, OpenSSL enabled on OSX, Crypto verify allows list of valid addresses, Option for version 2 json DB tables, DbCursor SELECT parameters bugfix, Add peer to site on ListModified, Download blind includes when new site added, Publish command better messages, Multi-threaded announce, New http Torrent trackers, Wait for dbschema.json on query, Handle json import errors, More compact writeJson storage command, Testcase for signing and verifying, Workaround to make non target=_top links work, More clean UiWebsocket command route, Send cert_user_id on siteinfo, Notify other local clients on local file modify, Option to wait for file download before sql query, File rules websocket API command, Cert add and select, set websocket API command, Put focus on innerframe, innerloaded wrapper api command to add hashtag, Allow more file error on big sites, Keep worker running after stuked on done task, New more stable openSSL layer that works on OSX, Noparallel parameter bugfix, RateLimit allowed again interval bugfix, Updater skips non-writeable files, Try to close openssl dll before update
2015-05-25 01:26:33 +02:00
|
|
|
except Exception, err:
|
|
|
|
print "Error closing openssl", err
|
|
|
|
|
2015-02-20 01:37:12 +01:00
|
|
|
# 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()
|
version 0.3.0, rev187, Trusted authorization sites support, --publish option on signing, cryptSign command line option, OpenSSL enabled on OSX, Crypto verify allows list of valid addresses, Option for version 2 json DB tables, DbCursor SELECT parameters bugfix, Add peer to site on ListModified, Download blind includes when new site added, Publish command better messages, Multi-threaded announce, New http Torrent trackers, Wait for dbschema.json on query, Handle json import errors, More compact writeJson storage command, Testcase for signing and verifying, Workaround to make non target=_top links work, More clean UiWebsocket command route, Send cert_user_id on siteinfo, Notify other local clients on local file modify, Option to wait for file download before sql query, File rules websocket API command, Cert add and select, set websocket API command, Put focus on innerframe, innerloaded wrapper api command to add hashtag, Allow more file error on big sites, Keep worker running after stuked on done task, New more stable openSSL layer that works on OSX, Noparallel parameter bugfix, RateLimit allowed again interval bugfix, Updater skips non-writeable files, Try to close openssl dll before update
2015-05-25 01:26:33 +02:00
|
|
|
traceback.print_exc(file=open("log/error.log", "a"))
|
2015-02-20 01:37:12 +01:00
|
|
|
|
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
|
|
|
|