~vomun-developers/anonplus/vomun-trunk

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
#! /usr/bin/env python
'''Start the program. Load segments of the program that need to be started and
run them.'''
import time

import libs

print(libs.globals['anon+']['banner'] %
        (libs.globals['anon+']['VERSION'],
        libs.globals['anon+']['BUILD']))

import libs.threadmanager
import libs.browser
import libs.events
import libs.logs

print('''
     == Warning! ==
This is an insecure beta!
This software has various
known weaknesses. Please,
do not depend on it to be
secure! Thank you, ~~Devs
''')

## Startup
if __name__ == '__main__':
    # Create the API Server. Used by external Applications.
    #import api.server
    #api.server.start()

    import libs.morado.morado
    libs.morado.morado.start()

    # Create the console. Later to be replaced with an extenal app
    #from libs.console import console
    #consoleO = console()
    #libs.threadmanager.register(consoleO)
    #consoleO.start()

    # Load and prepare our list of friends
    import libs.friends as friends
    friends.load_friends()

    # Load connection handlers and start
    import tunnels.directudp
    tunnels.directudp.start()

    # Start the web interface
    import uis.web.manager
    uis.web.manager.start()

    libs.browser.open('http://localhost:7777/')

    # Start the storage database
    import libs.storage.manager
    libs.storage.manager.start()

    # Start the API
    ## main loop
    while libs.globals['running']:
        time.sleep(1)

    ## cleanup
    libs.events.broadcast('got_shutdown')
    libs.threadmanager.killall()
    libs.threadmanager.close_sockets()
    friends.save_friends()
    libs.config.save()

    exit()