1
2
3
4
5
6
7
8 """
9 Fichier de configuration de l'application Zephir
10 """
11 from os.path import join, dirname, abspath
12 from creole.parsedico import parse_dico
13 import locale
14 from twisted.python import log
15 log.FileLogObserver.timeFormat = "%Y/%m/%d %H:%M:%S %Z"
16
17 conf = parse_dico()
18
19 charset = "UTF-8"
20
21 ADRESSE_LDAP = conf["serveur_ldap"]
22 ADRESSE_ZEPHIR = conf["adresse_ip_eth0"]
23 BASE_LDAP = conf["base_ldap"]
24 PORT_HTTP = "8090"
25 PORT_ZEPHIR = "7080"
26 PORT_WEB = 8070
27 NO_LOCAL_AGENTS = conf.get("no_local_agents", "non")
28
29 LOG_ACTIONS = False
30 if conf.get('log_actions', 'non') == 'oui':
31
32 LOG_ACTIONS = True
33
34
35 ROOT_DIR = "/usr/share/zephir/"
36 PORT_AGENT = "8090"
37 AGENT_DIR = "agents"
38 CLIENT_UPDATE_HOST = "eole.orion.education.fr"
39 CLIENT_UPDATE_URL = "/Extras/RPMS"
40 CLIENT_NG_URL = "/Extras/RPMS/eoleng"
41 SERVEURS_MAJ_CLIENTS = conf['serveur_maj_clients']
42
43 MAIL_ADRESSE = conf["serveur_smtp"]
44 MAIL_PORT = conf["port_smtp"]
45 MAIL_ACCOUNT = conf["compte_smtp"]
46
47
48 PATH_ZEPHIR = "/var/lib/zephir/"
49 PATH_TEMP = join("/tmp", "zephir_temp")
50 ADRESSE_SAUVEGARDE = join(PATH_ZEPHIR, 'user_prefs')
51
52
53 PRELUDE_PORT = 4691
54
55 liste_modules = {1:('amon-1.5','sphynx-1.1','scribe-1.0','horus-1.0'),
56 2:('amon-2.0','sphynx-2.0','scribe-2.0','horus-2.0','zephir-2.0','preludemanager-2.0','zephirlogs-2.0','sentinelle-2.0'),
57 3:('amon-2.1','sphynx-2.1','scribe-2.1','horus-2.1','zephir-2.1','preludemanager-2.1','zephirlogs-2.1','sentinelle-2.1','eclair-2.1'),
58 4:('amon-2.2','sphynx-2.2','scribe-2.2','horus-2.2','zephir-2.2','preludemanager-2.2','zephirlogs-2.2','sentinelle-2.2','eclair-2.2','amonecole-2.2','seshat-2.2', 'eolebase-2.2'),
59 }
60
61
62 allowed_upgrades = {'horus':{2:[4]},
63 'scribe':{2:[4]},
64 'amon':{2:[4]}
65 }
66
67 allowed_mod_edits = {4:{'amon':['amonecole'],
68 'amonecole':['amon']}
69 }
70
71
72 DISTRIBS = {1:("Mdk 9.X", "1.X", False),
73 2:("feisty", "2.0", False),
74 3:("gutsy", "2.1", False),
75 4:("hardy", "2.2", True)}
76
77
78 verrous = {'uucp':['Execution des tâches Zephir'],
79 'sauvegarde':['Maj-Auto','Maj-Cd'],
80 'maj':[],
81 'configure':[],
82 'reconfigure':[]}
83
84
85 data_files = {0:('Tout', ['dicos','patchs','fichiers_perso','fichiers_zephir','zephir.eol','dico.eol','auth_keys','droits_zephir', 'droits_variante']),
86 1:('Dictionnaires/templates/patchs/configuration/clés ssh', ['dicos','patchs','fichiers_perso','zephir.eol','auth_keys']),
87 2:('Dictionnaires/templates/patchs', ['dicos','patchs','fichiers_perso']),
88 3:('Fichiers divers/paquets', ['fichiers_zephir', 'droits_zephir', 'droits_variante']),
89 4:('Configuration seulement (config.eol)', ['zephir.eol']),
90 5:('Clés ssh seulement', ['auth_keys']),
91 }
92
93
94 type_res_label = {'rne':('numéro RNE', 'etablissements', 'rne'),
95 'groupe':('numéro de groupe', 'groupes_serveurs', 'id'),
96 'id_s':('numéro de serveur', 'serveurs', 'id'),
97 'id_var':('numéro de variante', 'variantes', 'id'),
98 'id_mod':('numéro de module', 'modules', 'id'),
99 }
100
101
102 xml_table={'\\xc9':'\\xc3\\xa9',
103 '\\xe9':'\\xc3\\xa9',
104 '\\xc8':'\\xc3\\xa8',
105 '\\xe8':'\\xc3\\xa8',
106 '\\xf4':'\\xc3\\xb4',
107 '\\xe0':'\\xc3\\xa0',
108 }
109
110
111 SCAN_DELAY = 300
112