]> git.llucax.com Git - software/pymin.git/blob - config.py
Merge branch 'master' of baryon.com.ar:/home/luca/pymin
[software/pymin.git] / config.py
1 # vim: set et sts=4 sw=4 encoding=utf-8 :
2
3 from pymin.services import *
4 from pymin.dispatcher import Handler
5 from os.path import join
6
7 base_path = join('var', 'lib', 'pymin')
8 pickle_path = join(base_path, 'pickle')
9 # FIXME, this should be specific for each service
10 config_path = join(base_path, 'config')
11
12 class Root(Handler):
13
14     def __init__(self):
15         f = file("/proc/sys/net/ipv4/ip_forward","w")
16         f.write("1")
17         f.close()
18         #self.ip.device_up_hook(self.dns)
19
20     firewall = FirewallHandler(
21         pickle_dir = join(pickle_path, 'firewall'),
22         config_dir = join(config_path, 'firewall'))
23
24     nat = NatHandler(pickle_dir = join(pickle_path, 'nat'))
25
26     ppp = PppHandler(
27         pickle_dir = join(pickle_path, 'ppp'),
28         config_dir = {
29             'pap-secrets':  join(config_path, 'ppp'),
30             'chap-secrets': join(config_path, 'ppp'),
31             'options.X':    join(config_path, 'ppp'),
32             'nameX':        join(config_path, 'ppp', 'peers'),
33         })
34
35     vpn = VpnHandler(
36          pickle_dir = join(pickle_path, 'vpn'),
37          config_dir = join(config_path, 'vpn'))
38
39     ip = IpHandler(
40         pickle_dir = join(pickle_path, 'ip'),
41         config_dir = join(config_path, 'ip'))
42
43     dns = DnsHandler(
44         pickle_dir = join(pickle_path, 'dns'),
45         config_dir = {
46             'named.conf': join(config_path, 'dns'),
47             'zoneX.zone': join(config_path, 'dns', 'zones'),
48         })
49
50     dhcp = DhcpHandler(
51         pickle_dir = join(pickle_path, 'dhcp'),
52         config_dir = join(config_path, 'dhcp'))
53
54     proxy = ProxyHandler(
55         pickle_dir = join(pickle_path, 'proxy'),
56         config_dir = join(config_path, 'proxy'))
57
58     vrrp = VrrpHandler(
59         pickle_dir = join(pickle_path, 'vrrp'),
60         config_dir = join(config_path, 'vrrp'),
61         pid_dir    = join(config_path, 'vrrp', 'run'))
62
63     vpn = VpnHandler(
64         pickle_dir = join(pickle_path, 'vpn'),
65         config_dir = join(config_path, 'vpn'))
66
67     #qos = QoSHandler(
68     #    pickle_dir = join(pickle_path, 'qos'),
69     #    config_dir = join(config_path, 'qos'))
70
71 bind_addr = \
72 (
73     '',   # Bind IP ('' is ANY)
74     9999, # Port
75 )
76